Package: libcap2
Version: 1:2.22-1
Severity: normal
Tags: patch

Hi!

In support of the Multi-Arch release goal, here is a patch that builds
libcap2 to be Multi-Arch installable, which includes splitting the PAM
module into a separate package.

Thanks!

-Kees

-- 
Kees Cook                                            @debian.org
diff -Nru libcap2-2.22/debian/changelog libcap2-2.22/debian/changelog
--- libcap2-2.22/debian/changelog       2011-07-27 22:44:47.000000000 -0700
+++ libcap2-2.22/debian/changelog       2011-12-24 13:22:34.000000000 -0800
@@ -1,3 +1,11 @@
+libcap2 (1:2.22-2) UNRELEASED; urgency=low
+
+  * debian/{control,rules,compat}: Build for Multi-arch.
+  * debian/{control,libpam-cap.*}: Split PAM module into separate binary
+    package so it can be built for Multi-arch separate from the -bins pkg.
+
+ -- Kees Cook <k...@debian.org>  Sat, 17 Dec 2011 11:18:32 -0800
+
 libcap2 (1:2.22-1) unstable; urgency=low
 
   * New upstream released
diff -Nru libcap2-2.22/debian/compat libcap2-2.22/debian/compat
--- libcap2-2.22/debian/compat  2011-07-27 22:44:47.000000000 -0700
+++ libcap2-2.22/debian/compat  2011-12-24 12:58:02.000000000 -0800
@@ -1 +1 @@
-7
+9
diff -Nru libcap2-2.22/debian/control libcap2-2.22/debian/control
--- libcap2-2.22/debian/control 2011-07-27 22:44:47.000000000 -0700
+++ libcap2-2.22/debian/control 2011-12-24 13:19:52.000000000 -0800
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Torsten Werner <twer...@debian.org>
 Standards-Version: 3.9.0
-Build-Depends: debhelper (>= 7.0.50~), indent, libattr1-dev, libpam0g-dev
+Build-Depends: debhelper (>= 8.1.3~), indent, libattr1-dev, libpam0g-dev
 Homepage: http://sites.google.com/site/fullycapable/
 Vcs-Git: git://git.debian.org/collab-maint/libcap2.git
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/libcap2.git
@@ -11,7 +11,8 @@
 Package: libcap2-bin
 Section: utils
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libpam-runtime (>= 1.1.1-3~)
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Recommends: libpam-cap
 Suggests: libcap-dev
 Conflicts: libcap-bin
 Description: basic utility programs for using capabilities
@@ -23,6 +24,8 @@
 Package: libcap2
 Priority: standard
 Architecture: any
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: support for getting/setting POSIX.1e capabilities
  This library implements the user-space interfaces to the POSIX
@@ -33,6 +36,7 @@
 Package: libcap-dev
 Section: libdevel
 Architecture: any
+Multi-Arch: same
 Depends: libcap2 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
 Provides: libcap2-dev
 Conflicts: libcap2-dev
@@ -41,3 +45,13 @@
 Description: development libraries and header files for libcap2
  Contains the necessary support for building applications that use
  capabilities.
+
+Package: libpam-cap
+Architecture: any
+Multi-Arch: same
+Depends: ${shlibs:Depends}, ${misc:Depends}, libpam-runtime (>= 1.1.3-2~)
+Breaks: libcap2-bin (<< 1:2.22-2)
+Replaces: libcap2-bin (<< 1:2.22-2)
+Description: PAM module for implementing capabilities
+ This package contains the PAM module for enforcing capabilities on users
+ and groups at PAM session start time.
diff -Nru libcap2-2.22/debian/libcap2-bin.dirs 
libcap2-2.22/debian/libcap2-bin.dirs
--- libcap2-2.22/debian/libcap2-bin.dirs        2011-07-27 22:44:47.000000000 
-0700
+++ libcap2-2.22/debian/libcap2-bin.dirs        1969-12-31 16:00:00.000000000 
-0800
@@ -1,2 +0,0 @@
-usr/share/pam-configs
-etc/security
diff -Nru libcap2-2.22/debian/libcap2-bin.install 
libcap2-2.22/debian/libcap2-bin.install
--- libcap2-2.22/debian/libcap2-bin.install     2011-07-27 22:44:47.000000000 
-0700
+++ libcap2-2.22/debian/libcap2-bin.install     2011-12-24 12:56:09.000000000 
-0800
@@ -1,4 +1 @@
-debian/tmp/lib/security/*
 debian/tmp/sbin/*
-debian/pam-configs/* usr/share/pam-configs/
-pam_cap/capability.conf etc/security/
diff -Nru libcap2-2.22/debian/libcap2-bin.postinst 
libcap2-2.22/debian/libcap2-bin.postinst
--- libcap2-2.22/debian/libcap2-bin.postinst    2011-07-27 22:44:47.000000000 
-0700
+++ libcap2-2.22/debian/libcap2-bin.postinst    1969-12-31 16:00:00.000000000 
-0800
@@ -1,37 +0,0 @@
-#!/bin/sh
-# postinst script for libcap2-bin
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-#        * <postinst> `configure' <most-recently-configured-version>
-#        * <old-postinst> `abort-upgrade' <new version>
-#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
-#          <new-version>
-#        * <postinst> `abort-remove'
-#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
-#          <failed-install-package> <version> `removing'
-#          <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-case "$1" in
-    configure|abort-upgrade|abort-remove|abort-deconfigure)
-        pam-auth-update --package
-    ;;
-
-    *)
-        echo "postinst called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
diff -Nru libcap2-2.22/debian/libcap2-bin.prerm 
libcap2-2.22/debian/libcap2-bin.prerm
--- libcap2-2.22/debian/libcap2-bin.prerm       2011-07-27 22:44:47.000000000 
-0700
+++ libcap2-2.22/debian/libcap2-bin.prerm       1969-12-31 16:00:00.000000000 
-0800
@@ -1,39 +0,0 @@
-#!/bin/sh
-# prerm script for libcap2-bin
-#
-# see: dh_installdeb(1)
-
-set -e
-
-# summary of how this script can be called:
-#        * <prerm> `remove'
-#        * <old-prerm> `upgrade' <new-version>
-#        * <new-prerm> `failed-upgrade' <old-version>
-#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
-#        * <deconfigured's-prerm> `deconfigure' `in-favour'
-#          <package-being-installed> <version> `removing'
-#          <conflicting-package> <version>
-# for details, see http://www.debian.org/doc/debian-policy/ or
-# the debian-policy package
-
-
-case "$1" in
-    remove)
-        pam-auth-update --package --remove capability
-    ;;
-
-    upgrade|deconfigure|failed-upgrade)
-    ;;
-
-    *)
-        echo "prerm called with unknown argument \`$1'" >&2
-        exit 1
-    ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
-
-#DEBHELPER#
-
-exit 0
diff -Nru libcap2-2.22/debian/libcap2.install 
libcap2-2.22/debian/libcap2.install
--- libcap2-2.22/debian/libcap2.install 2011-07-27 22:44:47.000000000 -0700
+++ libcap2-2.22/debian/libcap2.install 2011-12-24 12:58:58.000000000 -0800
@@ -1 +1 @@
-debian/tmp/lib/lib*.so.*
+debian/tmp/lib/*/lib*.so.*
diff -Nru libcap2-2.22/debian/libcap-dev.install 
libcap2-2.22/debian/libcap-dev.install
--- libcap2-2.22/debian/libcap-dev.install      2011-07-27 22:44:47.000000000 
-0700
+++ libcap2-2.22/debian/libcap-dev.install      2011-12-24 12:59:11.000000000 
-0800
@@ -1,3 +1,3 @@
 debian/tmp/usr/include/*
-debian/tmp/lib/lib*.so
-debian/tmp/lib/lib*.a
+debian/tmp/lib/*/lib*.so
+debian/tmp/lib/*/lib*.a
diff -Nru libcap2-2.22/debian/libpam-cap.install 
libcap2-2.22/debian/libpam-cap.install
--- libcap2-2.22/debian/libpam-cap.install      1969-12-31 16:00:00.000000000 
-0800
+++ libcap2-2.22/debian/libpam-cap.install      2011-12-24 12:59:40.000000000 
-0800
@@ -0,0 +1,3 @@
+debian/tmp/lib/*/security/*
+debian/pam-configs/* usr/share/pam-configs/
+pam_cap/capability.conf etc/security/
diff -Nru libcap2-2.22/debian/libpam-cap.postinst 
libcap2-2.22/debian/libpam-cap.postinst
--- libcap2-2.22/debian/libpam-cap.postinst     1969-12-31 16:00:00.000000000 
-0800
+++ libcap2-2.22/debian/libpam-cap.postinst     2011-12-24 13:22:58.000000000 
-0800
@@ -0,0 +1,37 @@
+#!/bin/sh
+# postinst script for libpam-cap
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <postinst> `abort-remove'
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    configure|abort-upgrade|abort-remove|abort-deconfigure)
+        pam-auth-update --package
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff -Nru libcap2-2.22/debian/libpam-cap.prerm 
libcap2-2.22/debian/libpam-cap.prerm
--- libcap2-2.22/debian/libpam-cap.prerm        1969-12-31 16:00:00.000000000 
-0800
+++ libcap2-2.22/debian/libpam-cap.prerm        2011-12-24 13:23:02.000000000 
-0800
@@ -0,0 +1,39 @@
+#!/bin/sh
+# prerm script for libpam-cap
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+    remove)
+        pam-auth-update --package --remove capability
+    ;;
+
+    upgrade|deconfigure|failed-upgrade)
+    ;;
+
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff -Nru libcap2-2.22/debian/rules libcap2-2.22/debian/rules
--- libcap2-2.22/debian/rules   2011-07-27 22:44:47.000000000 -0700
+++ libcap2-2.22/debian/rules   2011-12-24 13:06:03.000000000 -0800
@@ -1,10 +1,12 @@
 #!/usr/bin/make -f
 
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
 %:
        dh $@
 
 override_dh_auto_install:
-       dh_auto_install -- lib=lib RAISE_SETFCAP=no
+       dh_auto_install -- lib=lib/$(DEB_HOST_MULTIARCH) RAISE_SETFCAP=no
 
 override_dh_makeshlibs:
        dh_makeshlibs -V 'libcap2 (>= 2.10)'

Reply via email to