summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am7
-rw-r--r--configure.ac16
-rw-r--r--data/Makefile.am13
-rw-r--r--data/org.freedesktop.PolicyKit1.service.in1
-rw-r--r--data/polkit.service.in8
5 files changed, 42 insertions, 3 deletions
diff --git a/Makefile.am b/Makefile.am
index 01f0a4b..16bd0bc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,7 +9,12 @@ EXTRA_DIST = \
$(NULL)
# xsltproc barfs on 'make distcheck'; disable for now
-DISTCHECK_CONFIGURE_FLAGS=--disable-man-pages --disable-gtk-doc --disable-introspection
+DISTCHECK_CONFIGURE_FLAGS= \
+ --disable-man-pages \
+ --disable-gtk-doc \
+ --disable-introspection \
+ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) \
+ $(NULL)
sign : dist
gpg --armor --detach-sign --output polkit-$(VERSION).tar.gz.sign polkit-$(VERSION).tar.gz
diff --git a/configure.ac b/configure.ac
index 2712e19..7c7ca7a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,6 +181,19 @@ AC_SUBST(LIBSYSTEMD_LOGIN_LIBS)
AM_CONDITIONAL(HAVE_LIBSYSTEMD_LOGIN, [test "$have_libsystemd_login" = "yes"], [Using libsystemd-login])
dnl ---------------------------------------------------------------------------
+dnl - systemd unit / service files
+dnl ---------------------------------------------------------------------------
+
+AC_ARG_WITH([systemdsystemunitdir],
+ AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
+ [],
+ [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
+if test "x$with_systemdsystemunitdir" != "xno"; then
+ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+fi
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$systemdsystemunitdir"])
+
+dnl ---------------------------------------------------------------------------
dnl - Select which authentication framework to use
dnl ---------------------------------------------------------------------------
@@ -484,7 +497,8 @@ echo "
Distribution/OS: ${with_os_type}
Authentication framework: ${POLKIT_AUTHFW}
Session tracking: ${SESSION_TRACKING}
- PAM support: ${have_pam}"
+ PAM support: ${have_pam}
+ systemdsystemunitdir: ${systemdsystemunitdir}"
if test "$have_pam" = yes ; then
echo "
diff --git a/data/Makefile.am b/data/Makefile.am
index f0beeba..83bcc20 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -20,15 +20,26 @@ endif
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = polkit-gobject-1.pc polkit-backend-1.pc polkit-agent-1.pc
+
+systemdservice_in_files = polkit.service.in
+
+if HAVE_SYSTEMD
+systemdservicedir = $(systemdsystemunitdir)
+systemdservice_DATA = $(systemdservice_in_files:.service.in=.service)
+$(systemdservice_DATA): $(systemdservice_in_files) Makefile
+ @sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
+endif
+
CLEANFILES = $(BUILT_SOURCES)
EXTRA_DIST = \
org.freedesktop.PolicyKit1.Authority.xml \
org.freedesktop.PolicyKit1.AuthenticationAgent.xml \
$(service_in_files) \
+ $(systemdservice_in_files) \
$(dbusconf_DATA) \
$(NULL)
clean-local :
- rm -f *~ $(service_DATA)
+ rm -f *~ $(service_DATA) $(systemdservice_DATA)
diff --git a/data/org.freedesktop.PolicyKit1.service.in b/data/org.freedesktop.PolicyKit1.service.in
index b6cd02b..fbceb3f 100644
--- a/data/org.freedesktop.PolicyKit1.service.in
+++ b/data/org.freedesktop.PolicyKit1.service.in
@@ -2,3 +2,4 @@
Name=org.freedesktop.PolicyKit1
Exec=@libexecdir@/polkitd --no-debug
User=root
+SystemdService=polkit.service
diff --git a/data/polkit.service.in b/data/polkit.service.in
new file mode 100644
index 0000000..efd2948
--- /dev/null
+++ b/data/polkit.service.in
@@ -0,0 +1,8 @@
+[Unit]
+Description=Authorization Manager
+Documentation=man:polkit(8)
+
+[Service]
+Type=dbus
+BusName=org.freedesktop.PolicyKit1
+ExecStart=@libexecdir@/polkitd --no-debug