pgpprBXD7TkjW.pgp
Description: PGP signature
>From 462ece0691e3197c3392c7ceadf9776a34ee219d Mon Sep 17 00:00:00 2001 From: Dmitrijs Ledkovs <[email protected]> Date: Sat, 27 Nov 2010 19:08:46 +0000 Subject: [PATCH] Make building against different default bintuils easier
Ubuntu, Debian unstable and Debian experimental often have different versions of bintuils. I have updated packaging to take into account variable version of binutils-source. Also improved parallel make, build-dir & CFLAGS handling. * Use dpkg-buildflags (which parses DEB_BUILD_OPTION) * Fix parallel build by using dh_auto_* commands * Create lintian overrides for errors in binutils-source * Make package native * Make produced binary version match binutils-source version * dh_clean should be run last in clean target --- debian/binutils-mingw-w64.lintian-overrides | 6 +++++ debian/changelog | 2 +- debian/control | 4 +- debian/rules | 33 ++++++++++---------------- debian/source/format | 2 +- 5 files changed, 23 insertions(+), 24 deletions(-) create mode 100644 debian/binutils-mingw-w64.lintian-overrides diff --git a/debian/binutils-mingw-w64.lintian-overrides b/debian/binutils-mingw-w64.lintian-overrides new file mode 100644 index 0000000..6d7a402 --- /dev/null +++ b/debian/binutils-mingw-w64.lintian-overrides @@ -0,0 +1,6 @@ +# Bugs in binutils-source +binutils-mingw-w64 binary: spelling-error-in-binary +binutils-mingw-w64 binary: manpage-has-errors-from-man + +# Watch file tracks binutils-source +debian-watch-file-in-native-package diff --git a/debian/changelog b/debian/changelog index b92d7ca..7283d00 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -binutils-mingw-w64 (2.20.1-1) unstable; urgency=low +binutils-mingw-w64 (0.1) unstable; urgency=low * Initial release (Closes: #602996). diff --git a/debian/control b/debian/control index 14212b6..f2f6db0 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: binutils-mingw-w64 Section: devel Priority: extra Maintainer: Stephen Kitt <[email protected]> -Build-Depends: debhelper (>= 7.0.50~), autotools-dev, binutils-source (>= 2.20.1~), binutils-source (<< 2.20.2~) +Build-Depends: debhelper (>= 7.0.50~), autotools-dev, binutils-source Standards-Version: 3.9.1 Homepage: http://www.gnu.org/software/binutils/ Vcs-Git: git://git.debian.org/collab-maint/binutils-mingw-w64.git @@ -10,7 +10,7 @@ Vcs-Browser: http://git.debian.org/?p=collab-maint/binutils-mingw-w64.git;a=summ Package: binutils-mingw-w64 Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, binutils (>= ${source:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, binutils (>= ${local:Version}) Conflicts: mingw32-binutils Description: Cross-binutils for Win32 and Win64 using MinGW-w64 MinGW-w64 provides a development and runtime environment for 32- and diff --git a/debian/rules b/debian/rules index 8310dd6..2075ef5 100755 --- a/debian/rules +++ b/debian/rules @@ -9,29 +9,22 @@ top_dir := $(shell pwd) binutils_dir := /usr/src/binutils upstream_dir := $(top_dir)/upstream build_dir := $(top_dir)/build -deb_version := $(shell dpkg-parsechangelog | sed -ne "s/^Version: \(.*\)/\1/p") +deb_version := $(shell dpkg-query -W -f="\$${Version}\n" binutils-source) deb_upstream_version := $(shell echo $(deb_version) | cut -d- -f1) gnu_upstream_version := $(shell echo $(deb_upstream_version) | cut -d. -f1-3) package := binutils-mingw-w64 targets := i686-w64-mingw32 x86_64-w64-mingw32 -CFLAGS = -Wall -g -# TODO Handle install with nostrip? +CFLAGS = $(shell dpkg-buildflags --get CFLAGS) +CFLAGS += -Wall -ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif -ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) - NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) - MAKEFLAGS += -j$(NUMJOBS) -endif +all: + echo $(deb_version) unpack: unpack-stamp unpack-stamp: - tar xjf $(binutils_dir)/binutils-$(gnu_upstream_version).tar.bz2 + tar xf $(binutils_dir)/binutils-$(gnu_upstream_version).tar.* rm -rf $(upstream_dir) mv binutils-$(deb_upstream_version) $(upstream_dir) touch $@ @@ -39,15 +32,14 @@ unpack-stamp: clean: dh_testdir dh_testroot - dh_clean rm -rf *-stamp $(build_dir) $(upstream_dir) $(patsubst %,debian/%-dllwrap.1,$(targets)) + dh_clean configure-stamp: unpack-stamp dh_testdir for target in $(targets); do \ - mkdir -p $(build_dir)/$$target && \ - cd $(build_dir)/$$target && \ - $(upstream_dir)/configure --prefix=/usr --disable-multilib --target=$$target; \ + dh_auto_configure -B$(build_dir)/$$target -D$(upstream_dir) -- \ + --prefix=/usr --disable-multilib --target=$$target; \ done touch $@ @@ -55,7 +47,7 @@ build: build-stamp build-stamp: configure-stamp dh_testdir for target in $(targets); do \ - cd $(build_dir)/$$target && $(MAKE) $(NUMJOBS); \ + dh_auto_build --parallel -B$(build_dir)/$$target; \ done touch $@ @@ -65,7 +57,7 @@ install-stamp: build-stamp dh_testroot dh_prep for target in $(targets); do \ - cd $(build_dir)/$$target && $(MAKE) install DESTDIR=$(top_dir)/debian/$(package); \ + dh_auto_install -B$(build_dir)/$$target; \ done # Drop files which will conflict with other packages @@ -91,11 +83,12 @@ binary-arch: build install dh_installman $(patsubst %,debian/%-dllwrap.1,$(targets)) dh_installchangelogs $(upstream_dir)/ChangeLog dh_strip + dh_lintian dh_compress dh_fixperms dh_installdeb dh_shlibdeps - dh_gencontrol + dh_gencontrol -- -v$(deb_version) -Vlocal:Version=$(deb_upstream_version) dh_md5sums dh_builddeb diff --git a/debian/source/format b/debian/source/format index 163aaf8..89ae9db 100644 --- a/debian/source/format +++ b/debian/source/format @@ -1 +1 @@ -3.0 (quilt) +3.0 (native) -- 1.7.2.3
_______________________________________________ Mailing list: https://launchpad.net/~mingw-w64 Post to : [email protected] Unsubscribe : https://launchpad.net/~mingw-w64 More help : https://help.launchpad.net/ListHelp

