diff mbox

please add multi-arch support like in libselinux

Message ID 20110816150701.GA17979@afflict.kos.to
State Accepted
Headers show

Commit Message

Riku Voipio Aug. 16, 2011, 3:07 p.m. UTC
Package: libsepol
Version: 2.0.42-1
Severity: wishlist
User: debian-dpkg@lists.debian.org
Usertags: multiarch
Tags: patch

Hi,

Libselinux was already updated to multi-arch. This patch is almost identical,
except for libsepol. In case you don't have time, I can also NMU it and take
care of any possible fallout. Hence the optimistic "NMU with maintainer approval"
changelog entry ;)

Riku
diff mbox

Patch

diff -u libsepol-2.0.42/debian/changelog libsepol-2.0.42/debian/changelog
--- libsepol-2.0.42/debian/changelog
+++ libsepol-2.0.42/debian/changelog
@@ -1,3 +1,14 @@ 
+libsepol (2.0.42-1.1) unstable; urgency=low
+
+  * Non-maintainer upload with permission of the maintainer.
+  * Build for multiarch, setting Pre-Depends multiarch-support in our shared
+    lib package.
+  * Always use -n with gzip, to avoid encoding timestamps in the gzip file;
+    this ensures compressed docs and other files are identical across
+    multiple builds, required for multiarch.
+
+ -- Riku Voipio <riku.voipio@linaro.org>  Tue, 16 Aug 2011 17:29:52 +0300
+
 libsepol (2.0.42-1) unstable; urgency=low
 
   * New Upstream ver: Fix compliation under GCC 4.6 by Justin Mattock
diff -u libsepol-2.0.42/debian/local-vars.mk libsepol-2.0.42/debian/local-vars.mk
--- libsepol-2.0.42/debian/local-vars.mk
+++ libsepol-2.0.42/debian/local-vars.mk
@@ -26,7 +26,7 @@ 
 
 PREFIX  = /usr
 BINDIR  = $(TMPTOP)$(PREFIX)/bin
-LIBDIR  = $(TMPTOP)/lib
+LIBDIR  = $(TMPTOP)/lib/$(DEB_HOST_MULTIARCH)
 INCLUDE = $(TMPTOP)$(PREFIX)/include
 INCDIR  = $(INCLUDE)/sepol
 
diff -u libsepol-2.0.42/debian/control libsepol-2.0.42/debian/control
--- libsepol-2.0.42/debian/control
+++ libsepol-2.0.42/debian/control
@@ -6,12 +6,13 @@ 
 Maintainer: Manoj Srivastava <srivasta@debian.org>
 Uploaders: Russell Coker <russell@coker.com.au>
 Standards-Version: 3.8.3.0
-Build-Depends: file
+Build-Depends: file, dpkg-dev (>= 1.16.0)
 
 Package: sepol-utils
 Section: admin
 Architecture: any
 Depends: ${shlibs:Depends}
+Multi-Arch: foreign
 Conflicts: checkpolicy (<= 1.20)
 Description: Security Enhanced Linux policy utility programs
  This package provides a utility for a Security-enhanced
@@ -28,6 +29,8 @@ 
 Priority: required
 Architecture: any
 Depends: ${shlibs:Depends}
+Pre-Depends: multiarch-support
+Multi-Arch: same
 Description: SELinux library for manipulating binary security policies
  Security-enhanced Linux is a patch of the Linux kernel and a number
  of utilities with enhanced security functionality designed to add
@@ -50,6 +53,7 @@ 
 Provides: libsepol-dev
 Conflicts: libsepol-dev
 Depends: ${shlibs:Depends},  libsepol1 (= ${binary:Version})
+Multi-Arch: same
 Description: SELinux binary policy maniulation library and development files
  libsepol allows programs to easily modify SELinux binary policies.  This
  means changing the default values for booleans, or reading the policy for
diff -u libsepol-2.0.42/debian/local.mk libsepol-2.0.42/debian/local.mk
--- libsepol-2.0.42/debian/local.mk
+++ libsepol-2.0.42/debian/local.mk
@@ -81,7 +81,7 @@ 
 	$(make_directory)   $(LIBDIR)
 	$(make_directory)   $(TMPTOP)/DEBIAN
 	$(install_file)	    debian/shlibs	     $(TMPTOP)/DEBIAN
-	$(MAKE)		    DESTDIR=$(TMPTOP) -C src install
+	$(MAKE)		    DESTDIR=$(TMPTOP) SHLIBDIR=$(LIBDIR) -C src install
 	rm -f		    $(LIBDIR)/libsepol.a
 	rm -f		    $(LIBDIR)/libsepol.so
 	test ! -e           $(LIBDIR)/libsepol.pc || rm -f $(LIBDIR)/libsepol.pc
@@ -89,7 +89,7 @@ 
 	chmod 0644          $(LIBDIR)/libsepol.so.1
 	$(install_file)	    debian/changelog	     $(DOCDIR)/changelog.Debian
 	$(install_file)	    ChangeLog		     $(DOCDIR)/changelog
-	gzip -9fqr	    $(DOCDIR)/
+	gzip -9fnqr	    $(DOCDIR)/
 # Make sure the copyright file is not compressed
 	$(install_file)	     debian/copyright	     $(DOCDIR)/copyright
 	$(strip-lib)
@@ -111,14 +111,14 @@ 
 	$(MAKE)		    DESTDIR=$(TMPTOP) -C man install
 	rm -rf		    $(MAN8DIR)
 	$(MAKE)		    DESTDIR=$(TMPTOP) -C include install
-	$(MAKE)		    DESTDIR=$(TMPTOP) -C src install
-	rm -rf		    $(LIBDIR)
-	rm -f		    $(TMPTOP)/usr/lib/libsepol.so
-	ln -s               /lib/libsepol.so.1       $(TMPTOP)/usr/lib/libsepol.so
+	$(MAKE)		    DESTDIR=$(TMPTOP) LIBDIR=$(TMPTOP)/usr/lib/$(DEB_HOST_MULTIARCH) SHLIBDIR=$(LIBDIR) -C src install
+	rm -rf		    $(TMPTOP)/lib
+	rm -f		    $(TMPTOP)/usr/lib/$(DEB_HOST_MULTIARCH)/libsepol.so
+	ln -s               /lib/$(DEB_HOST_MULTIARCH)/libsepol.so.1 $(TMPTOP)/usr/lib/$(DEB_HOST_MULTIARCH)/libsepol.so
 	$(install_file)	    debian/changelog	     $(DOCDIR)/changelog.Debian
 	$(install_file)	    ChangeLog		     $(DOCDIR)/changelog
-	gzip -9fqr	    $(DOCDIR)/
-	gzip -9fqr	    $(MANDIR)/
+	gzip -9fqnr	    $(DOCDIR)/
+	gzip -9fqnr	    $(MANDIR)/
 # Make sure the copyright file is not compressed
 	$(install_file)	     debian/copyright	     $(DOCDIR)/copyright
 	$(strip-lib)
@@ -139,8 +139,8 @@ 
 	$(MAKE) DESTDIR=$(TMPTOP) -C utils install
 	$(install_file)	     debian/changelog	     $(DOCDIR)/changelog.Debian
 	$(install_file)	    ChangeLog		     $(DOCDIR)/changelog
-	gzip -9fqr	    $(DOCDIR)/
-	gzip -9fqr	    $(MANDIR)/
+	gzip -9fnqr	    $(DOCDIR)/
+	gzip -9fnqr	    $(MANDIR)/
 # Make sure the copyright file is not compressed
 	$(install_file)	     debian/copyright	     $(DOCDIR)/copyright
 	$(strip-exec)
diff -u libsepol-2.0.42/debian/common/archvars.mk libsepol-2.0.42/debian/common/archvars.mk
--- libsepol-2.0.42/debian/common/archvars.mk
+++ libsepol-2.0.42/debian/common/archvars.mk
@@ -80,6 +80,7 @@ 
 export DEB_HOST_GNU_CPU    := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_GNU_CPU)
 export DEB_HOST_GNU_SYSTEM := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_GNU_SYSTEM)
 export DEB_HOST_GNU_TYPE   := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_GNU_TYPE)
+export DEB_HOST_MULTIARCH  := $(shell $(DPKG_ARCH) $(ha) -qDEB_HOST_MULTIARCH)
 
 # arrgh. future proofing
 ifeq ($(DEB_HOST_GNU_SYSTEM), linux)