]> granicus.if.org Git - sudo/commitdiff
Install /usr/lib/tmpfiles.d/sudo.conf on systems with systemd but
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 6 Apr 2015 21:08:37 +0000 (15:08 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 6 Apr 2015 21:08:37 +0000 (15:08 -0600)
do not package it.  For packages we create /usr/lib/tmpfiles.d/sudo.conf
as needed in the postinstall script.

src/Makefile.in
sudo.pp

index f27e06bba94330de38dd54828a0d69c82953d9f1..b4f4feebd4f9baf3c46a304c316c266f0afd6b54 100644 (file)
@@ -24,6 +24,7 @@ devdir = @devdir@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 incdir = $(top_srcdir)/include
+rundir = @rundir@
 cross_compiling = @CROSS_COMPILING@
 
 # Compiler & tools to use
@@ -146,6 +147,9 @@ install: install-binaries install-rc @INSTALL_NOEXEC@
 install-dirs:
        $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(bindir) \
            $(DESTDIR)$(libexecdir)/sudo $(DESTDIR)$(noexecdir)
+       @if [ -r /usr/lib/tmpfiles.d/systemd.conf ]; then \
+           mkdir -p $(DESTDIR)/usr/lib/tmpfiles.d; \
+       fi
 
 install-rc:
        @if [ -n "$(INIT_SCRIPT)" ]; then \
@@ -155,6 +159,10 @@ install-rc:
            rm -f $(DESTDIR)$(RC_LINK); \
            ln -s $(INIT_DIR)/sudo $(DESTDIR)$(RC_LINK); \
        fi
+       @if [ -r /usr/lib/tmpfiles.d/systemd.conf ]; then \
+           echo "d $(DESTDIR)$(rundir) 0711 root root" > $(DESTDIR)/usr/lib/tmpfiles.d/sudo.conf; \
+           echo "D $(DESTDIR)$(rundir)/ts 0700 root root" >> $(DESTDIR)/usr/lib/tmpfiles.d/sudo.conf; \
+       fi
 
 install-binaries: install-dirs $(PROGS)
        INSTALL_BACKUP='~' $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_OWNER) -m 04755 sudo $(DESTDIR)$(bindir)/sudo
@@ -180,7 +188,8 @@ uninstall:
                $(DESTDIR)$(bindir)/sudoedit \
                $(DESTDIR)$(libexecdir)/sudo/sesh \
                $(DESTDIR)$(libexecdir)/sudo/sesh~ \
-               $(DESTDIR)$(noexecdir)/sudo_noexec.so~
+               $(DESTDIR)$(noexecdir)/sudo_noexec.so~ \
+               $(DESTDIR)/usr/lib/tmpfiles.d/sudo.conf
        @if [ -n "$(INIT_SCRIPT)" ]; then \
            rm -f $(DESTDIR)$(RC_LINK) $(DESTDIR)$(INIT_DIR)/sudo; \
        fi
diff --git a/sudo.pp b/sudo.pp
index e717737a3c81063632ba65423e9f33c88fa65462..d78db42fd58c1daf7f1c667f4c7afd3481bdffcf 100644 (file)
--- a/sudo.pp
+++ b/sudo.pp
@@ -314,6 +314,10 @@ still allow people to get their work done."
        /sbin/init.d/           ignore
        /sbin/init.d/sudo       0755 root:
 %endif
+%if -d ${pp_destdir}/usr/lib/tmpfiles.d
+       /usr/lib/tmpfiles.d/    ignore
+       /usr/lib/tmpfiles.d/*   ignore
+%endif
 
 %files [!aix]
        $mandir/man*/*          0644