]> granicus.if.org Git - sudo/commitdiff
Add Depends, Replaces and Conflicts headers for .deb packages.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 4 Jun 2012 17:13:38 +0000 (13:13 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 4 Jun 2012 17:13:38 +0000 (13:13 -0400)
sudo.pp

diff --git a/sudo.pp b/sudo.pp
index 6968549ddebb5048f506b688f03aa730925d68b6..49bc068b497803bc32666a1a7f0652d9f049696d 100644 (file)
--- a/sudo.pp
+++ b/sudo.pp
@@ -233,6 +233,22 @@ still allow people to get their work done."
        done
        osdirs=`echo $osdirs | tr " " "\n" | sort -u`
 
+%depend [deb]
+       libc6, libpam0g, libpam-modules, zlib1g
+
+%fixup [deb]
+       # Add Conflicts, Replaces headers and add libldap depedency as needed.
+       if test -z "%{flavor}"; then
+           echo "Conflicts: sudo-ldap" >> %{pp_wrkdir}/%{name}/DEBIAN/control
+           echo "Replaces: sudo-ldap" >> %{pp_wrkdir}/%{name}/DEBIAN/control
+       elif test "%{flavor}" = "ldap"; then
+           echo "Conflicts: sudo" >> %{pp_wrkdir}/%{name}/DEBIAN/control
+           echo "Replaces: sudo" >> %{pp_wrkdir}/%{name}/DEBIAN/control
+           cp -p %{pp_wrkdir}/%{name}/DEBIAN/control %{pp_wrkdir}/%{name}/DEBIAN/control.$$
+           sed 's/^\(Depends:.*\) *$/\1, libldap/' %{pp_wrkdir}/%{name}/DEBIAN/control.$$ > %{pp_wrkdir}/%{name}/DEBIAN/control
+           rm -f %{pp_wrkdir}/%{name}/DEBIAN/control.$$
+       fi
+
 %files
        $osdirs                 -
        $bindir/sudo            4755 root: