Bug#229629: DEB_BUILD_OPTIONS support for noopt and nostrip
Package: dpkg
Version: 1.10.18
Severity: wishlist
Tags: patch
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
This patch implements DEB_BUILD_OPTIONS as recommended by Policy 10.1.
diff -rdbU3 dpkg-1.10.18/debian/rules dpkg-1.10.18.new/debian/rules
- --- dpkg-1.10.18/debian/rules 2003-09-19 13:29:09.000000000 -0400
+++ dpkg-1.10.18.new/debian/rules 2004-01-25 12:43:46.000000000 -0500
@@ -10,6 +10,12 @@
TMP_DPKG_DOC := $(TMP)/dpkg-doc
TMP_DSELECT := $(TMP)/dselect
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+ SPECIAL_CFLAGS := CFLAGS='-O0 -g'
+else
+ SPECIAL_CFLAGS :=
+endif
+
# We should really get this in a different way...
DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE 2> /dev/null || true)
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE 2> /dev/null || true)
@@ -47,7 +53,7 @@
$(BUILD)/configure-stamp: configure config.h.in config.guess config.sub
$(checkdir)
install -d $(@D)
- - cd $(@D) && LDFLAGS=$(LDFLAGS) $(shell echo "$(patsubst $(CURDIR)/%,%,$(@D))" | sed -e 's,^[^/][^/]*$$,..,;s,/[^/][^/]*,/..,g' )/configure \
+ cd $(@D) && LDFLAGS=$(LDFLAGS) $(SPECIAL_CFLAGS) $(shell echo "$(patsubst $(CURDIR)/%,%,$(@D))" | sed -e 's,^[^/][^/]*$$,..,;s,/[^/][^/]*,/..,g' )/configure \
--prefix=/usr \
--datadir=/usr/share \
--mandir=/usr/share/man \
@@ -150,9 +156,11 @@
# Now that dpkg has been installed, Debianize it
# Policy stuff
find $(TMP_DPKG)/usr/share/man -type f | xargs gzip -9f
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
strip --remove-section=.comment --remove-section=.note \
--strip-unneeded $(TMP_DPKG)/usr/bin/* $(TMP_DPKG)/sbin/* \
$(TMP_DPKG)/usr/lib/dpkg/enoent
+endif
mv $(TMP_DPKG)/usr/share/doc/dpkg$(static)/ChangeLog \
$(TMP_DPKG)/usr/share/doc/dpkg$(static)/changelog
@@ -274,8 +282,10 @@
find $(TMP_DSELECT)/usr/share/man -type f | xargs gzip -9f
install -d -m 755 -o root -g root $(TMP_DSELECT)/usr/share/doc
ln -s dpkg $(TMP_DSELECT)/usr/share/doc/dselect
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
strip --remove-section=.comment --remove-section=.note \
--strip-unneeded $(TMP_DSELECT)/usr/bin/*
+endif
# Final package creation
install -d -m 755 -o root -g root $(TMP_DSELECT)/DEBIAN
- -- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux bohr 2.4.22-bohr #1 SMP Fri Dec 5 08:58:30 EST 2003 i686
Locale: LANG=en_US, LC_CTYPE=en_US
Versions of packages dpkg depends on:
ii dselect 1.10.18 a user tool to manage Debian packa
ii libc6 2.3.2.ds1-10 GNU C Library: Shared libraries an
- -- no debconf information
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQFAFAiO+z+IwlXqWf4RAsevAJ4uB3XI1/Qyn+MeJhY5knOpP9Ch8gCfSWJU
K4/Z1d4Os3U4msPBcDWTSvE=
=TyMq
-----END PGP SIGNATURE-----
Reply to: