summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2014-01-17 00:51:12 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-28 00:48:24 +0000
commitbaae0b0e8786e26b60e17c4febd57ca1915f1e55 (patch)
tree7109d40ffdc2662c335b7b3cc499173300b23f89
parent4379e6f3096c893db5fa6a0b4569a0440e4494fe (diff)
downloadopenembedded-core-baae0b0e8786e26b60e17c4febd57ca1915f1e55.tar.gz
openembedded-core-baae0b0e8786e26b60e17c4febd57ca1915f1e55.tar.bz2
openembedded-core-baae0b0e8786e26b60e17c4febd57ca1915f1e55.zip
distcc: add systemd support
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>
-rw-r--r--meta/recipes-devtools/distcc/distcc_3.1.bb14
-rw-r--r--meta/recipes-devtools/distcc/files/default5
-rw-r--r--meta/recipes-devtools/distcc/files/distccd.service11
3 files changed, 27 insertions, 3 deletions
diff --git a/meta/recipes-devtools/distcc/distcc_3.1.bb b/meta/recipes-devtools/distcc/distcc_3.1.bb
index e351a58192..c3cbd05f0e 100644
--- a/meta/recipes-devtools/distcc/distcc_3.1.bb
+++ b/meta/recipes-devtools/distcc/distcc_3.1.bb
@@ -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"
diff --git a/meta/recipes-devtools/distcc/files/default b/meta/recipes-devtools/distcc/files/default
index 95290f8488..63c4159b9d 100644
--- a/meta/recipes-devtools/distcc/files/default
+++ b/meta/recipes-devtools/distcc/files/default
@@ -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
index 0000000000..0253ddf52a
--- /dev/null
+++ b/meta/recipes-devtools/distcc/files/distccd.service
@@ -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