This adds 29950854f from polkit upstream as a patch to install a
systemd service file for polkit.

Signed-off-by: Florian Bäuerle <[email protected]>
---
 .../0001-Add-a-systemd-.service-file.patch    | 125 ++++++++++++++++++
 patches/polkit-0.105/series                   |   1 +
 rules/polkit.make                             |   5 +
 3 files changed, 131 insertions(+)
 create mode 100644 patches/polkit-0.105/0001-Add-a-systemd-.service-file.patch

diff --git a/patches/polkit-0.105/0001-Add-a-systemd-.service-file.patch 
b/patches/polkit-0.105/0001-Add-a-systemd-.service-file.patch
new file mode 100644
index 000000000..ef322ffb1
--- /dev/null
+++ b/patches/polkit-0.105/0001-Add-a-systemd-.service-file.patch
@@ -0,0 +1,125 @@
+From 29950854f6b9e9b8ea2d96d67c79eeec1046a4f1 Mon Sep 17 00:00:00 2001
+From: David Zeuthen <[email protected]>
+Date: Wed, 23 May 2012 16:16:20 -0400
+Subject: [PATCH] Add a systemd .service file
+
+Signed-off-by: David Zeuthen <[email protected]>
+---
+ Makefile.am                                |  7 ++++++-
+ configure.ac                               | 16 +++++++++++++++-
+ data/Makefile.am                           | 13 ++++++++++++-
+ data/org.freedesktop.PolicyKit1.service.in |  1 +
+ data/polkit.service.in                     |  8 ++++++++
+ 5 files changed, 42 insertions(+), 3 deletions(-)
+ create mode 100644 data/polkit.service.in
+
+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
+@@ -180,6 +180,19 @@ AC_SUBST(LIBSYSTEMD_LOGIN_CFLAGS)
+ 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
+-- 
+2.19.2
+
diff --git a/patches/polkit-0.105/series b/patches/polkit-0.105/series
index afb3f970d..be61a9335 100644
--- a/patches/polkit-0.105/series
+++ b/patches/polkit-0.105/series
@@ -1,6 +1,7 @@
 ##PTXDIST:
 0001-check-for-libsystemd-instead-of-libsystemd-login.patch
 0002-automake-add-missing-conditional-HAVE_INTROSPECTION.patch
+0001-Add-a-systemd-.service-file.patch
 ##DEBIAN:
 0.106/agenthelper-pam-Fix-newline-trimming-code.patch
 0.108/build-Fix-.gir-generation-for-parallel-make.patch
diff --git a/rules/polkit.make b/rules/polkit.make
index 4505e0e78..4be15a243 100644
--- a/rules/polkit.make
+++ b/rules/polkit.make
@@ -73,6 +73,11 @@ $(STATEDIR)/polkit.targetinstall:
        @$(call install_copy, polkit, 0, 0, 0644, -, \
                /usr/share/polkit-1/actions/org.freedesktop.policykit.policy)
 
+ifdef PTXCONF_POLKIT_SYSTEMD
+       @$(call install_copy, polkit, 0, 0, 0644, -, \
+               /usr/lib/systemd/system/polkit.service)
+endif
+
 # libs
        @$(call install_lib, polkit, 0, 0, 0644, libpolkit-agent-1)
        @$(call install_lib, polkit, 0, 0, 0644, libpolkit-backend-1)
-- 
2.19.2

_______________________________________________
ptxdist mailing list
[email protected]

Reply via email to