build: Add support for systemd configuration

This commit is contained in:
Marcel Holtmann 2010-10-02 20:20:31 +02:00
parent 1e58136e26
commit 17f7fffa2a
3 changed files with 28 additions and 6 deletions

View File

@ -26,9 +26,11 @@ dbusconfdir = @DBUS_CONFDIR@
dbusconf_DATA = src/ofono.conf dbusconf_DATA = src/ofono.conf
dbusdatadir = @DBUS_DATADIR@ if SYSTEMD
systemdunitdir = @SYSTEMD_UNITDIR@
dbusdata_DATA = src/ofono.service systemdunit_DATA = src/ofono.service
endif
confdir = $(sysconfdir)/ofono confdir = $(sysconfdir)/ofono

View File

@ -112,6 +112,19 @@ else
fi fi
AC_SUBST(DBUS_DATADIR) AC_SUBST(DBUS_DATADIR)
AC_ARG_ENABLE(systemd, AC_HELP_STRING([--enable-systemd],
[enable systemd support]), [enable_systemd=${enableval}])
if (test "${enable_systemd}" = "yes"); then
PKG_CHECK_MODULES(SYSTEMD, systemd, dummy=yes,
AC_MSG_ERROR(systemd is required))
SYSTEMD_UNITDIR="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"
if (test -z "${SYSTEM_UNITDIR}"); then
SYSTEMD_UNITDIR="/lib/systemd/system"
fi
AC_SUBST(SYSTEMD_UNITDIR)
fi
AM_CONDITIONAL(SYSTEMD, test "${enable_systemd}" = "yes")
AC_ARG_ENABLE(capng, AC_HELP_STRING([--enable-capng], AC_ARG_ENABLE(capng, AC_HELP_STRING([--enable-capng],
[enable capabilities support]), [enable_capng=${enableval}]) [enable capabilities support]), [enable_capng=${enableval}])
if (test "${enable_capng}" = "yes"); then if (test "${enable_capng}" = "yes"); then

View File

@ -1,4 +1,11 @@
[D-BUS Service] [Unit]
Name=org.ofono Description=Telephony service
Exec=@prefix@/sbin/ofonod After=syslog.target
User=root
[Service]
Type=dbus
BusName=org.ofono
ExecStart=@prefix@/sbin/ofonod -n
[Install]
WantedBy=multi-user.target