summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi xin <lixin.fnst@cn.fujitsu.com>2015-06-05 16:49:26 +0800
committerJoe MacDonald <joe_macdonald@mentor.com>2015-06-05 19:05:40 -0400
commit6a84fe282ec641a07bc258fadeba475e8d326e68 (patch)
tree8ac87f0285dcee08017ef9ec88e9869a6560cc27
parent40639902b51f88d15de30cbe9c1d98ada4685486 (diff)
downloadmeta-openembedded-6a84fe282ec641a07bc258fadeba475e8d326e68.tar.gz
dovecot: add systemd support and add user dovecot dovenull which is need to start dovecot service.
Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
-rw-r--r--meta-networking/recipes-support/dovecot/dovecot/dovecot.service14
-rw-r--r--meta-networking/recipes-support/dovecot/dovecot/dovecot.socket14
-rw-r--r--meta-networking/recipes-support/dovecot/dovecot_2.2.10.bb26
3 files changed, 51 insertions, 3 deletions
diff --git a/meta-networking/recipes-support/dovecot/dovecot/dovecot.service b/meta-networking/recipes-support/dovecot/dovecot/dovecot.service
new file mode 100644
index 000000000..ca250ea5d
--- /dev/null
+++ b/meta-networking/recipes-support/dovecot/dovecot/dovecot.service
@@ -0,0 +1,14 @@
1[Unit]
2Description=Dovecot IMAP/POP3 email server
3After=local-fs.target network.target
4
5[Service]
6Type=simple
7EnvironmentFile=-@SYSCONFDIR@/sysconfig/dovecot
8ExecStart=@SBINDIR@/dovecot -F
9ExecReload=/bin/kill -HUP $MAINPID
10NonBlocking=yes
11
12[Install]
13WantedBy=multi-user.target
14
diff --git a/meta-networking/recipes-support/dovecot/dovecot/dovecot.socket b/meta-networking/recipes-support/dovecot/dovecot/dovecot.socket
new file mode 100644
index 000000000..556e1a850
--- /dev/null
+++ b/meta-networking/recipes-support/dovecot/dovecot/dovecot.socket
@@ -0,0 +1,14 @@
1[Unit]
2Description=Dovecot IMAP/POP3 email server activation socket
3
4[Socket]
5#dovecot expects separate IPv4 and IPv6 sockets
6BindIPv6Only=ipv6-only
7ListenStream=0.0.0.0:143
8ListenStream=[::]:143
9ListenStream=0.0.0.0:993
10ListenStream=[::]:993
11KeepAlive=true
12
13[Install]
14WantedBy=sockets.target
diff --git a/meta-networking/recipes-support/dovecot/dovecot_2.2.10.bb b/meta-networking/recipes-support/dovecot/dovecot_2.2.10.bb
index f733a7832..82225b002 100644
--- a/meta-networking/recipes-support/dovecot/dovecot_2.2.10.bb
+++ b/meta-networking/recipes-support/dovecot/dovecot_2.2.10.bb
@@ -7,13 +7,15 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=a981379bd0f1c362f8d1d21515e5b30b"
7SRC_URI = "http://dovecot.org/releases/2.2/dovecot-${PV}.tar.gz \ 7SRC_URI = "http://dovecot.org/releases/2.2/dovecot-${PV}.tar.gz \
8 file://0001-configure.ac-convert-AC_TRY_RUN-to-AC_TRY_LINK-state.patch \ 8 file://0001-configure.ac-convert-AC_TRY_RUN-to-AC_TRY_LINK-state.patch \
9 file://building-rquota_xdr.c-depend-on-rquota.h.patch \ 9 file://building-rquota_xdr.c-depend-on-rquota.h.patch \
10 " 10 file://dovecot.service \
11 file://dovecot.socket"
12
11SRC_URI[md5sum] = "037e9c9e07d9dbff54dcff09f280fc8c" 13SRC_URI[md5sum] = "037e9c9e07d9dbff54dcff09f280fc8c"
12SRC_URI[sha256sum] = "75592483d40dc4f76cc3b41af40caa4be80478946a699d46846d5d03e4d2e09b" 14SRC_URI[sha256sum] = "75592483d40dc4f76cc3b41af40caa4be80478946a699d46846d5d03e4d2e09b"
13 15
14DEPENDS = "openssl xz zlib bzip2 libcap" 16DEPENDS = "openssl xz zlib bzip2 libcap"
15 17
16inherit autotools pkgconfig 18inherit autotools pkgconfig systemd useradd
17 19
18PACKAGECONFIG ??= " \ 20PACKAGECONFIG ??= " \
19 ${@base_contains('DISTRO_FEATURES', 'ldap', 'ldap', '', d)} \ 21 ${@base_contains('DISTRO_FEATURES', 'ldap', 'ldap', '', d)} \
@@ -37,7 +39,25 @@ CACHED_CONFIGUREVARS += "i_cv_signed_size_t=no \
37 39
38# hardcode epoll() to avoid running unsafe tests 40# hardcode epoll() to avoid running unsafe tests
39# BSD needs kqueue and uclibc poll() 41# BSD needs kqueue and uclibc poll()
40EXTRA_OECONF = " --with-ioloop=epoll" 42EXTRA_OECONF = " --with-ioloop=epoll \
43 --with-systemdsystemunitdir=${systemd_unitdir}/system"
44
45SYSTEMD_PACKAGES = "${PN}"
46SYSTEMD_SERVICE_${PN} = "dovecot.service dovecot.socket"
47SYSTEMD_AUTO_ENABLE = "disable"
48
49do_install_append () {
50 install -d 755 ${D}/etc/dovecot
51 touch 644 ${D}/etc/dovecot/dovecot.conf
52 install -m 0644 ${WORKDIR}/dovecot.service ${D}${systemd_unitdir}/system
53 sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/dovecot.service
54 sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/dovecot.service
55}
56
57USERADD_PACKAGES = "${PN}"
58USERADD_PARAM_${PN} = "-r -d ${libexecdir} -M -s ${base_sbindir}/nologin -g dovecot dovecot; \
59 -r -d ${libexecdir} -M -s ${base_sbindir}/nologin -g dovenull dovenull"
60GROUPADD_PARAM_${PN} = "-f -r dovecot;-f -r dovenull"
41 61
42FILES_${PN}-staticdev += "${libdir}/dovecot/*/*.a" 62FILES_${PN}-staticdev += "${libdir}/dovecot/*/*.a"
43FILES_${PN}-dev += "${libdir}/dovecot/*.so" 63FILES_${PN}-dev += "${libdir}/dovecot/*.so"