Package: dpkg
Version: 1.14.22
Severity: important
Tags: patch
Hi,
as suggested on irc here is a patch that adds a makefile fragment to
dpkg for inclusion by other sources in debian/rules.
Currently the environment will only be setup if dpkg-buildpackage is
called but not if debian/rules is invoked directly. The goal of the
makefile fragment is to consistently set up the environment with some
default variables no matter how debian/rules is called. For this all
sources will have to include that fragment in debian/rules bevor they
can rely on the environment being setup automatically.
For now the variables normaly set by dpkg-buildpackage (CFLAGS,
CPPFLAGS, LDFLAGS, FFLAGS, CXXFLAGS) and DEB_VENDOR are set and
exported. A further patch for squeeze will introduce a dpkg-vendor
utility and set DEB_BUILD_OPTIONS to vendor specific values if unset.
See later bug for details.
I tagged this as important as it is a minimal change ment for lenny so
that squeeze sources can unconditionally use the makefile fragment.
MfG
Goswin
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (400, 'unstable-i386')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.25-kvm-nofb (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash
Versions of packages dpkg depends on:
ii coreutils 6.10-6 The GNU core utilities
ii libc6 2.7-12 GNU C Library: Shared libraries
ii lzma 4.43-14 Compression method of 7z format in
dpkg recommends no packages.
Versions of packages dpkg suggests:
ii apt 0.7.14+b1 Advanced front-end for dpkg
-- no debconf information
diff -Nru dpkg-1.14.22/debian/changelog dpkg-1.14.23/debian/changelog
--- dpkg-1.14.22/debian/changelog 2008-09-05 16:55:04.000000000 +0200
+++ dpkg-1.14.23/debian/changelog 2008-09-09 12:19:54.000000000 +0200
@@ -1,3 +1,10 @@
+dpkg (1.14.23) unstable; urgency=low
+
+ [ Goswin von Brederlow ]
+ * Add /usr/share/dpkg/Makefile.dpkg for default environment setup.
+
+ -- Goswin von Brederlow <[EMAIL PROTECTED]> Tue, 09 Sep 2008 12:18:43 +0200
+
dpkg (1.14.22) unstable; urgency=low
[ Raphael Hertzog ]
diff -Nru dpkg-1.14.22/debian/dpkg-dev.install dpkg-1.14.23/debian/dpkg-dev.install
--- dpkg-1.14.22/debian/dpkg-dev.install 2008-07-01 19:07:54.000000000 +0200
+++ dpkg-1.14.23/debian/dpkg-dev.install 2008-09-09 12:30:54.000000000 +0200
@@ -16,6 +16,7 @@
usr/bin/dpkg-shlibdeps
usr/bin/dpkg-source
usr/lib/dpkg/parsechangelog
+usr/share/dpkg/Makefile.dpkg
usr/share/locale/*/LC_MESSAGES/dpkg-dev.mo
usr/share/man/*/*/822-date.1
usr/share/man/*/822-date.1
diff -Nru dpkg-1.14.22/scripts/Makefile.am dpkg-1.14.23/scripts/Makefile.am
--- dpkg-1.14.22/scripts/Makefile.am 2008-08-26 15:52:08.000000000 +0200
+++ dpkg-1.14.23/scripts/Makefile.am 2008-09-09 12:40:55.000000000 +0200
@@ -24,6 +24,8 @@
dpkg-statoverride \
update-alternatives
+dist_pkgdata_DATA = Makefile.dpkg
+
changelogdir = $(pkglibdir)/parsechangelog
changelog_SCRIPTS = \
changelog/debian
diff -Nru dpkg-1.14.22/scripts/Makefile.dpkg dpkg-1.14.23/scripts/Makefile.dpkg
--- dpkg-1.14.22/scripts/Makefile.dpkg 1970-01-01 01:00:00.000000000 +0100
+++ dpkg-1.14.23/scripts/Makefile.dpkg 2008-09-09 13:06:38.000000000 +0200
@@ -0,0 +1,41 @@
+#! /usr/bin/make
+#
+# Makefile.dpkg
+#
+# Copyright © 2008 Goswin von Brederlow <[EMAIL PROTECTED]>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+# This file should be included by every source and sets up some default
+# environment variables if they are unset
+
+vendor = $(shell if [ -r /etc/dpkg/origins/default ]; then cat /etc/dpkg/origins/default; else echo debian; fi )
+DEB_VENDOR ?= $(shell grep "^Vendor: " /etc/dpkg/origins/$(vendor) | cut -d" " -f2-)
+
+export DEB_VENDOR
+
+
+ifeq ($(findstring noopt,$(DEB_BUILD_OPTIONS)),)
+CFLAGS ?= -g -O2
+else
+CFLAGS ?= -g -O0
+endif
+CPPFLAGS ?=
+LDFLAGS ?=
+FFLAGS ?= $(CFLAGS)
+CXXFLAGS ?= $(CFLAGS)
+
+export CFLAGS CPPFLAGS LDFLAGS FFLAGS CXXFLAGS
+
diff -Nru dpkg-1.14.22/scripts/Makefile.in dpkg-1.14.23/scripts/Makefile.in
--- dpkg-1.14.22/scripts/Makefile.in 2008-09-05 17:02:10.000000000 +0200
+++ dpkg-1.14.23/scripts/Makefile.in 2008-09-09 12:41:38.000000000 +0200
@@ -35,8 +35,8 @@
host_triplet = @host@
target_triplet = @target@
subdir = scripts
-DIST_COMMON = $(nobase_dist_perllib_DATA) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in
+DIST_COMMON = $(dist_pkgdata_DATA) $(nobase_dist_perllib_DATA) \
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
$(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/funcs.m4 \
@@ -53,7 +53,8 @@
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(changelogdir)" \
- "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(perllibdir)"
+ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(pkgdatadir)" \
+ "$(DESTDIR)$(perllibdir)"
binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
changelogSCRIPT_INSTALL = $(INSTALL_SCRIPT)
sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
@@ -73,8 +74,9 @@
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+dist_pkgdataDATA_INSTALL = $(INSTALL_DATA)
nobase_dist_perllibDATA_INSTALL = $(install_sh_DATA)
-DATA = $(nobase_dist_perllib_DATA)
+DATA = $(dist_pkgdata_DATA) $(nobase_dist_perllib_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
ETAGS = etags
@@ -231,6 +233,7 @@
dpkg-statoverride \
update-alternatives
+dist_pkgdata_DATA = Makefile.dpkg
changelogdir = $(pkglibdir)/parsechangelog
changelog_SCRIPTS = \
changelog/debian
@@ -427,6 +430,23 @@
echo " rm -f '$(DESTDIR)$(sbindir)/$$f'"; \
rm -f "$(DESTDIR)$(sbindir)/$$f"; \
done
+install-dist_pkgdataDATA: $(dist_pkgdata_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
+ @list='$(dist_pkgdata_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(dist_pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ $(dist_pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \
+ done
+
+uninstall-dist_pkgdataDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_pkgdata_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
+ done
install-nobase_dist_perllibDATA: $(nobase_dist_perllib_DATA)
@$(NORMAL_INSTALL)
test -z "$(perllibdir)" || $(MKDIR_P) "$(DESTDIR)$(perllibdir)"
@@ -625,7 +645,7 @@
all-am: Makefile $(SCRIPTS) $(DATA) all-local
installdirs: installdirs-recursive
installdirs-am:
- for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(changelogdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(perllibdir)"; do \
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(changelogdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(perllibdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
@@ -672,7 +692,7 @@
info-am:
install-data-am: install-changelogSCRIPTS install-data-local \
- install-nobase_dist_perllibDATA
+ install-dist_pkgdataDATA install-nobase_dist_perllibDATA
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-data-hook
@@ -710,8 +730,8 @@
ps-am:
uninstall-am: uninstall-binSCRIPTS uninstall-changelogSCRIPTS \
- uninstall-local uninstall-nobase_dist_perllibDATA \
- uninstall-sbinSCRIPTS
+ uninstall-dist_pkgdataDATA uninstall-local \
+ uninstall-nobase_dist_perllibDATA uninstall-sbinSCRIPTS
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
install-data-am install-strip
@@ -722,17 +742,18 @@
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-binSCRIPTS install-changelogSCRIPTS \
install-data install-data-am install-data-hook \
- install-data-local install-dvi install-dvi-am install-exec \
- install-exec-am install-exec-local install-html \
- install-html-am install-info install-info-am install-man \
- install-nobase_dist_perllibDATA install-pdf install-pdf-am \
- install-ps install-ps-am install-sbinSCRIPTS install-strip \
- installcheck installcheck-am installdirs installdirs-am \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \
- uninstall uninstall-am uninstall-binSCRIPTS \
- uninstall-changelogSCRIPTS uninstall-local \
- uninstall-nobase_dist_perllibDATA uninstall-sbinSCRIPTS
+ install-data-local install-dist_pkgdataDATA install-dvi \
+ install-dvi-am install-exec install-exec-am install-exec-local \
+ install-html install-html-am install-info install-info-am \
+ install-man install-nobase_dist_perllibDATA install-pdf \
+ install-pdf-am install-ps install-ps-am install-sbinSCRIPTS \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \
+ tags-recursive uninstall uninstall-am uninstall-binSCRIPTS \
+ uninstall-changelogSCRIPTS uninstall-dist_pkgdataDATA \
+ uninstall-local uninstall-nobase_dist_perllibDATA \
+ uninstall-sbinSCRIPTS
%: %.pl Makefile