]> code.ossystems Code Review - openembedded-core.git/commitdiff
distcc: add systemd support
authorChen Qi <Qi.Chen@windriver.com>
Fri, 17 Jan 2014 05:51:12 +0000 (00:51 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 28 Jan 2014 00:48:24 +0000 (00:48 +0000)
Add systemd support for distcc.

These unit files mainly use the same files in Fedora 20 as a reference.

[YOCTO #4420]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/recipes-devtools/distcc/distcc_3.1.bb
meta/recipes-devtools/distcc/files/default
meta/recipes-devtools/distcc/files/distccd.service [new file with mode: 0644]

index e351a58192c1e1cf1128c931386d33ca8acca3e7..c3cbd05f0e89f2016d72da4519cedf08c51ec00b 100644 (file)
@@ -22,12 +22,13 @@ SRC_URI = "http://distcc.googlecode.com/files/${BPN}-${PV}.tar.bz2 \
            file://separatebuilddir.patch \
            file://default \
            file://distccmon-gnome.desktop \
-           file://distcc"
+           file://distcc \
+           file://distccd.service"
 
 SRC_URI[md5sum] = "a1a9d3853df7133669fffec2a9aab9f3"
 SRC_URI[sha256sum] = "f55dbafd76bed3ce57e1bbcdab1329227808890d90f4c724fcd2d53f934ddd89"
 
-inherit autotools pkgconfig update-rc.d useradd
+inherit autotools pkgconfig update-rc.d useradd systemd
 
 EXTRA_OECONF += "--disable-Werror PYTHON=/dev/null"
 
@@ -40,11 +41,17 @@ USERADD_PARAM_${PN} = "--system \
 
 INITSCRIPT_NAME = "distcc"
 
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "distccd.service"
+
 do_install_append() {
     install -d ${D}${sysconfdir}/init.d/
     install -d ${D}${sysconfdir}/default
     install -m 0755 ${WORKDIR}/distcc ${D}${sysconfdir}/init.d/
     install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/distcc
+    install -d ${D}${systemd_unitdir}/system/
+    install -m 0644 ${WORKDIR}/distccd.service ${D}${systemd_unitdir}/system
+    sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_unitdir}/system/distccd.service
     ${DESKTOPINSTALL}
 }
 DESKTOPINSTALL = ""
@@ -58,7 +65,8 @@ FILES_${PN} = " ${sysconfdir} \
                ${bindir}/distcc \
     ${bindir}/lsdistcc \
                ${bindir}/distccd \
-               ${bindir}/distccmon-text"
+               ${bindir}/distccmon-text \
+               ${systemd_unitdir}/system/distccd.service"
 FILES_distcc-distmon-gnome = "  ${bindir}/distccmon-gnome \
                                ${datadir}/distcc"
 
index 95290f84880e25575bdc82b4740888e5a6050ae4..63c4159b9d1b8a28e191b2e85b59ed0d1ef0604c 100644 (file)
@@ -17,3 +17,8 @@ STARTDISTCC="true"
 # ALLOWEDNETS="127.0.0.1"
 
 ALLOWEDNETS="192.168.7.0/24"
+
+#
+# OPTIONS is used for the systemd service file
+#
+OPTIONS="--allow 192.168.7.0/24"
diff --git a/meta/recipes-devtools/distcc/files/distccd.service b/meta/recipes-devtools/distcc/files/distccd.service
new file mode 100644 (file)
index 0000000..0253ddf
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=Distccd A Distributed Compilation Server
+After=network.target
+
+[Service]
+User=distcc
+EnvironmentFile=-/etc/default/distcc
+ExecStart=@BINDIR@/distccd --verbose --no-detach --daemon $OPTIONS
+
+[Install]
+WantedBy=multi-user.target