Patchwork [meta-oe] tracker: Do not use hardcoded paths in systemd service files

login
register
mail settings
Submitter Shakeel, Muhammad
Date Sept. 6, 2013, 11:52 a.m.
Message ID <1378468378-16789-1-git-send-email-muhammad_shakeel@mentor.com>
Download mbox | patch
Permalink /patch/57543/
State Accepted, archived
Headers show

Comments

Shakeel, Muhammad - Sept. 6, 2013, 11:52 a.m.
- 'sed' base_bindir and libexecdir in service files to align these
with a particular distro
- Fix whitespaces

Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
---
 .../tracker/files/tracker-dbus.service             |    2 +-
 .../tracker/files/tracker-miner-fs.service         |    2 +-
 .../tracker/files/tracker-store.service            |    2 +-
 meta-oe/recipes-support/tracker/tracker_0.14.2.bb  |   19 +++++++++++--------
 4 files changed, 14 insertions(+), 11 deletions(-)
Shakeel, Muhammad - Sept. 26, 2013, 6:35 a.m.
Greetings,

Any feedback on this? Can this be merged before 1.5 is out?

Thanks,
Shakeel

On 09/06/2013 04:52 PM, Muhammad Shakeel wrote:
> - 'sed' base_bindir and libexecdir in service files to align these
> with a particular distro
> - Fix whitespaces
>
> Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
> ---
>   .../tracker/files/tracker-dbus.service             |    2 +-
>   .../tracker/files/tracker-miner-fs.service         |    2 +-
>   .../tracker/files/tracker-store.service            |    2 +-
>   meta-oe/recipes-support/tracker/tracker_0.14.2.bb  |   19 +++++++++++--------
>   4 files changed, 14 insertions(+), 11 deletions(-)
>
> diff --git a/meta-oe/recipes-support/tracker/files/tracker-dbus.service b/meta-oe/recipes-support/tracker/files/tracker-dbus.service
> index 9d4fb74..c97f49a 100644
> --- a/meta-oe/recipes-support/tracker/files/tracker-dbus.service
> +++ b/meta-oe/recipes-support/tracker/files/tracker-dbus.service
> @@ -8,7 +8,7 @@ BindTo=tracker-store.service
>   [Service]
>   Type=forking
>   EnvironmentFile=-/tmp/tracker.env
> -ExecStartPre=/bin/rm -rf /tmp/tracker.env
> +ExecStartPre=@BASE_BINDIR@/rm -rf /tmp/tracker.env
>   ExecStart=/bin/sh -c 'echo "DBUS_SESSION_BUS_ADDRESS=`dbus-daemon --fork --session --print-address`" > /tmp/tracker.env'
>   
>   [Install]
> diff --git a/meta-oe/recipes-support/tracker/files/tracker-miner-fs.service b/meta-oe/recipes-support/tracker/files/tracker-miner-fs.service
> index f143924..34d9a1e 100644
> --- a/meta-oe/recipes-support/tracker/files/tracker-miner-fs.service
> +++ b/meta-oe/recipes-support/tracker/files/tracker-miner-fs.service
> @@ -6,7 +6,7 @@ Requires=tracker-store.service
>   [Service]
>   Environment=HOME=/home/root
>   EnvironmentFile=-/tmp/tracker.env
> -ExecStart=/usr/libexec/tracker-miner-fs
> +ExecStart=@LIBEXECDIR@/tracker-miner-fs
>   
>   [Install]
>   WantedBy=multi-user.target
> diff --git a/meta-oe/recipes-support/tracker/files/tracker-store.service b/meta-oe/recipes-support/tracker/files/tracker-store.service
> index 7ca9ff0..c5037f3 100644
> --- a/meta-oe/recipes-support/tracker/files/tracker-store.service
> +++ b/meta-oe/recipes-support/tracker/files/tracker-store.service
> @@ -6,7 +6,7 @@ BindTo=tracker-dbus.service
>   
>   [Service]
>   EnvironmentFile=-/tmp/tracker.env
> -ExecStart=/usr/libexec/tracker-store
> +ExecStart=@LIBEXECDIR@/tracker-store
>   
>   [Install]
>   WantedBy=multi-user.target
> diff --git a/meta-oe/recipes-support/tracker/tracker_0.14.2.bb b/meta-oe/recipes-support/tracker/tracker_0.14.2.bb
> index 5838c2d..d6febbf 100644
> --- a/meta-oe/recipes-support/tracker/tracker_0.14.2.bb
> +++ b/meta-oe/recipes-support/tracker/tracker_0.14.2.bb
> @@ -13,7 +13,7 @@ VER_DIR = "${@gnome_verdir("${PV}")}"
>   SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/tracker/${VER_DIR}/tracker-${PV}.tar.xz \
>              file://0005-Fix-missing-gobject-introspection-checks.patch \
>              file://enable-sqlite-crosscompile.patch \
> -	   file://fix-removable-media-detection.patch \
> +           file://fix-removable-media-detection.patch \
>              file://90tracker \
>              file://tracker-store.service \
>              file://tracker-miner-fs.service \
> @@ -32,14 +32,17 @@ EXTRA_OECONF += "--disable-miner-thunderbird --disable-miner-firefox \
>   LEAD_SONAME = "libtrackerclient.so.0"
>   
>   do_install_append() {
> -   cp -PpR ${D}${STAGING_DATADIR}/* ${D}${datadir}/ || true
> -#  install -d ${D}/${sysconfdir}/X11/Xsession.d/
> -#  install -m 0755 ${WORKDIR}/90tracker  ${D}/${sysconfdir}/X11/Xsession.d/
> +	cp -PpR ${D}${STAGING_DATADIR}/* ${D}${datadir}/ || true
> +	#  install -d ${D}/${sysconfdir}/X11/Xsession.d/
> +	#  install -m 0755 ${WORKDIR}/90tracker  ${D}/${sysconfdir}/X11/Xsession.d/
>   
> -    install -d ${D}${systemd_unitdir}/system
> -    install -m 0644 ${WORKDIR}/tracker-store.service ${D}${systemd_unitdir}/system
> -    install -m 0644 ${WORKDIR}/tracker-miner-fs.service ${D}${systemd_unitdir}/system
> -    install -m 0644 ${WORKDIR}/tracker-dbus.service ${D}${systemd_unitdir}/system
> +	install -d ${D}${systemd_unitdir}/system
> +	install -m 0644 ${WORKDIR}/tracker-store.service ${D}${systemd_unitdir}/system
> +	install -m 0644 ${WORKDIR}/tracker-miner-fs.service ${D}${systemd_unitdir}/system
> +	install -m 0644 ${WORKDIR}/tracker-dbus.service ${D}${systemd_unitdir}/system
> +	sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' \
> +		-e 's,@BASE_BINDIR@,${base_bindir},g' \
> +		${D}${systemd_unitdir}/system/*.service
>   }
>   
>   PACKAGES =+ "${PN}-tests ${PN}-vala ${PN}-nautilus-extension"

Patch

diff --git a/meta-oe/recipes-support/tracker/files/tracker-dbus.service b/meta-oe/recipes-support/tracker/files/tracker-dbus.service
index 9d4fb74..c97f49a 100644
--- a/meta-oe/recipes-support/tracker/files/tracker-dbus.service
+++ b/meta-oe/recipes-support/tracker/files/tracker-dbus.service
@@ -8,7 +8,7 @@  BindTo=tracker-store.service
 [Service]
 Type=forking
 EnvironmentFile=-/tmp/tracker.env
-ExecStartPre=/bin/rm -rf /tmp/tracker.env
+ExecStartPre=@BASE_BINDIR@/rm -rf /tmp/tracker.env
 ExecStart=/bin/sh -c 'echo "DBUS_SESSION_BUS_ADDRESS=`dbus-daemon --fork --session --print-address`" > /tmp/tracker.env'
 
 [Install]
diff --git a/meta-oe/recipes-support/tracker/files/tracker-miner-fs.service b/meta-oe/recipes-support/tracker/files/tracker-miner-fs.service
index f143924..34d9a1e 100644
--- a/meta-oe/recipes-support/tracker/files/tracker-miner-fs.service
+++ b/meta-oe/recipes-support/tracker/files/tracker-miner-fs.service
@@ -6,7 +6,7 @@  Requires=tracker-store.service
 [Service]
 Environment=HOME=/home/root
 EnvironmentFile=-/tmp/tracker.env
-ExecStart=/usr/libexec/tracker-miner-fs
+ExecStart=@LIBEXECDIR@/tracker-miner-fs
 
 [Install]
 WantedBy=multi-user.target
diff --git a/meta-oe/recipes-support/tracker/files/tracker-store.service b/meta-oe/recipes-support/tracker/files/tracker-store.service
index 7ca9ff0..c5037f3 100644
--- a/meta-oe/recipes-support/tracker/files/tracker-store.service
+++ b/meta-oe/recipes-support/tracker/files/tracker-store.service
@@ -6,7 +6,7 @@  BindTo=tracker-dbus.service
 
 [Service]
 EnvironmentFile=-/tmp/tracker.env
-ExecStart=/usr/libexec/tracker-store
+ExecStart=@LIBEXECDIR@/tracker-store
 
 [Install]
 WantedBy=multi-user.target
diff --git a/meta-oe/recipes-support/tracker/tracker_0.14.2.bb b/meta-oe/recipes-support/tracker/tracker_0.14.2.bb
index 5838c2d..d6febbf 100644
--- a/meta-oe/recipes-support/tracker/tracker_0.14.2.bb
+++ b/meta-oe/recipes-support/tracker/tracker_0.14.2.bb
@@ -13,7 +13,7 @@  VER_DIR = "${@gnome_verdir("${PV}")}"
 SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/tracker/${VER_DIR}/tracker-${PV}.tar.xz \
            file://0005-Fix-missing-gobject-introspection-checks.patch \
            file://enable-sqlite-crosscompile.patch \
-	   file://fix-removable-media-detection.patch \
+           file://fix-removable-media-detection.patch \
            file://90tracker \
            file://tracker-store.service \
            file://tracker-miner-fs.service \
@@ -32,14 +32,17 @@  EXTRA_OECONF += "--disable-miner-thunderbird --disable-miner-firefox \
 LEAD_SONAME = "libtrackerclient.so.0"
 
 do_install_append() {
-   cp -PpR ${D}${STAGING_DATADIR}/* ${D}${datadir}/ || true
-#  install -d ${D}/${sysconfdir}/X11/Xsession.d/
-#  install -m 0755 ${WORKDIR}/90tracker  ${D}/${sysconfdir}/X11/Xsession.d/
+	cp -PpR ${D}${STAGING_DATADIR}/* ${D}${datadir}/ || true
+	#  install -d ${D}/${sysconfdir}/X11/Xsession.d/
+	#  install -m 0755 ${WORKDIR}/90tracker  ${D}/${sysconfdir}/X11/Xsession.d/
 
-    install -d ${D}${systemd_unitdir}/system
-    install -m 0644 ${WORKDIR}/tracker-store.service ${D}${systemd_unitdir}/system
-    install -m 0644 ${WORKDIR}/tracker-miner-fs.service ${D}${systemd_unitdir}/system
-    install -m 0644 ${WORKDIR}/tracker-dbus.service ${D}${systemd_unitdir}/system
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/tracker-store.service ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/tracker-miner-fs.service ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/tracker-dbus.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' \
+		-e 's,@BASE_BINDIR@,${base_bindir},g' \
+		${D}${systemd_unitdir}/system/*.service
 }
 
 PACKAGES =+ "${PN}-tests ${PN}-vala ${PN}-nautilus-extension"