summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/cups
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2014-09-03 15:09:10 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-03 11:09:05 +0100
commiteaa87ab47214854e3530510610af20098b84bf87 (patch)
tree95a5a2f85e8080041a619236298562ad58d7ce57 /meta/recipes-extended/cups
parentcd8255bb4d8ea54cbf88aaa4c0914573571b91f6 (diff)
downloadpoky-eaa87ab47214854e3530510610af20098b84bf87.tar.gz
cups: add systemd support
Add systemd unit files. Also remove sysvinit related files if 'sysvinit' is not in DISTRO_FEATURES. (From OE-Core rev: 020065d3c57ccdc86c47cd0fc288071cdd194bbc) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/cups')
-rw-r--r--meta/recipes-extended/cups/cups.inc20
-rw-r--r--meta/recipes-extended/cups/cups/cups.path8
-rw-r--r--meta/recipes-extended/cups/cups/cups.service10
-rw-r--r--meta/recipes-extended/cups/cups/cups.socket8
4 files changed, 45 insertions, 1 deletions
diff --git a/meta/recipes-extended/cups/cups.inc b/meta/recipes-extended/cups/cups.inc
index 162b3fd844..fbdc48eab1 100644
--- a/meta/recipes-extended/cups/cups.inc
+++ b/meta/recipes-extended/cups/cups.inc
@@ -8,15 +8,20 @@ SRC_URI = "http://www.cups.org/software/${PV}/${BP}-source.tar.bz2 \
8 file://0001-don-t-try-to-run-generated-binaries.patch \ 8 file://0001-don-t-try-to-run-generated-binaries.patch \
9 file://cups_serverbin.patch \ 9 file://cups_serverbin.patch \
10 file://cups-no-gcrypt.patch \ 10 file://cups-no-gcrypt.patch \
11 file://cups.socket \
12 file://cups.path \
13 file://cups.service \
11 " 14 "
12 15
13LEAD_SONAME = "libcupsdriver.so" 16LEAD_SONAME = "libcupsdriver.so"
14 17
15inherit autotools-brokensep binconfig useradd 18inherit autotools-brokensep binconfig useradd systemd
16 19
17USERADD_PACKAGES = "${PN}" 20USERADD_PACKAGES = "${PN}"
18GROUPADD_PARAM_${PN} = "--system lpadmin" 21GROUPADD_PARAM_${PN} = "--system lpadmin"
19 22
23SYSTEMD_SERVICE_${PN} = "cups.socket cups.path cups.service"
24
20PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \ 25PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
21 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" 26 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
22PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi" 27PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
@@ -71,6 +76,19 @@ fakeroot do_install () {
71 # Remove /var/run from package as cupsd will populate it on startup 76 # Remove /var/run from package as cupsd will populate it on startup
72 rm -fr ${D}/${localstatedir}/run 77 rm -fr ${D}/${localstatedir}/run
73 rmdir ${D}/${libdir}/${BPN}/driver 78 rmdir ${D}/${libdir}/${BPN}/driver
79
80 # Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES
81 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then
82 rm -rf ${D}${sysconfdir}/init.d/
83 rm -rf ${D}${sysconfdir}/rc*
84 fi
85
86 # Install systemd unit files
87 install -d ${D}${systemd_unitdir}/system
88 install -m 0644 ${WORKDIR}/cups.socket ${D}${systemd_unitdir}/system
89 install -m 0644 ${WORKDIR}/cups.path ${D}${systemd_unitdir}/system
90 install -m 0644 ${WORKDIR}/cups.service ${D}${systemd_unitdir}/system
91 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/cups.service
74} 92}
75 93
76python do_package_append() { 94python do_package_append() {
diff --git a/meta/recipes-extended/cups/cups/cups.path b/meta/recipes-extended/cups/cups/cups.path
new file mode 100644
index 0000000000..de8cc57c27
--- /dev/null
+++ b/meta/recipes-extended/cups/cups/cups.path
@@ -0,0 +1,8 @@
1[Unit]
2Description=CUPS Printer Service Spool
3
4[Path]
5PathExistsGlob=/var/spool/cups/d*
6
7[Install]
8WantedBy=multi-user.target
diff --git a/meta/recipes-extended/cups/cups/cups.service b/meta/recipes-extended/cups/cups/cups.service
new file mode 100644
index 0000000000..7d3e839867
--- /dev/null
+++ b/meta/recipes-extended/cups/cups/cups.service
@@ -0,0 +1,10 @@
1[Unit]
2Description=CUPS Printing Service
3
4[Service]
5ExecStart=@SBINDIR@/cupsd -f
6PrivateTmp=true
7
8[Install]
9Also=cups.socket cups.path
10WantedBy=printer.target
diff --git a/meta/recipes-extended/cups/cups/cups.socket b/meta/recipes-extended/cups/cups/cups.socket
new file mode 100644
index 0000000000..33148705d6
--- /dev/null
+++ b/meta/recipes-extended/cups/cups/cups.socket
@@ -0,0 +1,8 @@
1[Unit]
2Description=CUPS Printing Service Sockets
3
4[Socket]
5ListenStream=/var/run/cups/cups.sock
6
7[Install]
8WantedBy=sockets.target