[apr] 01/01: Large build system overhaul, multiarch

Stefan Fritsch sf at alioth.debian.org
Fri Nov 1 20:54:51 UTC 2013


This is an automated email from the git hooks/post-receive script.

sf pushed a commit to branch master
in repository apr.

commit 4d241b1aaa30e20f96d67ee85d77666ed0da04da
Author: Stefan Fritsch <sf at sfritsch.de>
Date:   Tue Jul 23 23:01:16 2013 +0200

    Large build system overhaul, multiarch
    
      * Switch build system to dh
      * Bump Standards-Version
      * Support multi-arch.
      * Depend on libtool instead of shipping a copy in libapr1-dev.
      * Enable sctp support on Linux.
      * Change apr_rules.mk to not force CFLAGS, etc. to the values used
        during apr's compilation.
---
 debian/changelog                                 |   10 ++
 debian/control                                   |    9 +-
 debian/libapr1-dev.dirs                          |    4 -
 debian/libapr1-dev.install                       |   22 ++-
 debian/libapr1-dev.links                         |    1 +
 debian/libapr1-dev.manpages                      |    1 +
 debian/libapr1.dirs                              |    1 -
 debian/libapr1.install                           |    2 +-
 debian/patches/dont_override_external_buildflags |   21 +++
 debian/patches/series                            |    1 +
 debian/rules                                     |  192 +++++++++-------------
 debian/symbols.common                            |    2 +-
 12 files changed, 137 insertions(+), 129 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 7b2dc93..bc4e67c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,16 @@ apr (1.4.8-2) UNRELEASED; urgency=low
   * Change cross-building preseeds to only apply on linux.
   * Cherry-pick fix for O_NONBLOCK configure check from upstream 1.4.x
     branch.
+  * Switch build system to dh
+    - No longer hard-codes -fstack-protector on unsupported platforms.
+      Closes: #717231
+    - Bump Standards-Version (no additional changes).
+  * Support multi-arch.
+  * Depend on libtool instead of shipping a copy in libapr1-dev.
+    Closes: #489625
+  * Enable sctp support on Linux.
+  * Change apr_rules.mk to not force CFLAGS, etc. to the values used during
+    apr's compilation.
 
  -- Stefan Fritsch <sf at debian.org>  Sun, 14 Jul 2013 23:25:55 +0200
 
diff --git a/debian/control b/debian/control
index 0fc7962..80d6f94 100644
--- a/debian/control
+++ b/debian/control
@@ -3,8 +3,8 @@ Section: libs
 Priority: optional
 Maintainer: Debian Apache Maintainers <debian-apache at lists.debian.org>
 Uploaders: Peter Samuelson <peter at p12n.org>, Stefan Fritsch <sf at debian.org>
-Build-Depends: debhelper (>= 9), autoconf, autotools-dev, mawk, uuid-dev, doxygen, netbase, net-tools, libtool (>= 2), python
-Standards-Version: 3.9.3
+Build-Depends: debhelper (>= 9), autoconf, autotools-dev, mawk, uuid-dev, doxygen, netbase, net-tools, libtool (>= 2), python, libsctp-dev [linux-any]
+Standards-Version: 3.9.5
 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-apache/apr.git
 Vcs-Git: git://git.debian.org/git/pkg-apache/apr.git
 Homepage: http://apr.apache.org/
@@ -12,6 +12,8 @@ Homepage: http://apr.apache.org/
 Package: libapr1
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
+Pre-Depends: ${misc:Pre-Depends}
+Multi-Arch: same
 Conflicts: libapr1.0
 Description: Apache Portable Runtime Library
  APR is Apache's Portable Runtime Library, designed to be a support library 
@@ -21,7 +23,7 @@ Description: Apache Portable Runtime Library
 Package: libapr1-dev
 Architecture: any
 Section: libdevel
-Depends: libapr1 (= ${binary:Version}), uuid-dev, ${misc:Depends}
+Depends: libapr1 (= ${binary:Version}), uuid-dev, ${misc:Depends}, libtool, libsctp-dev [linux-any]
 Suggests: python
 Conflicts: libapr1.0-dev, libapr0-dev
 Description: Apache Portable Runtime Library - Development Headers
@@ -35,6 +37,7 @@ Package: libapr1-dbg
 Architecture: any
 Section: debug
 Priority: extra
+Multi-Arch: same
 Depends: libapr1 (= ${binary:Version}), ${misc:Depends}
 Description: Apache Portable Runtime Library - Debugging Symbols
  APR is Apache's Portable Runtime Library, designed to be a support library 
diff --git a/debian/libapr1-dev.dirs b/debian/libapr1-dev.dirs
deleted file mode 100644
index 919cf6d..0000000
--- a/debian/libapr1-dev.dirs
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/include/apr-1.0
-usr/lib
-usr/lib/pkgconfig
-usr/bin
diff --git a/debian/libapr1-dev.install b/debian/libapr1-dev.install
index 76f0778..7fcf884 100644
--- a/debian/libapr1-dev.install
+++ b/debian/libapr1-dev.install
@@ -1,7 +1,15 @@
-debian/tmp/usr/include/apr-1.0
-debian/tmp/usr/lib/libapr*a
-debian/tmp/usr/lib/libapr-1.so
-debian/tmp/usr/lib/pkgconfig
-debian/tmp/usr/bin
-debian/tmp/usr/share/apr-1.0/
-build-*/docs/dox/html usr/share/doc/libapr1-dev
+usr/include/apr-1.0
+usr/lib/*/libapr*a
+usr/lib/*/libapr-1.so
+usr/lib/*/pkgconfig
+usr/bin
+usr/share/apr-1.0/build/apr_common.m4
+usr/share/apr-1.0/build/apr_rules.mk
+usr/share/apr-1.0/build/find_apr.m4
+usr/share/apr-1.0/build/gen-build.py
+usr/share/apr-1.0/build/get-version.sh
+usr/share/apr-1.0/build/install.sh
+usr/share/apr-1.0/build/make_exports.awk
+usr/share/apr-1.0/build/make_var_export.awk
+usr/share/apr-1.0/build/mkdir.sh
+debian/build/docs/dox/html usr/share/doc/libapr1-dev
diff --git a/debian/libapr1-dev.links b/debian/libapr1-dev.links
index 7db4ae6..38839e9 100644
--- a/debian/libapr1-dev.links
+++ b/debian/libapr1-dev.links
@@ -1,2 +1,3 @@
 usr/bin/apr-1-config usr/bin/apr-config
 usr/share/man/man1/apr-1-config.1 usr/share/man/man1/apr-config.1
+usr/bin/libtool usr/share/apr-1.0/build/libtool
diff --git a/debian/libapr1-dev.manpages b/debian/libapr1-dev.manpages
new file mode 100644
index 0000000..290e0d8
--- /dev/null
+++ b/debian/libapr1-dev.manpages
@@ -0,0 +1 @@
+debian/apr-1-config.1
diff --git a/debian/libapr1.dirs b/debian/libapr1.dirs
deleted file mode 100644
index 6845771..0000000
--- a/debian/libapr1.dirs
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib
diff --git a/debian/libapr1.install b/debian/libapr1.install
index f3a6073..eb23182 100644
--- a/debian/libapr1.install
+++ b/debian/libapr1.install
@@ -1 +1 @@
-debian/tmp/usr/lib/libapr-1.so.* usr/lib/
+usr/lib/*/libapr-1.so.*
diff --git a/debian/patches/dont_override_external_buildflags b/debian/patches/dont_override_external_buildflags
new file mode 100644
index 0000000..db30a81
--- /dev/null
+++ b/debian/patches/dont_override_external_buildflags
@@ -0,0 +1,21 @@
+# Don't force apr-using projects to use the compile flags used during
+# apr's compilation.
+Index: apr/build/apr_rules.mk.in
+===================================================================
+--- apr.orig/build/apr_rules.mk.in	2010-04-21 17:20:26.000000000 +0200
++++ apr/build/apr_rules.mk.in	2013-11-01 21:22:19.655108671 +0100
+@@ -41,10 +41,10 @@
+ # compilation and linking flags that are supposed to be set only by the user.
+ # configure adds to them for tests, but we restore them at the end.
+ #
+-CFLAGS=@CFLAGS@
+-CPPFLAGS=@CPPFLAGS@
+-LDFLAGS=@LDFLAGS@
+-LIBS=@LIBS@
++CFLAGS?=@CFLAGS@
++CPPFLAGS?=@CPPFLAGS@
++LDFLAGS?=@LDFLAGS@
++LIBS?=@LIBS@
+ DEFS=@DEFS@
+ 
+ # anything added to the standard flags by configure is moved to EXTRA_*
diff --git a/debian/patches/series b/debian/patches/series
index 8143552..46d4129 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@ fix_doxygen.patch
 omit_extra_libs.patch
 hurd_shm_flock.patch
 configure-O_NONBLOCK
+dont_override_external_buildflags
diff --git a/debian/rules b/debian/rules
index 09a048c..f35996d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,43 +1,34 @@
 #!/usr/bin/make -f
 
-# Turn on VERBOSE output
 #export DH_VERBOSE=1
+SHELL=/bin/bash
+BUILDDIR := debian/build
 
-# These are used for cross-compiling and for saving the configure script
-# # from having to guess our platform (since we know it already)
 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_HOST_ARCH       ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
 DEB_HOST_ARCH_OS    ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
 DEB_HOST_ARCH_BITS  ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
-
-BUILDDIR := build-$(DEB_HOST_ARCH)
-
-CFLAGS := $(CFLAGS) -pipe -Wall -g
-
-# hardening options
-H_CFLAGS := -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector
-H_LDFLAGS := -Wl,-z,relro
-
-CONFFLAGS += ac_cv_prog_AWK=mawk apr_cv_sctp=no
-ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
-  ifeq ($(DEB_HOST_ARCH_OS),linux)
-    CONFFLAGS += ac_cv_file__dev_zero=yes \
-                 ac_cv_func_setpgrp_void=yes \
-                 apr_cv_epoll=yes \
-                 ac_cv_struct_rlimit=yes \
-                 apr_cv_tcp_nodelay_with_cork=yes \
-                 apr_cv_process_shared_works=yes
-  endif
-  ifeq ($(DEB_HOST_ARCH_BITS),32)
-    CONFFLAGS += ac_cv_sizeof_struct_iovec=8
-  else ifeq ($(DEB_HOST_ARCH_BITS),64)
-    CONFFLAGS += ac_cv_sizeof_struct_iovec=16
-  endif
-endif
+DEB_HOST_MULTIARCH  ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
+%:
+	dh $@ -B$(BUILDDIR) --parallel --with autotools_dev
+
+#
+# configure
+#
+CONFFLAGS := LTFLAGS=--no-silent \
+             --host=$(DEB_HOST_GNU_TYPE) \
+             --build=$(DEB_BUILD_GNU_TYPE) \
+             --enable-layout=Debian \
+             --includedir=/usr/include/apr-1.0 \
+             --with-installbuilddir=/usr/share/apr-1.0/build \
+             --libdir=/usr/lib/$(DEB_HOST_MULTIARCH) \
+             --enable-nonportable-atomics \
+             --enable-allocator-uses-mmap \
+             ac_cv_prog_AWK=mawk
 
 # apr_cv_mutex_robust_shared causes hangs in procmutex test on arm(el|hf) and alpha
-# let's just disable this for squeeze
 ifneq (,$(findstring armel,$(DEB_HOST_ARCH)))
   CONFFLAGS += apr_cv_mutex_robust_shared=no
 endif
@@ -53,43 +44,37 @@ ifneq (,$(findstring sh4,$(DEB_HOST_ARCH)))
   CONFFLAGS += apr_cv_hasprocpthreadser=no ac_cv_define_PTHREAD_PROCESS_SHARED=no
 endif
 
-# Enable debug builds
-ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
-  CFLAGS += -O0
-else
-  ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-    CFLAGS += -O0
-  else
-    CFLAGS += -O2
-  endif
-endif
-
-ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
-  NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
-  MAKEFLAGS += -j$(NUMJOBS)
+# multicast not supported on Hurd
+ifeq (hurd,$(DEB_HOST_ARCH_OS))
+  CONFFLAGS += apr_cv_struct_ipmreq=no
 endif
 
-ifeq (,$(findstring notest,$(DEB_BUILD_OPTIONS))$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
-	TEST_TARGET = test
-else
-	TEST_TARGET =
+# some minimal cross-building support
+ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
+  ifeq ($(DEB_HOST_ARCH_OS),linux)
+    CONFFLAGS += ac_cv_file__dev_zero=yes \
+                 ac_cv_func_setpgrp_void=yes \
+                 apr_cv_epoll=yes \
+                 ac_cv_struct_rlimit=yes \
+                 apr_cv_tcp_nodelay_with_cork=yes \
+                 apr_cv_process_shared_works=yes
+  endif
+  ifeq ($(DEB_HOST_ARCH_BITS),32)
+    CONFFLAGS += ac_cv_sizeof_struct_iovec=8
+  else ifeq ($(DEB_HOST_ARCH_BITS),64)
+    CONFFLAGS += ac_cv_sizeof_struct_iovec=16
+  endif
 endif
 
-SHELL=/bin/bash
+# files that are modified by buildconf and need to be restored during clean
+SAVE_FILES := configure build/libtool.m4 build/ltmain.sh
 
-$(BUILDDIR)/config.status:
-	dh_testdir
+override_dh_auto_configure:
 	mkdir -p $(BUILDDIR)/docs
+	for f in $(SAVE_FILES) ; do [ -e $$f.dr-orig ] || cp -p $$f $$f.dr-orig ; done
 	./buildconf
-	# we need to force the use of bash here. Otherwise, if apr is built with
-	# /bin/sh -> /bin/bash, the resulting libtool will not work on systems
-	# where /bin/sh -> /bin/dash
-	cd $(BUILDDIR) && $(CONFFLAGS) CONFIG_SHELL=/bin/bash /bin/bash ../configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --enable-layout=Debian --includedir=\$${prefix}/usr/include/apr-1.0 --with-installbuilddir=\$${prefix}/usr/share/apr-1.0/build  --enable-nonportable-atomics --enable-allocator-uses-mmap
-ifeq (hurd, $(DEB_HOST_ARCH_OS))
-	# multicast not supported on Hurd
-	sed -i '/HAVE_STRUCT_IPMREQ/ d' $(BUILDDIR)/include/arch/unix/apr_private.h
-endif
-ifeq (linux, $(DEB_HOST_ARCH_OS))
+	cd $(BUILDDIR) && $(CURDIR)/configure $(CONFFLAGS)
+ifeq (linux,$(DEB_HOST_ARCH_OS))
 	if grep -q APR_HAS_POSIXSEM_SERIALIZE.*0 $(BUILDDIR)/include/apr.h ;\
 	then \
 		echo "WARNING: This is Linux but configure did not detect POSIX semaphores." ;\
@@ -104,28 +89,22 @@ ifeq (linux, $(DEB_HOST_ARCH_OS))
 	fi
 endif
 
-build: build-arch build-indep
-build-arch: build-stamp
-build-indep: build-stamp
-
-build-stamp: $(BUILDDIR)/config.status
-	dh_testdir
 
-	$(MAKE) -C $(BUILDDIR) CFLAGS="$(H_CFLAGS) $(CFLAGS)" LDFLAGS="$(H_LDFLAGS) $(LDFLAGS)"
-	$(MAKE) -C $(BUILDDIR) dox
-
-	touch $@
+#
+# build
+#
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+  NUMJOBS := $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+endif
 
-clean:
-	dh_testdir
-	dh_testroot
-	rm -f build-stamp test-stamp
-	rm -f configure build/lt* build/libtool.m4 build-outputs.mk include/arch/unix/apr_private.h.in
-	rm -rf $(BUILDDIR)
+override_dh_auto_build:
+	$(MAKE) -j$(NUMJOBS) -C $(BUILDDIR) all dox
 
-	dh_clean
+#
+# test
+#
 
-test: test-stamp
+ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
 
 # the testsockets test will fail on vservers (no 127.0.0.1) or if ipv6 is
 # enabled in the kernel but not configured on any interface
@@ -134,43 +113,32 @@ IGNORE_TESTSOCK = $(shell IGN=false; \
 	grep -q ipv6 /proc/net/protocols && ( /sbin/ifconfig|grep -q inet6 || IGN=true ) ; \
 	echo $$IGN )
 
-test-stamp: build
-	dh_testdir
-	$(MAKE) -C $(BUILDDIR)/test all CFLAGS="$(H_CFLAGS) $(CFLAGS)" LDFLAGS="$(H_LDFLAGS) $(LDFLAGS)"
+override_dh_auto_test:
+	$(MAKE) -C $(BUILDDIR)/test -j$(NUMJOBS) all
 	cd $(BUILDDIR)/test && ./testall -v testsockets testsock || $(IGNORE_TESTSOCK)
 	cd $(BUILDDIR)/test && ( ulimit -S -s 8192 ; ./testall -v testatomic)
 	cd $(BUILDDIR)/test && ./testall -v -x testsockets testsock testatomic
-	touch $@
-
-install: build $(TEST_TARGET)
-	dh_testdir
-	dh_testroot
-	dh_prep
-	dh_installdirs -a
-
-	$(MAKE) -C $(BUILDDIR) install DESTDIR=$(CURDIR)/debian/tmp
-	perl -p -i -e "s,^dependency_libs=.*,dependency_libs=''," $(CURDIR)/debian/tmp/usr/lib/libapr-1.la
-
-binary-indep: build install
-
-binary-arch: build install
-	dh_testdir
-	dh_testroot
-	dh_installchangelogs CHANGES
-	dh_installdocs
-	dh_install -a
-	dh_installman -plibapr1-dev debian/apr-1-config.1
-	dh_link
+
+else
+override_dh_auto_test:
+
+endif
+
+
+#
+# install
+#
+override_dh_auto_install:
+	dh_auto_install --destdir=debian/tmp
+	perl -p -i -e "s,^dependency_libs=.*,dependency_libs=''," debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libapr-1.la
+
+override_dh_strip:
 	dh_strip --dbg-package=libapr1-dbg
-	dh_lintian
-	dh_compress
-	dh_fixperms
+
+override_dh_makeshlibs:
 	dh_makeshlibs -- -Idebian/symbols.$(DEB_HOST_ARCH_OS)
-	dh_installdeb
-	dh_shlibdeps
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+
+override_dh_auto_clean:
+	dh_auto_clean
+	rm -rf $(BUILDDIR)
+	for f in $(SAVE_FILES) ; do [ ! -e $$f.dr-orig ] || mv $$f.dr-orig $$f ; done
diff --git a/debian/symbols.common b/debian/symbols.common
index 44bbfba..c4d21c2 100644
--- a/debian/symbols.common
+++ b/debian/symbols.common
@@ -345,7 +345,7 @@ libapr-1.so.0 libapr1 #MINVER#
  apr_socket_bind at Base 1.2.7
  apr_socket_close at Base 1.2.7
  apr_socket_connect at Base 1.2.7
- apr_socket_create at Base 1.2.7
+ apr_socket_create at Base 1.4.8-2~
  apr_socket_data_get at Base 1.2.7
  apr_socket_data_set at Base 1.2.7
  apr_socket_inherit_set at Base 1.2.7

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-apache/apr.git



More information about the Pkg-apache-commits mailing list