From patchwork Thu Feb 16 02:02:59 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [meta-oe, v2] 05/22] automatically install all *.service and *.socket supplied in recipe's SRC_URI Date: Thu, 16 Feb 2012 02:02:59 -0000 From: =?utf-8?q?Andreas_M=C3=BCller_=3Cschnitzeltony=40googlemail=2Ecom=3E?= X-Patchwork-Id: 21293 Message-Id: <1329357796-27398-6-git-send-email-schnitzeltony@googlemail.com> To: openembedded-devel@lists.openembedded.org Signed-off-by: Andreas Müller Acked-by: Otavio Salvador --- meta-oe/classes/systemd.bbclass | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/meta-oe/classes/systemd.bbclass b/meta-oe/classes/systemd.bbclass index 0ea03ee..b2cf775 100644 --- a/meta-oe/classes/systemd.bbclass +++ b/meta-oe/classes/systemd.bbclass @@ -78,6 +78,17 @@ python __anonymous() { systemd_after_parse(d) } +# automatically install all *.service and *.socket supplied in recipe's SRC_URI +do_install_append() { + install -d ${D}${base_libdir}/systemd/system + for service in `find ${WORKDIR} -maxdepth 1 -name '*.service' -o -name '*.socket'` ; do + # ensure installing systemd-files only (e.g not avahi *.service) + if grep -q '\[Unit\]' $service ; then + install -m 644 $service ${D}${base_libdir}/systemd/system + fi + done +} + python populate_packages_prepend () { def systemd_generate_package_scripts(pkg): bb.debug(1, 'adding systemd calls to postinst/postrm for %s' % pkg)