From 4125a6977fb72093b693b3d239dc9afb4d818f5e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 21 Jul 2010 16:53:07 +0200 Subject: [PATCH] systemd: install systemd unit files --- Makefile.am | 3 +++ configure.ac | 9 +++++++++ data/Makefile.am | 15 ++++++++++++++- data/accounts-daemon.service.in | 15 +++++++++++++++ data/org.freedesktop.Accounts.service.in | 2 +- 5 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 data/accounts-daemon.service.in diff --git a/Makefile.am b/Makefile.am index 971c1ed..7955803 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,3 +3,6 @@ SUBDIRS = src data po doc ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = + +DISTCHECK_CONFIGURE_FLAGS = \ + --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) diff --git a/configure.ac b/configure.ac index 5e24d19..49dae37 100644 --- a/configure.ac +++ b/configure.ac @@ -64,6 +64,15 @@ dnl Check for xsltproc dnl --------------------------------------------------------------------------- AC_PATH_PROG([XSLTPROC], [xsltproc]) +# systemd + +AC_ARG_WITH([systemdsystemunitdir], + AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), + [], + [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) +AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) +AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"]) + AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([ Makefile diff --git a/data/Makefile.am b/data/Makefile.am index ad4dfe7..521c6c2 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -20,12 +20,25 @@ policy_DATA = $(policy_in_files:.policy.in=.policy) @INTLTOOL_POLICY_RULE@ +if HAVE_SYSTEMD +systemdsystemunit_DATA = \ + accounts-daemon.service + +accounts-daemon.service: accounts-daemon.service.in + @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< >$@ + +endif + EXTRA_DIST = \ $(dbusif_DATA) \ $(dbusconf_DATA) \ $(service_in_files) \ - $(policy_in_files) + $(policy_in_files) \ + accounts-daemon.service.in DISTCLEANFILES = \ $(service_DATA) \ $(policy_DATA) + +CLEANFILES = \ + accounts-daemon.service diff --git a/data/accounts-daemon.service.in b/data/accounts-daemon.service.in new file mode 100644 index 0000000..105bf6a --- /dev/null +++ b/data/accounts-daemon.service.in @@ -0,0 +1,15 @@ +[Unit] +Description=Accounts Service + +[Service] +Type=dbus +BusName=org.freedesktop.Accounts +ExecStart=@libexecdir@/accounts-daemon +StandardOutput=syslog + +[Install] +# We pull this in by graphical.target instead of waiting for the bus +# activation, to speed things up a little: gdm uses this anyway so it is nice +# if it is already around when gdm wants to use it and doesn't have to wait for +# it. +WantedBy=graphical.target diff --git a/data/org.freedesktop.Accounts.service.in b/data/org.freedesktop.Accounts.service.in index af2a380..261c0b9 100644 --- a/data/org.freedesktop.Accounts.service.in +++ b/data/org.freedesktop.Accounts.service.in @@ -2,4 +2,4 @@ Name=org.freedesktop.Accounts Exec=@libexecdir@/accounts-daemon User=root - +SystemdService=accounts-daemon.service -- 1.7.0.1