OSDN Git Service

debian: add support for multiarch
authorTheodore Ts'o <tytso@mit.edu>
Mon, 19 Sep 2011 03:53:23 +0000 (23:53 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 19 Sep 2011 03:53:23 +0000 (23:53 -0400)
Enhance the debian build rules so it will create multiarch compliant
packages on those distributions that have support for it.

Also remove e2initrd-helper from the e2fsprogs package since no one
uses it any more.

Also update the debian policy standards version to 3.9.2.

Addresses-Debian-Bug: #632169

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
23 files changed:
configure
configure.in
debian/comerr-dev.files.in [moved from debian/comerr-dev.files with 63% similarity]
debian/control.in
debian/e2fslibs-dev.files [deleted file]
debian/e2fslibs-dev.files.in [new file with mode: 0644]
debian/e2fslibs.files [deleted file]
debian/e2fslibs.files.in [new file with mode: 0644]
debian/e2fsprogs.files
debian/libblkid-dev.files [deleted file]
debian/libblkid-dev.files.in [new file with mode: 0644]
debian/libblkid1.files [deleted file]
debian/libblkid1.files.in [new file with mode: 0644]
debian/libcomerr2.files [deleted file]
debian/libcomerr2.files.in [new file with mode: 0644]
debian/libss2.files [deleted file]
debian/libss2.files.in [new file with mode: 0644]
debian/libuuid1.files [deleted file]
debian/libuuid1.files.in [new file with mode: 0644]
debian/rules
debian/ss-dev.files.in [moved from debian/ss-dev.files with 54% similarity]
debian/uuid-dev.files [deleted file]
debian/uuid-dev.files.in [new file with mode: 0644]

index 667845f..35dd5ce 100755 (executable)
--- a/configure
+++ b/configure
@@ -823,6 +823,7 @@ enable_rpath
 with_libiconv_prefix
 with_included_gettext
 with_libintl_prefix
+with_multiarch
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1487,6 +1488,7 @@ Optional Packages:
   --with-included-gettext use the GNU gettext library included here
   --with-libintl-prefix[=DIR]  search for libintl in DIR/include and DIR/lib
   --without-libintl-prefix     don't search for libintl in includedir and libdir
+  --with-multiarch=ARCH specify the multiarch triplet
 
 Some influential environment variables:
   CC          C compiler command
 
 
 
+
+# Check whether --with-multiarch was given.
+if test "${with_multiarch+set}" = set; then :
+  withval=$with_multiarch; libdir=$libdir/$withval
+root_libdir=$root_libdir/$withval
+
+fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether linker accepts -static" >&5
 $as_echo_n "checking whether linker accepts -static... " >&6; }
 if test "${ac_cv_e2fsprogs_use_static+set}" = set; then :
index e8e41fb..90a6eec 100644 (file)
@@ -1068,6 +1068,14 @@ AC_SUBST(root_sbindir)
 AC_SUBST(root_libdir)
 AC_SUBST(root_sysconfdir)
 dnl
+dnl Allow specification of the multiarch arch
+dnl
+AC_ARG_WITH([multiarch],
+[  --with-multiarch=ARCH specify the multiarch triplet],
+libdir=$libdir/$withval
+root_libdir=$root_libdir/$withval
+)dnl
+dnl
 dnl See if -static works.
 dnl
 AC_MSG_CHECKING([whether linker accepts -static])
similarity index 63%
rename from debian/comerr-dev.files
rename to debian/comerr-dev.files.in
index 9e5e1e1..a3b8b0e 100644 (file)
@@ -1,9 +1,9 @@
-usr/lib/libcom_err.a
-usr/lib/libcom_err.so
+usr/lib/*/libcom_err.a
+usr/lib/*/libcom_err.so
 usr/include/et/*
 usr/include/com_err.h
 usr/share/man/man1/compile_et*
 usr/share/man/man3/com_err.3*
 usr/bin/compile_et
 usr/share/et/*
-usr/lib/pkgconfig/com_err.pc
+usr/lib/*/pkgconfig/com_err.pc
index 3c8cf84..75fedef 100644 (file)
@@ -1,13 +1,14 @@
+define(MULTIARCH_HEADERS,ifdef(`DO_MULTIARCH',
+Multi-Arch: same
+Pre-Depends: ${misc:Pre-Depends},REMOVE_ME))dnl
+define(UTIL_LINUX_NG_DEFINES,
+ifdef(`UTIL_LINUX_NG', ``libblkid-dev (>= 2.16), uuid-dev (>= 2.16),''))dnl
 Source: e2fsprogs
 Section: admin
 Priority: required
 Maintainer: Theodore Y. Ts'o <tytso@mit.edu>
-ifdef(`UTIL_LINUX_NG',
-``Build-Depends: texi2html (>= 1.76), gettext, texinfo, dc, pkg-config, dietlibc-dev (>> 0.30) [alpha amd64 arm hppa i386 ia64 powerpc ppc64 s390 sparc], debhelper (>= 7.0), m4, libblkid-dev (>= 2.16), uuid-dev (>= 2.16)
-'',
-``Build-Depends: texi2html (>= 1.76), gettext, texinfo, dc, pkg-config, dietlibc-dev (>> 0.30) [alpha amd64 arm hppa i386 ia64 powerpc ppc64 s390 sparc], debhelper (>= 7.0), m4
-'')dnl
-Standards-Version: 3.8.4
+Build-Depends: texi2html (>= 1.76), gettext, texinfo, dc, pkg-config, dietlibc-dev (>> 0.30) [alpha amd64 arm hppa i386 ia64 powerpc ppc64 s390 sparc], debhelper (>= 7.0), UTIL_LINUX_NG_DEFINES m4
+Standards-Version: 3.9.2
 Homepage: http://e2fsprogs.sourceforge.net
 
 Package: e2fsck-static
@@ -31,6 +32,7 @@ Provides: libcomerr-kth-compat
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Replaces: e2fsprogs (<< 1.34-1)
 Architecture: any
+MULTIARCH_HEADERS
 Description: common error description library
  libcomerr is an attempt to present a common error-handling mechanism to
  manipulate the most common form of error code in a fashion that does not
@@ -55,10 +57,11 @@ Section: libs
 Depends: libcomerr2, ${shlibs:Depends}, ${misc:Depends}
 Replaces: e2fsprogs (<< 1.34-1)
 Architecture: any
+MULTIARCH_HEADERS
 Description: command-line interface parsing library
- This package includes a tool that parses a command table to generate
- a simple command-line interface parser, the include files needed to
compile and use it, and the static libs.
+ libss provides a simple command-line interface parser which will
+ accept input from the user, parse the command into an argv argument
vector, and then dispatch it to a handler function.
  . 
  It was originally inspired by the Multics SubSystem library.
 
@@ -82,6 +85,7 @@ Depends: passwd, ${shlibs:Depends}, ${misc:Depends}
 Recommends: uuid-runtime
 Replaces: e2fsprogs (<< 1.34-1)
 Architecture: any
+MULTIARCH_HEADERS
 Description: Universally Unique ID library
  The libuuid library generates and parses 128-bit universally unique
  ids (UUIDs).  A UUID is an identifier that is unique across both
@@ -200,6 +204,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}
 Replaces: e2fsprogs (<< 1.34-1)
 Provides: libext2fs2, libe2p2
 Architecture: any
+MULTIARCH_HEADERS
 Description: ext2/ext3/ext4 file system libraries
  The ext2, ext3 and ext4 file systems are successors of the original ext
  ("extended") file system. They are the main file system types used for
diff --git a/debian/e2fslibs-dev.files b/debian/e2fslibs-dev.files
deleted file mode 100644 (file)
index 0c0b986..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-usr/lib/*.so
-usr/lib/*.a
-usr/include/ext2fs
-usr/include/e2p
-usr/include/quota
-usr/share/info/libext2fs.info*
-usr/lib/pkgconfig/e2p.pc
-usr/lib/pkgconfig/ext2fs.pc
-usr/lib/pkgconfig/quota.pc
diff --git a/debian/e2fslibs-dev.files.in b/debian/e2fslibs-dev.files.in
new file mode 100644 (file)
index 0000000..b567c84
--- /dev/null
@@ -0,0 +1,9 @@
+usr/lib/*/*.so
+usr/lib/*/*.a
+usr/include/ext2fs
+usr/include/e2p
+usr/include/quota
+usr/share/info/libext2fs.info*
+usr/lib/*/pkgconfig/e2p.pc
+usr/lib/*/pkgconfig/ext2fs.pc
+usr/lib/*/pkgconfig/quota.pc
diff --git a/debian/e2fslibs.files b/debian/e2fslibs.files
deleted file mode 100644 (file)
index bfabca3..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-lib/libext2fs*
-lib/libe2p*
-lib/libquota*
diff --git a/debian/e2fslibs.files.in b/debian/e2fslibs.files.in
new file mode 100644 (file)
index 0000000..8e06875
--- /dev/null
@@ -0,0 +1,3 @@
+lib/*/libext2fs*
+lib/*/libe2p*
+lib/*/libquota*
index f409a22..37e54da 100644 (file)
@@ -1,8 +1,6 @@
-lib
 sbin
 usr/bin
 usr/sbin
-usr/lib/e2initrd_helper
 usr/share/man
 usr/share/locale
 etc
diff --git a/debian/libblkid-dev.files b/debian/libblkid-dev.files
deleted file mode 100644 (file)
index 31ec0f0..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/lib/libblkid*
-usr/include/blkid
-usr/share/man/man3/libblkid.3
-usr/lib/pkgconfig/blkid.pc
diff --git a/debian/libblkid-dev.files.in b/debian/libblkid-dev.files.in
new file mode 100644 (file)
index 0000000..84dc3f2
--- /dev/null
@@ -0,0 +1,4 @@
+usr/lib/*/libblkid*
+usr/include/blkid
+usr/share/man/man3/libblkid.3
+usr/lib/*/pkgconfig/blkid.pc
diff --git a/debian/libblkid1.files b/debian/libblkid1.files
deleted file mode 100644 (file)
index d2f1ccc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-lib/libblkid*
diff --git a/debian/libblkid1.files.in b/debian/libblkid1.files.in
new file mode 100644 (file)
index 0000000..871d7be
--- /dev/null
@@ -0,0 +1 @@
+lib/*/libblkid*
diff --git a/debian/libcomerr2.files b/debian/libcomerr2.files
deleted file mode 100644 (file)
index 2600ae0..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-lib/libcom_err*
-
diff --git a/debian/libcomerr2.files.in b/debian/libcomerr2.files.in
new file mode 100644 (file)
index 0000000..e4e5efc
--- /dev/null
@@ -0,0 +1 @@
+lib/*/libcom_err*
diff --git a/debian/libss2.files b/debian/libss2.files
deleted file mode 100644 (file)
index 5f8175a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-lib/libss*
diff --git a/debian/libss2.files.in b/debian/libss2.files.in
new file mode 100644 (file)
index 0000000..e5d8182
--- /dev/null
@@ -0,0 +1 @@
+lib/*/libss*
diff --git a/debian/libuuid1.files b/debian/libuuid1.files
deleted file mode 100644 (file)
index da600dc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-lib/libuuid*
diff --git a/debian/libuuid1.files.in b/debian/libuuid1.files.in
new file mode 100644 (file)
index 0000000..6dc05ce
--- /dev/null
@@ -0,0 +1 @@
+lib/*/libuuid*
index 1a48529..9dfd4b1 100755 (executable)
@@ -24,6 +24,7 @@ DEB_BUILD_ARCH   ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)
 DEB_HOST_OS   ?= $(shell dpkg-architecture -qDEB_HOST_OS)
 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_MULTIARCH  ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null)
 
 # find the version for the main package, from changelog file
 MAIN_VERSION = $(shell head -n 1 debian/changelog | cut '-d ' -f 2 | sed 's/[()]//g')
@@ -127,8 +128,8 @@ endif
 
 BF_CFLAGS = -Os -fomit-frame-pointer
 
-COMMON_CONF_FLAGS =  \
-                --enable-elf-shlibs --infodir=/usr/share/info
+COMMON_CONF_FLAGS = --disable-e2initrd-helper --enable-elf-shlibs \
+       --infodir=/usr/share/info
 ifeq ($(UTIL_LINUX_NG),yes)
 COMMON_CONF_FLAGS += --disable-fsck --disable-libblkid \
                        --disable-libuuid --disable-uuidd
@@ -136,15 +137,23 @@ else
 COMMON_CONF_FLAGS += --enable-fsck
 endif
 
-STD_CONF_FLAGS = --enable-symlink-install
+ifneq ($(strip $(DEB_HOST_MULTIARCH)),)
+MULTIARCH_CONF = --with-multiarch=$(DEB_HOST_MULTIARCH)
+# This doesn't work yet because gdb and lintian don't expect and/or
+# don't work with /usr/lib/<triplet>/debug
+#USRLIB = /usr/lib/$(DEB_HOST_MULTIARCH)
+USRLIB = /usr/lib
+else
+USRLIB = /usr/lib
+endif
+
+STD_CONF_FLAGS = --enable-symlink-install $(MULTIARCH_CONF)
 
 BF_CONF_FLAGS = --disable-nls --disable-imager --disable-testio-debug \
-       --disable-uuidd --disable-tls \
-       --disable-debugfs  --disable-e2initrd-helper
+       --disable-uuidd --disable-tls --disable-debugfs
 
 STATIC_CONF_FLAGS = --disable-nls --disable-imager \
-       --disable-uuidd --disable-tls \
-       --disable-e2initrd-helper
+       --disable-uuidd --disable-tls
 
 MIPS_NOPIC_CONF_FLAGS = --disable-nls --disable-imager \
        --disable-uuidd --disable-tls \
@@ -167,13 +176,30 @@ else
 M4_ARGS+=-UUTIL_LINUX_NG
 endif
 
+ifneq ($(strip $(DEB_HOST_MULTIARCH)),)
+M4_ARGS+=-DDO_MULTIARCH
+else
+M4_ARGS+=-UDO_MULTIARCH
+endif
+
+FILES_FIXUP= libcomerr2.files comerr-dev.files libss2.files ss-dev.files \
+       libuuid1.files uuid-dev.files libblkid1.files libblkid-dev.files \
+       e2fslibs.files e2fslibs-dev.files
+
 debian-files: debian/control debian/e2fsprogs.shlibs.local
+ifeq ($(strip $(DEB_HOST_MULTIARCH)),)
+       for i in $(FILES_FIXUP); do \
+               sed -e 's;lib/\*/;lib/;' debian/$$i.in > debian/$$i; \
+       done
+else
+       for i in $(FILES_FIXUP); do cp debian/$$i.in debian/$$i; done
+endif
 
 mrproper: clean
        rm debian/control debian/e2fsprogs.shlibs.local
 
 debian/control: debian/control.in debian/rules
-       m4 $(M4_ARGS) < debian/control.in > $@
+       m4 $(M4_ARGS) < debian/control.in | grep -v ^REMOVE_ME$$ > $@
 
 debian/e2fsprogs.shlibs.local: debian/e2fsprogs.shlibs.local.in
        m4 $(M4_ARGS) < debian/e2fsprogs.shlibs.local.in > $@
@@ -250,6 +276,8 @@ endif
        mkdir -p ${STAMPSDIR}
        touch ${CFGSTATICSTAMP}
 
+build-arch: build
+build-indep: build
 build: build-std build-bf $(BUILD_STATIC)
 
 build-std: ${BUILDSTDSTAMP}
@@ -468,38 +496,38 @@ ifneq ($(UTIL_LINUX_NG),yes)
        rm -rf ${uuidudebdir}/usr
 endif
 
-       mkdir -p ${debugdir}/usr/lib
-       mv ${maindir}/usr/lib/debug ${debugdir}/usr/lib
+       mkdir -p ${debugdir}/$(USRLIB)
+       mv ${maindir}/usr/lib/debug ${debugdir}/$(USRLIB)
        rm -rf ${maindir}/usr/lib/debug
        mv ${e2fsckstaticdir}/usr/lib/debug/sbin/* \
-               ${debugdir}/usr/lib/debug
+               ${debugdir}/$(USRLIB)/debug
        rm -rf ${e2fsckstaticdir}/usr/lib
 
 ifneq ($(UTIL_LINUX_NG),yes)
-       mkdir -p ${uuidruntimedbgdir}/usr/lib
-       mv ${uuidruntimedir}/usr/lib/debug ${uuidruntimedbgdir}/usr/lib
+       mkdir -p ${uuidruntimedbgdir}/$(USRLIB)
+       mv ${uuidruntimedir}/usr/lib/debug ${uuidruntimedbgdir}/$(USRLIB)
        rmdir ${uuidruntimedir}/usr/lib
 endif
 
-       mkdir -p ${libext2dbgdir}/usr/lib
-       mv ${libext2dir}/usr/lib/debug ${libext2dbgdir}/usr/lib
+       mkdir -p ${libext2dbgdir}/$(USRLIB)
+       mv ${libext2dir}/usr/lib/debug ${libext2dbgdir}/$(USRLIB)
        rmdir ${libext2dir}/usr/lib
 
-       mkdir -p ${libcomerrdbgdir}/usr/lib
-       mv ${libcomerrdir}/usr/lib/debug ${libcomerrdbgdir}/usr/lib
+       mkdir -p ${libcomerrdbgdir}/$(USRLIB)
+       mv ${libcomerrdir}/usr/lib/debug ${libcomerrdbgdir}/$(USRLIB)
        rmdir ${libcomerrdir}/usr/lib
 
-       mkdir -p ${libssdbgdir}/usr/lib
-       mv ${libssdir}/usr/lib/debug ${libssdbgdir}/usr/lib
+       mkdir -p ${libssdbgdir}/$(USRLIB)
+       mv ${libssdir}/usr/lib/debug ${libssdbgdir}/$(USRLIB)
        rmdir ${libssdir}/usr/lib
 
 ifneq ($(UTIL_LINUX_NG),yes)
-       mkdir -p ${libuuiddbgdir}/usr/lib
-       mv ${libuuiddir}/usr/lib/debug ${libuuiddbgdir}/usr/lib
+       mkdir -p ${libuuiddbgdir}/$(USRLIB)
+       mv ${libuuiddir}/usr/lib/debug ${libuuiddbgdir}/$(USRLIB)
        rmdir ${libuuiddir}/usr/lib
 
-       mkdir -p ${libblkiddbgdir}/usr/lib
-       mv ${libblkiddir}/usr/lib/debug ${libblkiddbgdir}/usr/lib
+       mkdir -p ${libblkiddbgdir}/$(USRLIB)
+       mv ${libblkiddir}/usr/lib/debug ${libblkiddbgdir}/$(USRLIB)
        rmdir ${libblkiddir}/usr/lib
 endif
 
similarity index 54%
rename from debian/ss-dev.files
rename to debian/ss-dev.files.in
index fa15221..d0c788e 100644 (file)
@@ -1,7 +1,7 @@
-usr/lib/libss.so
-usr/lib/libss.a
+usr/lib/*/libss.so
+usr/lib/*/libss.a
 usr/include/ss/*
 usr/bin/mk_cmds
 usr/share/ss/*
 usr/share/man/man1/mk_cmds*
-usr/lib/pkgconfig/ss.pc
+usr/lib/*/pkgconfig/ss.pc
diff --git a/debian/uuid-dev.files b/debian/uuid-dev.files
deleted file mode 100644 (file)
index 44b5163..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-usr/lib/libuuid.so
-usr/lib/libuuid.a
-usr/include/uuid/*
-usr/share/man/man3/uuid*
-usr/lib/pkgconfig/uuid.pc
diff --git a/debian/uuid-dev.files.in b/debian/uuid-dev.files.in
new file mode 100644 (file)
index 0000000..534b92c
--- /dev/null
@@ -0,0 +1,5 @@
+usr/lib/*/libuuid.so
+usr/lib/*/libuuid.a
+usr/include/uuid/*
+usr/share/man/man3/uuid*
+usr/lib/*/pkgconfig/uuid.pc