From 2d0699a0707cbf5f46d5f840f3815224c55bc462 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 8 Jul 2015 18:13:39 -0600 Subject: [PATCH] Only use --with-sssd-lib on Debian/Ubuntu w/ multipackage. Use dpkg-query to determine the name of the audit package for proper dependencies. --- mkpkg | 12 ++++++++++-- sudo.pp | 10 ++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/mkpkg b/mkpkg index 6fc2916dc..abeef1ea0 100755 --- a/mkpkg +++ b/mkpkg @@ -190,13 +190,18 @@ case "$osversion" in configure_opts="${configure_opts}${configure_opts+$tab}--enable-admin-flag${tab}--without-lecture" ;; esac + # Newer Debian uses arch-specific lib dirs + MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null) # Note, must indent with tabs, not spaces due to IFS trickery if test "$flavor" = "ldap"; then configure_opts="${configure_opts}${configure_opts+$tab}--with-ldap --with-ldap-conf-file=/etc/sudo-ldap.conf" else - configure_opts="${configure_opts}${configure_opts+$tab}--with-sssd - --with-sssd-lib=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)" + configure_opts="${configure_opts}${configure_opts+$tab}--with-sssd" + if test -n "$MULTIARCH"; then + # SSSD backend needs to know where to find the sssd lib + configure_opts="${configure_opts}${configure_opts+$tab}--with-sssd-lib=/usr/lib/$MULTIARCH" + fi fi configure_opts="--prefix=/usr --with-all-insults @@ -217,6 +222,9 @@ case "$osversion" in --with-selinux --with-linux-audit $configure_opts" + # Use correct libaudit dependency + linux_audit=`dpkg-query -S /lib/$MULTIARCH/libaudit.so.[0-9]* | sed -e 's/:.*//' -e q` + PPVARS="${PPVARS}${PPVARS+$space}linux_audit=$linux_audit" ;; macos*) case "$osversion" in diff --git a/sudo.pp b/sudo.pp index 3cd57f806..7a181b54b 100644 --- a/sudo.pp +++ b/sudo.pp @@ -246,10 +246,11 @@ still allow people to get their work done." fi %depend [deb] - libc6, libpam0g, libpam-modules, zlib1g, libselinux1, libaudit1 + libc6, libpam0g, libpam-modules, zlib1g, libselinux1 %fixup [deb] # Add Conflicts, Replaces headers and add libldap depedency as needed. + DEPENDS="${linux_audit}" if test -z "%{flavor}"; then echo "Conflicts: sudo-ldap" >> %{pp_wrkdir}/%{name}/DEBIAN/control echo "Replaces: sudo-ldap" >> %{pp_wrkdir}/%{name}/DEBIAN/control @@ -257,10 +258,11 @@ still allow people to get their work done." echo "Conflicts: sudo" >> %{pp_wrkdir}/%{name}/DEBIAN/control echo "Replaces: sudo" >> %{pp_wrkdir}/%{name}/DEBIAN/control echo "Provides: sudo" >> %{pp_wrkdir}/%{name}/DEBIAN/control - cp -p %{pp_wrkdir}/%{name}/DEBIAN/control %{pp_wrkdir}/%{name}/DEBIAN/control.$$ - sed 's/^\(Depends:.*\) *$/\1, libldap-2.4-2/' %{pp_wrkdir}/%{name}/DEBIAN/control.$$ > %{pp_wrkdir}/%{name}/DEBIAN/control - rm -f %{pp_wrkdir}/%{name}/DEBIAN/control.$$ + DEPENDS="${DEPENDS}, libldap-2.4-2" fi + cp -p %{pp_wrkdir}/%{name}/DEBIAN/control %{pp_wrkdir}/%{name}/DEBIAN/control.$$ + sed "s/^\(Depends:.*\) *$/\1, ${DEPENDS}/" %{pp_wrkdir}/%{name}/DEBIAN/control.$$ > %{pp_wrkdir}/%{name}/DEBIAN/control + rm -f %{pp_wrkdir}/%{name}/DEBIAN/control.$$ echo "Homepage: http://www.sudo.ws/sudo/" >> %{pp_wrkdir}/%{name}/DEBIAN/control echo "Bugs: http://www.sudo.ws/bugs/" >> %{pp_wrkdir}/%{name}/DEBIAN/control -- 2.40.0