Patchwork [meta-oe] gtk-update-icon-cache-runonce.bbappend: make it run properly with systemd / add native support

login
register
mail settings
Submitter Andreas Müller
Date March 22, 2012, 7:16 p.m.
Message ID <1332443760-24331-1-git-send-email-schnitzeltony@googlemail.com>
Download mbox | patch
Permalink /patch/24181/
State New, archived
Headers show

Comments

Andreas Müller - March 22, 2012, 7:16 p.m.
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
Signed-off-by: Samuel Stirtzel <s.stirtzel@googlemail.com>
---
 .../gtk+/gtk-update-icon-cache-runonce.bbappend    |   27 ++++++++++++++++++++
 .../gtk-update-icon-cache-runonce.service.in       |   17 ++++++++++++
 2 files changed, 44 insertions(+), 0 deletions(-)
 create mode 100644 meta-oe/recipes-gnome/gtk+/gtk-update-icon-cache-runonce.bbappend
 create mode 100644 meta-oe/recipes-gnome/gtk+/gtk-update-icon-cache-runonce/gtk-update-icon-cache-runonce.service.in

Patch

diff --git a/meta-oe/recipes-gnome/gtk+/gtk-update-icon-cache-runonce.bbappend b/meta-oe/recipes-gnome/gtk+/gtk-update-icon-cache-runonce.bbappend
new file mode 100644
index 0000000..43a1fd6
--- /dev/null
+++ b/meta-oe/recipes-gnome/gtk+/gtk-update-icon-cache-runonce.bbappend
@@ -0,0 +1,27 @@ 
+# look for files in the layer first
+FILESEXTRAPATHS := "${THISDIR}/${PN}"
+
+PRINC = "1"
+
+SRC_URI += "file://gtk-update-icon-cache-runonce.service.in"
+
+do_install_append() {
+	install -d ${D}${systemd_unitdir}/system/basic.target.wants
+	install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
+	sed -e 's,@sysconfdir@,${sysconfdir},g' \
+	     < ${WORKDIR}/gtk-update-icon-cache-runonce.service.in \
+	     > ${D}${systemd_unitdir}/system/gtk-update-icon-cache-runonce.service
+
+	ln -sf ../gtk-update-icon-cache-runonce.service ${D}${systemd_unitdir}/system/basic.target.wants/
+	ln -sf ../gtk-update-icon-cache-runonce.service ${D}${systemd_unitdir}/system/sysinit.target.wants/
+	echo "# remove all service traces to avoid confusing log at subsequent boots
+rm -f ${systemd_unitdir}/system/basic.target.wants/gtk-update-icon-cache-runonce.service
+rm -f ${systemd_unitdir}/system/sysinit.target.wants/gtk-update-icon-cache-runonce.service
+rm -f ${systemd_unitdir}/system/gtk-update-icon-cache-runonce.service" \
+	>> ${D}${sysconfdir}/init.d/gtk-update-icon-cache-runonce
+}
+
+FILES_${PN} += "${systemd_unitdir}/system"
+
+# native recipes inherit gtk-icon-cache which recommends me as native
+BBCLASSEXTEND += "native"
diff --git a/meta-oe/recipes-gnome/gtk+/gtk-update-icon-cache-runonce/gtk-update-icon-cache-runonce.service.in b/meta-oe/recipes-gnome/gtk+/gtk-update-icon-cache-runonce/gtk-update-icon-cache-runonce.service.in
new file mode 100644
index 0000000..b131609
--- /dev/null
+++ b/meta-oe/recipes-gnome/gtk+/gtk-update-icon-cache-runonce/gtk-update-icon-cache-runonce.service.in
@@ -0,0 +1,17 @@ 
+[Unit]
+Description=gtk-update-icon-cache
+DefaultDependencies=no
+ConditionPathExists=|@sysconfdir@/init.d/gtk-update-icon-cache-runonce
+After=run-postinsts.service
+Before=sysinit.target
+
+[Service]
+ExecStart=@sysconfdir@/init.d/gtk-update-icon-cache-runonce
+RemainAfterExit=No
+Type=oneshot
+StandardOutput=syslog
+TimeoutSec=0
+
+[Install]
+WantedBy=basic.target
+WantedBy=sysinit.target