All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shane Bryan <shane.bryan@linux.intel.com>
To: ofono@ofono.org
Subject: Re: [PATCH] Add dbus .service file to auto start ofonod
Date: Tue, 26 May 2009 14:58:30 -0700	[thread overview]
Message-ID: <20090526145830.5edb497e@cyclone> (raw)
In-Reply-To: <1243078511.13042.1.camel@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 3012 bytes --]

On Sat, 23 May 2009 13:35:11 +0200
marcel at holtmann.org (Marcel Holtmann) wrote:

> actually it would be better if we just do ofono.service.in (drop the
> org in front of it) and then let autoconf fixup the actually
> configured prefix.
> 

Ok, new patch attached, this time taking ofono.service.in and
generating org.ofono.service by autoconf/automake rules that define
the .service file name as well as the "Name" and "Exec" values in the
generated file 

Shane...

From ce040278b6f2f58a97f69e0c67e4339f0e67f398 Mon Sep 17 00:00:00 2001
From: Shane Bryan <shane.bryan@linux.intel.com>
Date: Tue, 26 May 2009 14:22:41 -0700
Subject: [PATCH] Install auto generated dbus system-service file

Signed-off-by: Shane Bryan <shane.bryan@linux.intel.com>
---
 configure.ac         |    9 +++++++++
 src/Makefile.am      |   16 ++++++++++++++--
 src/ofono.service.in |    4 ++++
 3 files changed, 27 insertions(+), 2 deletions(-)
 create mode 100644 src/ofono.service.in

diff --git a/configure.ac b/configure.ac
index 36fec5f..023f2ab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,6 +73,15 @@ else
 fi
 AC_SUBST(DBUS_DATADIR)
 
+DBUS_SYSTEM_SERVICEDIR="${datadir}/dbus-1/system-services"
+AC_SUBST(DBUS_SYSTEM_SERVICEDIR)
+
+DBUS_SERVICE_PREFIX="org"
+AC_SUBST(DBUS_SERVICE_PREFIX)
+
+DBUS_SERVICE_NAME="$DBUS_SERVICE_PREFIX.$PACKAGE"
+AC_SUBST(DBUS_SERVICE_NAME)
+
 AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
 AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 38c97bd..b6688bd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,6 +3,18 @@ if DATAFILES
 dbusdir = @DBUS_DATADIR@
 
 dbus_DATA = ofono.conf
+
+servicedir = @DBUS_SYSTEM_SERVICEDIR@
+service_in_files = ofono.service.in
+service_DATA = @DBUS_SERVICE_NAME(a).service
+
+$(service_DATA): $(service_in_files) Makefile
+	$(edit) $< >$@
+
+edit = sed \
+	-e 's|@sbindir[@]|$(sbindir)|g' \
+	-e 's|@sbin_PROGRAMS[@]|$(sbin_PROGRAMS)|g' \
+	-e 's|@DBUS_SERVICE_NAME[@]|$(DBUS_SERVICE_NAME)|g'
 endif
 
 sbin_PROGRAMS = ofonod
@@ -22,7 +34,7 @@ ofonod_LDFLAGS = -Wl,--export-dynamic -Wl,--version-script=ofono.ver
 
 ofonod_DEPENDENCIES = ofono.ver
 
-CLEANFILES = ofono.ver ofono.exp
+CLEANFILES = ofono.ver ofono.exp $(service_DATA)
 
 if MAINTAINER_MODE
 plugindir = $(abs_top_srcdir)/plugins/.libs
@@ -35,7 +47,7 @@ AM_CFLAGS = @GTHREAD_CFLAGS@ @GLIB_CFLAGS@ @GDBUS_CFLAGS@ @GATCHAT_CFLAGS@ \
 
 INCLUDES = -I$(top_builddir)/include -I$(top_builddir)
 
-EXTRA_DIST = ofono.conf
+EXTRA_DIST = $(dbus_DATA) $(service_DATA) $(service_in_files)
 
 MAINTAINERCLEANFILES = Makefile.in
 
diff --git a/src/ofono.service.in b/src/ofono.service.in
new file mode 100644
index 0000000..16c9bd6
--- /dev/null
+++ b/src/ofono.service.in
@@ -0,0 +1,4 @@
+[D-BUS Service]
+Name=@DBUS_SERVICE_NAME@
+Exec=@sbindir@/@sbin_PROGRAMS@
+User=root
-- 
1.6.0.4



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Install-auto-generated-dbus-system-service-file.patch --]
[-- Type: text/x-patch, Size: 2437 bytes --]

>From ce040278b6f2f58a97f69e0c67e4339f0e67f398 Mon Sep 17 00:00:00 2001
From: Shane Bryan <shane.bryan@linux.intel.com>
Date: Tue, 26 May 2009 14:22:41 -0700
Subject: [PATCH] Install auto generated dbus system-service file

Signed-off-by: Shane Bryan <shane.bryan@linux.intel.com>
---
 configure.ac         |    9 +++++++++
 src/Makefile.am      |   16 ++++++++++++++--
 src/ofono.service.in |    4 ++++
 3 files changed, 27 insertions(+), 2 deletions(-)
 create mode 100644 src/ofono.service.in

diff --git a/configure.ac b/configure.ac
index 36fec5f..023f2ab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,6 +73,15 @@ else
 fi
 AC_SUBST(DBUS_DATADIR)
 
+DBUS_SYSTEM_SERVICEDIR="${datadir}/dbus-1/system-services"
+AC_SUBST(DBUS_SYSTEM_SERVICEDIR)
+
+DBUS_SERVICE_PREFIX="org"
+AC_SUBST(DBUS_SERVICE_PREFIX)
+
+DBUS_SERVICE_NAME="$DBUS_SERVICE_PREFIX.$PACKAGE"
+AC_SUBST(DBUS_SERVICE_NAME)
+
 AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
 AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 38c97bd..b6688bd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,6 +3,18 @@ if DATAFILES
 dbusdir = @DBUS_DATADIR@
 
 dbus_DATA = ofono.conf
+
+servicedir = @DBUS_SYSTEM_SERVICEDIR@
+service_in_files = ofono.service.in
+service_DATA = @DBUS_SERVICE_NAME@.service
+
+$(service_DATA): $(service_in_files) Makefile
+	$(edit) $< >$@
+
+edit = sed \
+	-e 's|@sbindir[@]|$(sbindir)|g' \
+	-e 's|@sbin_PROGRAMS[@]|$(sbin_PROGRAMS)|g' \
+	-e 's|@DBUS_SERVICE_NAME[@]|$(DBUS_SERVICE_NAME)|g'
 endif
 
 sbin_PROGRAMS = ofonod
@@ -22,7 +34,7 @@ ofonod_LDFLAGS = -Wl,--export-dynamic -Wl,--version-script=ofono.ver
 
 ofonod_DEPENDENCIES = ofono.ver
 
-CLEANFILES = ofono.ver ofono.exp
+CLEANFILES = ofono.ver ofono.exp $(service_DATA)
 
 if MAINTAINER_MODE
 plugindir = $(abs_top_srcdir)/plugins/.libs
@@ -35,7 +47,7 @@ AM_CFLAGS = @GTHREAD_CFLAGS@ @GLIB_CFLAGS@ @GDBUS_CFLAGS@ @GATCHAT_CFLAGS@ \
 
 INCLUDES = -I$(top_builddir)/include -I$(top_builddir)
 
-EXTRA_DIST = ofono.conf
+EXTRA_DIST = $(dbus_DATA) $(service_DATA) $(service_in_files)
 
 MAINTAINERCLEANFILES = Makefile.in
 
diff --git a/src/ofono.service.in b/src/ofono.service.in
new file mode 100644
index 0000000..16c9bd6
--- /dev/null
+++ b/src/ofono.service.in
@@ -0,0 +1,4 @@
+[D-BUS Service]
+Name=@DBUS_SERVICE_NAME@
+Exec=@sbindir@/@sbin_PROGRAMS@
+User=root
-- 
1.6.0.4


      reply	other threads:[~2009-05-26 21:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-22 23:03 [PATCH] Add dbus .service file to auto start ofonod Shane Bryan
2009-05-23 11:35 ` Marcel Holtmann
2009-05-26 21:58   ` Shane Bryan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090526145830.5edb497e@cyclone \
    --to=shane.bryan@linux.intel.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.