diff options
author | Bian Naimeng <biannm@cn.fujitsu.com> | 2015-02-15 16:58:23 +0800 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2015-02-23 13:38:49 -0500 |
commit | b740f2712f122712b541d1fc1b2db3c43a18c97c (patch) | |
tree | ec223f0dc1a7b5bb640fdb7b1c8eb18f12d89972 /meta-networking/recipes-daemons/cyrus-sasl | |
parent | 7b3d4803b42f1afcdceab0e29cf8eda14fcd4a87 (diff) | |
download | meta-openembedded-b740f2712f122712b541d1fc1b2db3c43a18c97c.tar.gz |
cyrus-sasl: add systemd supported for saslauthd
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-daemons/cyrus-sasl')
3 files changed, 52 insertions, 2 deletions
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.conf b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.conf new file mode 100644 index 000000000..a91a9d334 --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.conf | |||
@@ -0,0 +1,11 @@ | |||
1 | # Directory in which to place saslauthd's listening socket, pid file, and so | ||
2 | # on. This directory must already exist. | ||
3 | SOCKETDIR=@LOCALSTATEDIR@/run/saslauthd | ||
4 | |||
5 | # Mechanism to use when checking passwords. Run "saslauthd -v" to get a list | ||
6 | # of which mechanism your installation was compiled with the ablity to use. | ||
7 | MECH=pam | ||
8 | |||
9 | # Additional flags to pass to saslauthd on the command line. See saslauthd(8) | ||
10 | # for the list of accepted flags. | ||
11 | FLAGS= | ||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.service b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.service new file mode 100644 index 000000000..96dbae378 --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/saslauthd.service | |||
@@ -0,0 +1,12 @@ | |||
1 | [Unit] | ||
2 | Description=SASL authentication daemon. | ||
3 | After=syslog.target | ||
4 | |||
5 | [Service] | ||
6 | Type=forking | ||
7 | PIDFile=@LOCALSTATEDIR@/run/saslauthd/saslauthd.pid | ||
8 | EnvironmentFile=@SYSCONFDIR@/default/saslauthd | ||
9 | ExecStart=@SBINDIR@/saslauthd -m $SOCKETDIR -a $MECH $FLAGS | ||
10 | |||
11 | [Install] | ||
12 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb index 491ecdb9a..c235a1b95 100644 --- a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb | |||
@@ -10,9 +10,11 @@ SRC_URI = "ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-${PV}.tar.gz \ | |||
10 | file://debian_patches_0009_sasldb_al.diff \ | 10 | file://debian_patches_0009_sasldb_al.diff \ |
11 | file://debian_patches_0014_avoid_pic_overwrite.diff \ | 11 | file://debian_patches_0014_avoid_pic_overwrite.diff \ |
12 | file://sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch \ | 12 | file://sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch \ |
13 | file://saslauthd.service \ | ||
14 | file://saslauthd.conf \ | ||
13 | " | 15 | " |
14 | 16 | ||
15 | inherit autotools-brokensep pkgconfig useradd | 17 | inherit autotools-brokensep pkgconfig useradd systemd |
16 | 18 | ||
17 | EXTRA_OECONF += "--with-dblib=berkeley \ | 19 | EXTRA_OECONF += "--with-dblib=berkeley \ |
18 | --with-bdb-libdir=${STAGING_LIBDIR} \ | 20 | --with-bdb-libdir=${STAGING_LIBDIR} \ |
@@ -51,17 +53,42 @@ do_compile_prepend () { | |||
51 | cd .. | 53 | cd .. |
52 | } | 54 | } |
53 | 55 | ||
56 | do_install_append() { | ||
57 | if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then | ||
58 | install -d ${D}${systemd_unitdir}/system | ||
59 | install -m 0644 ${WORKDIR}/saslauthd.service ${D}${systemd_unitdir}/system | ||
60 | |||
61 | sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/saslauthd.service | ||
62 | sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${systemd_unitdir}/system/saslauthd.service | ||
63 | sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/saslauthd.service | ||
64 | |||
65 | install -d ${D}${sysconfdir}/tmpfiles.d | ||
66 | echo "d /run/saslauthd/ - - - -" > ${D}${sysconfdir}/tmpfiles.d/saslauthd.conf | ||
67 | |||
68 | install -d ${D}${sysconfdir}/default/ | ||
69 | install -m 0644 ${WORKDIR}/saslauthd.conf ${D}${sysconfdir}/default/saslauthd | ||
70 | sed -i -e 's#@LOCALSTATEDIR@#${localstatedir}#g' ${D}${sysconfdir}/default/saslauthd | ||
71 | fi | ||
72 | } | ||
73 | |||
54 | USERADD_PACKAGES = "${PN}-bin" | 74 | USERADD_PACKAGES = "${PN}-bin" |
55 | GROUPADD_PARAM_${PN}-bin = "--system mail" | 75 | GROUPADD_PARAM_${PN}-bin = "--system mail" |
56 | USERADD_PARAM_${PN}-bin = "--system --home=/var/spool/mail -g mail cyrus" | 76 | USERADD_PARAM_${PN}-bin = "--system --home=/var/spool/mail -g mail cyrus" |
57 | 77 | ||
78 | SYSTEMD_PACKAGES = "${PN}" | ||
79 | SYSTEMD_SERVICE_${PN} = "saslauthd.service" | ||
80 | SYSTEMD_AUTO_ENABLE = "disable" | ||
81 | |||
58 | SRC_URI[md5sum] = "a7f4e5e559a0e37b3ffc438c9456e425" | 82 | SRC_URI[md5sum] = "a7f4e5e559a0e37b3ffc438c9456e425" |
59 | SRC_URI[sha256sum] = "8fbc5136512b59bb793657f36fadda6359cae3b08f01fd16b3d406f1345b7bc3" | 83 | SRC_URI[sha256sum] = "8fbc5136512b59bb793657f36fadda6359cae3b08f01fd16b3d406f1345b7bc3" |
60 | 84 | ||
61 | PACKAGES =+ "${PN}-bin" | 85 | PACKAGES =+ "${PN}-bin" |
62 | 86 | ||
63 | FILES_${PN} += "${libdir}/sasl2/*.so*" | 87 | FILES_${PN} += "${libdir}/sasl2/*.so*" |
64 | FILES_${PN}-bin += "${bindir}" | 88 | FILES_${PN}-bin += "${bindir} \ |
89 | ${sysconfdir}/default/saslauthd \ | ||
90 | ${systemd_unitdir}/system/saslauthd.service \ | ||
91 | ${sysconfdir}/tmpfiles.d/saslauthd.conf" | ||
65 | FILES_${PN}-dev += "${libdir}/sasl2/*.la" | 92 | FILES_${PN}-dev += "${libdir}/sasl2/*.la" |
66 | FILES_${PN}-dbg += "${libdir}/sasl2/.debug" | 93 | FILES_${PN}-dbg += "${libdir}/sasl2/.debug" |
67 | FILES_${PN}-staticdev += "${libdir}/sasl2/*.a" | 94 | FILES_${PN}-staticdev += "${libdir}/sasl2/*.a" |