Package: libselinux
Version: 2.0.71-1
Severity: wishlist
Tags: patch

Hi,

the attached patch adds multiarch support.

MfG
        Goswin

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (400, 'unstable-i386')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-xen-1 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash
diff -u libselinux-2.0.71/debian/local.mk libselinux-2.0.71/debian/local.mk
--- libselinux-2.0.71/debian/local.mk
+++ libselinux-2.0.71/debian/local.mk
@@ -85,7 +85,7 @@
 	$(make_directory)   $(LIBDIR)
 	$(make_directory)   $(TMPTOP)/DEBIAN
 	$(install_file)	    debian/shlibs	     $(TMPTOP)/DEBIAN
-	$(MAKE)		    DESTDIR=$(TMPTOP) -C src install
+	$(MAKE)		    DESTDIR=$(TMPTOP) DEB_HOST_GNU_TYPE=$(DEB_HOST_GNU_TYPE) -C src install
 	rm -f		    $(LIBDIR)/libselinux.a
 	rm -f		    $(LIBDIR)/libselinux.so
 	rm -rf		    $(TMPTOP)/usr/lib/
@@ -124,8 +124,8 @@
 	$(MAKE)		    DESTDIR=$(TMPTOP) -C include install
 	$(MAKE)		    DESTDIR=$(TMPTOP) -C src install
 	rm -fr		    $(LIBDIR)
-	rm -f		    $(TMPTOP)/usr/lib/libselinux.so
-	ln -s               /lib/libselinux.so.1     $(TMPTOP)/usr/lib/libselinux.so
+	rm -f		    $(TMPTOP)/usr/lib/$(DEB_HOST_GNU_TYPE)/libselinux.so
+	ln -s               /lib/$(DEB_HOST_GNU_TYPE)/libselinux.so.1     $(TMPTOP)/usr/lib/$(DEB_HOST_GNU_TYPE)/libselinux.so
 	rm -rf              $(TMPTOP)/usr/lib/python2.4/
 	$(install_file)	    debian/changelog 	     $(DOCDIR)/changelog.Debian
 	$(install_file)	    ChangeLog		     $(DOCDIR)/changelog
diff -u libselinux-2.0.71/debian/changelog libselinux-2.0.71/debian/changelog
--- libselinux-2.0.71/debian/changelog
+++ libselinux-2.0.71/debian/changelog
@@ -1,3 +1,9 @@
+libselinux (2.0.71-1a0.multi.1) unstable; urgency=low
+
+  * Convert to multiarch
+
+ -- Goswin von Brederlow <goswin-...@web.de>  Mon, 11 May 2009 09:30:29 +0200
+
 libselinux (2.0.71-1) unstable; urgency=low
 
   * New upstream release
diff -u libselinux-2.0.71/debian/local-vars.mk libselinux-2.0.71/debian/local-vars.mk
--- libselinux-2.0.71/debian/local-vars.mk
+++ libselinux-2.0.71/debian/local-vars.mk
@@ -27,7 +27,7 @@
 
 PREFIX  = /usr
 BINDIR  = $(TMPTOP)$(PREFIX)/bin
-LIBDIR  = $(TMPTOP)/lib
+LIBDIR  = $(TMPTOP)/lib/$(DEB_HOST_GNU_TYPE)
 INCLUDE = $(TMPTOP)$(PREFIX)/include
 INCDIR  = $(INCLUDE)/selinux
 
diff -u libselinux-2.0.71/debian/control libselinux-2.0.71/debian/control
--- libselinux-2.0.71/debian/control
+++ libselinux-2.0.71/debian/control
@@ -10,6 +10,7 @@
 
 Package: selinux-utils
 Architecture: any
+Multi-Arch: no
 Section: admin
 Depends: ${shlibs:Depends}
 Description: SELinux utility programs
@@ -22,6 +23,7 @@
 
 Package: libselinux1
 Architecture: any
+Multi-Arch: yes
 Section: libs
 Priority: required
 Depends: ${shlibs:Depends}
diff -u libselinux-2.0.71/src/Makefile libselinux-2.0.71/src/Makefile
--- libselinux-2.0.71/src/Makefile
+++ libselinux-2.0.71/src/Makefile
@@ -1,7 +1,7 @@
 # Installation directories.
 PREFIX ?= /usr
-LIBDIR ?= $(PREFIX)/lib
-SHLIBDIR ?= $(DESTDIR)/lib
+LIBDIR ?= $(PREFIX)/lib/$(DEB_HOST_GNU_TYPE)
+SHLIBDIR ?= $(DESTDIR)/lib/$(DEB_HOST_GNU_TYPE)
 INCLUDEDIR ?= $(PREFIX)/include
 PYLIBVER ?= $(shell python -c 'import sys;print "python%d.%d" % sys.version_info[0:2]')
 PYINC ?= /usr/include/$(PYLIBVER)
@@ -9,8 +9,10 @@
 PYTHONLIBDIR ?= $(LIBDIR)/$(PYLIBVER)
 RUBYLIBVER ?= $(shell ruby -e 'print RUBY_VERSION.split(".")[0..1].join(".")')
 RUBYPLATFORM ?= $(shell ruby -e 'print RUBY_PLATFORM')
-RUBYINC ?= $(LIBDIR)/ruby/$(RUBYLIBVER)/$(RUBYPLATFORM)
-RUBYINSTALL ?= $(LIBDIR)/ruby/site_ruby/$(RUBYLIBVER)/$(RUBYPLATFORM)
+RUBYLIB ?= $(PREFIX)/lib/ruby
+RUBYINC ?= $(RUBYLIB)/$(RUBYLIBVER)/$(RUBYPLATFORM)
+RUBYINSTALL ?= $(RUBYLIB)/site_ruby/$(RUBYLIBVER)/$(RUBYPLATFORM)
+SEPOLDIR ?= $(PREFIX)/lib
 
 LIBVERSION = 1
 
@@ -90,7 +92,7 @@
 	$(CC) $(CFLAGS) -I$(PYINC) -fPIC -DSHARED -c -o $@ $<
 
 $(AUDIT2WHYSO): audit2why.lo
-	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux ${LIBDIR}/libsepol.a -L$(LIBDIR) -Wl,-soname,$@
+	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux ${SEPOLDIR}/libsepol.a -L$(LIBDIR) -Wl,-soname,$@
 
 %.o:  %.c policy.h
 	$(CC) $(CFLAGS) $(TLSFLAGS) -c -o $@ $<

Reply via email to