build: Add D-Bus service autostart support
authorMarcel Holtmann <marcel@holtmann.org>
Sat, 2 Oct 2010 15:57:19 +0000 (17:57 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Sat, 2 Oct 2010 15:57:19 +0000 (17:57 +0200)
Makefile.am
configure.ac
src/ofono.service.in [new file with mode: 0644]

index cb81ee9..ffebcfd 100644 (file)
@@ -26,6 +26,10 @@ dbusconfdir = @DBUS_CONFDIR@
 
 dbusconf_DATA = src/ofono.conf
 
+dbusdatadir = @DBUS_DATADIR@
+
+dbusdata_DATA = src/ofono.service
+
 confdir = $(sysconfdir)/ofono
 
 conf_DATA =
index ea5c272..1b9d07c 100644 (file)
@@ -102,6 +102,16 @@ else
 fi
 AC_SUBST(DBUS_CONFDIR)
 
+AC_ARG_WITH(dbusdatadir, AC_HELP_STRING([--with-dbusdatadir=PATH],
+       [path to D-Bus data directory]), [path_dbusdata=${withval}],
+               [path_dbusdata="`$PKG_CONFIG --variable=datadir dbus-1`"])
+if (test -z "${path_dbusdata}"); then
+       DBUS_DATADIR="${datadir}/dbus-1/system-services"
+else
+       DBUS_DATADIR="${path_dbusdata}/dbus-1/system-services"
+fi
+AC_SUBST(DBUS_DATADIR)
+
 AC_ARG_ENABLE(capng, AC_HELP_STRING([--enable-capng],
                [enable capabilities support]), [enable_capng=${enableval}])
 if (test "${enable_capng}" = "yes"); then
@@ -173,4 +183,4 @@ fi
 AC_DEFINE_UNQUOTED(CONFIGDIR, "${configdir}",
                        [Directory for the configuration files])
 
-AC_OUTPUT(Makefile include/version.h)
+AC_OUTPUT(Makefile include/version.h src/ofono.service)
diff --git a/src/ofono.service.in b/src/ofono.service.in
new file mode 100644 (file)
index 0000000..2eecbf9
--- /dev/null
@@ -0,0 +1,4 @@
+[D-BUS Service]
+Name=org.ofono
+Exec=@prefix@/sbin/ofonod
+User=root