tags 636989 patch
user multiarch-de...@lists.alioth.debian.org
usertags 636989 multiarch
thanks

Hi Bill,

Please find attached an improved multiarch patch for libjpeg8.  This patch
fixes a missing pre-depends on multiarch-support (${misc:Pre-Depends} can't
be used because debian/rules never calls dh_makeshlibs), correctly installs
jconfig.h to an architecture-dependent directory (since it's autogenerated
and includes architecture-specific defines), and along the way includes a
fix for cross-compilation support.

This patch has been included in Ubuntu precise.  Please consider uploading
it to Debian as well - libjpeg8 seems to be up to date in testing, so it
doesn't look like there should be any transitions blocking it now?

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
=== modified file 'debian/control'
--- debian/control	2011-07-07 10:48:52 +0000
+++ debian/control	2011-11-09 05:33:08 +0000
@@ -8,17 +8,20 @@
 Package: libjpeg8
 Architecture: any
 Section: libs
+Multi-Arch: same
 Description: Independent JPEG Group's JPEG runtime library
  The Independent JPEG Group's JPEG library is a library for handling
  JPEG files.
  .
  This package contains the shared library.
+Pre-Depends: multiarch-support
 Depends: ${shlibs:Depends},${misc:Depends}
 
 Package: libjpeg8-dev
 Architecture: any
 Section: libdevel
+Multi-Arch: same
 Description: Development files for the IJG JPEG library
  The Independent JPEG Group's JPEG library is a library for handling
  JPEG files.
  .

=== modified file 'debian/libjpeg8-dev.files'
--- debian/libjpeg8-dev.files	2011-07-07 10:48:52 +0000
+++ debian/libjpeg8-dev.files	2011-11-09 05:15:53 +0000
@@ -1,3 +1,3 @@
 usr/include
-usr/lib/libjpeg.a
-usr/lib/libjpeg.so
+usr/lib/*/libjpeg.a
+usr/lib/*/libjpeg.so

=== modified file 'debian/libjpeg8.files'
--- debian/libjpeg8.files	2011-02-15 10:44:26 +0000
+++ debian/libjpeg8.files	2011-11-09 05:15:53 +0000
@@ -1,2 +1,2 @@
-/usr/lib/libjpeg.so.8.3.0
-/usr/lib/libjpeg.so.8
+/usr/lib/*/libjpeg.so.8.3.0
+/usr/lib/*/libjpeg.so.8

=== modified file 'debian/rules'
--- debian/rules	2011-07-07 10:48:52 +0000
+++ debian/rules	2011-11-09 05:38:07 +0000
@@ -6,6 +6,7 @@
 
 export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
 export CFLAGS=-D_REENTRANT -g -Wall -Wno-main
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
@@ -15,11 +16,17 @@
 endif
 
 #export DH_VERBOSE=1
+ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+CC = gcc
+else
+CC = $(DEB_HOST_GNU_TYPE)-gcc
+endif
 
 build: build-stamp 
 build-stamp: 
 	dh_testdir
 	./configure --prefix=/usr --mandir=/usr/share/man \
+	 --libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
 	 --enable-static --enable-shared \
 	 --disable-silent-rules \
 	 --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) 
@@ -27,7 +34,7 @@
 ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
 	$(MAKE) check
 endif
-	$(MAKE) -C debian/extra
+	$(MAKE) -C debian/extra CC=$(CC)
 
 	touch build-stamp
 
@@ -50,8 +57,9 @@
 	$(MAKE) install -C debian/extra prefix=/usr DESTDIR=`pwd`/debian/tmp
 	# fix jconfig.h 
 	rm debian/tmp/usr/include/jconfig.h
+	mkdir debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)
 	sed -e "s/#\(undef\|define\) HAVE_\(LOCALE\|\(STD\(DEF\|LIB\)\)\)_H 1//g" \
-		jconfig.h > debian/tmp/usr/include/jconfig.h
+		jconfig.h > debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/jconfig.h
 	# separate out lib package
 	dh_movefiles
 	# Finish it off with debhelper
@@ -62,7 +70,7 @@
 	dh_compress 
 	dh_fixperms 
 	dh_installdeb 
-	dh_shlibdeps -l`pwd`/debian/libjpeg8/usr/lib 
+	dh_shlibdeps -l`pwd`/debian/libjpeg8/usr/lib/$(DEB_HOST_MULTIARCH)
 	dh_gencontrol 
 	dh_md5sums 
 	dh_builddeb 

Attachment: signature.asc
Description: Digital signature

Reply via email to