diff --git a/debian/changelog b/debian/changelog
index 7d48dd6..7031806 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,22 @@
+dpkg (1.14.23.inkpump1) asimov; urgency=low
+
+ * Inkpump build.
+ - Section adjusted
+ - Maintainer adjusted
+ - Vcs-* adjusted
+ - /etc/dpkg/origins/inkpump added
+ * On-device (target) version added.
+ - dpkg localization disabled
+ - dselect and dpkg-dev disabled
+ * Using quilt for patches
+ * uclibc architectures added
+ * cross-shell support added
+ * dpkg-buildpackage no longer disables dependencies check on
+ cross-compilation
+ * Cross-compilation configure fixes
+
+ -- Mikhail Gusarov <dottedmag@dottedmag.net> Sat, 27 Dec 2008 18:34:56 +0600
+
dpkg (1.14.23) unstable; urgency=low
[ Raphael Hertzog ]
diff --git a/debian/control b/debian/control
index aefb2dd..38b6daf 100644
--- a/debian/control
+++ b/debian/control
@@ -1,19 +1,18 @@
+# Warning: this file will be replaced during cross-build by the one from in/ directory.
Source: dpkg
-Section: admin
+Section: host-tools
Priority: required
-Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
-Uploaders: Frank Lichtenheld <djpig@debian.org>,
- Guillem Jover <guillem@debian.org>, Raphael Hertzog <hertzog@debian.org>
-Origin: debian
-Bugs: debbugs://bugs.debian.org
+Maintainer: Mikhail Gusarov <dottedmag@dottedmag.net>
Homepage: http://wiki.debian.org/Teams/Dpkg
-Vcs-Browser: http://git.debian.org/?p=dpkg/dpkg.git
-Vcs-Git: git://git.debian.org/git/dpkg/dpkg.git
-Standards-Version: 3.7.3
+Origin: Inkpump
+Bugs: trac://inkpump.org/
+Vcs-Browser: http://git.inkpump.org/dpkg.git/
+Vcs-Git: git://git.inkpump.org/dpkg.git
+Standards-Version: 3.8.0
Build-Depends: debhelper (>= 4.1.81), pkg-config, po4a (>= 0.33.1),
libncursesw5-dev, zlib1g-dev (>= 1:1.1.3-19.1), libbz2-dev, flex,
libselinux1-dev (>= 1.28-4) [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64],
- libtimedate-perl, libio-string-perl
+ libtimedate-perl, libio-string-perl, quilt, autoconf, automake, cvs
Package: dpkg
Architecture: any
@@ -28,9 +27,11 @@ Description: Debian package management system
installation and removal of Debian software packages.
.
For Debian package development tools, install dpkg-dev.
+ .
+ This package is modified by Inkpump to support uclibc architectures and
+ cross-compilation.
Package: dpkg-dev
-Section: utils
Priority: optional
Architecture: all
Depends: dpkg (>= 1.14.6), perl5, perl-modules, cpio (>= 2.4.2-2), bzip2, lzma,
@@ -45,6 +46,9 @@ Description: Debian package development tools
.
Most Debian source packages will require additional tools to build;
for example, most packages need make and the C compiler gcc.
+ .
+ This package is modified by Inkpump to support uclibc architectures and
+ cross-compilation.
Package: dselect
Priority: optional
@@ -57,3 +61,6 @@ Description: Debian package management front-end
.
Many users find dselect intimidating and new users may prefer to use
apt-based user interfaces.
+ .
+ This package is modified by Inkpump to support uclibc architectures and
+ cross-compilation.
diff --git a/debian/copyright b/debian/copyright
index c2a36c7..ce86cec 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -29,6 +29,11 @@ Copyright © 1994 Carl Streeter <streeter@cae.wisc.edu>
Copyright © 1994 Matt Welsh <mdw@sunsite.unc.edu>
Copyright © 1994 Ian Murdock <imurdock@debian.org>
+Includes Slind patches and packaging Copyright © 2005-2006 Siemens AG.
+Includes Inkpump patches and packaging:
+Copyright © 2007-2008 Mikhail Gusarov <dottedmag@openinkpot.org>
+Copyright © 2008 Oleg Leschinsky <helge@openinkpot.org>
+
Includes public domain MD5 code:
lib/md5.c and lib/md5.h originally written by Colin Plumb,
diff --git a/debian/in/control b/debian/in/control
new file mode 100644
index 0000000..3415edf
--- /dev/null
+++ b/debian/in/control
@@ -0,0 +1,33 @@
+Source: dpkg
+Section: core
+Priority: required
+Maintainer: Mikhail Gusarov <dottedmag@dottedmag.net>
+Homepage: http://wiki.debian.org/Teams/Dpkg
+Vcs-Browser: http://git.inkpump.org/dpkg.git/
+Vcs-Git: git://git.inkpump.org/dpkg.git
+Standards-Version: 3.8.0
+Build-Depends: debhelper (>= 4.1.81), pkg-config, po4a (>= 0.33.1),
+ libncursesw5-dev, zlib1g-dev (>= 1:1.1.3-19.1), libbz2-dev, flex,
+ libselinux1-dev (>= 1.28-4) [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64],
+ libtimedate-perl, libio-string-perl, quilt
+
+Package: dpkg
+Architecture: any
+Pre-Depends: ${shlibs:Depends}, coreutils (>= 5.93-1)
+Suggests: apt
+Description: Debian package management system
+ This package privides the low-level infrastructure for handling the
+ installation and removal of Debian software packages.
+ .
+ This package is modified by Inkpump to support uclibc architectures and
+ cross-compilation.
+
+Package: start-stop-daemon
+Architecture: any
+Pre-Depends: ${shlibs:Depends}, coreutils (>= 5.93-1)
+Description: Utility to start and stop system daemon programs
+ start-stop-daemon is used to control the creation and termination of
+ system-level processes.
+ .
+ This tool is packaged separately from dpkg in Inkpump to avoid circular
+ dependencies.
diff --git a/debian/in/dpkg.install b/debian/in/dpkg.install
new file mode 100644
index 0000000..79160a0
--- /dev/null
+++ b/debian/in/dpkg.install
@@ -0,0 +1,19 @@
+../dpkg.cfg etc/dpkg
+../archtable usr/share/dpkg
+
+etc/alternatives
+etc/dpkg/origins
+usr/bin/dpkg
+usr/bin/dpkg-deb
+usr/bin/dpkg-query
+usr/bin/dpkg-trigger
+usr/sbin/dpkg-divert
+usr/sbin/dpkg-statoverride
+usr/sbin/update-alternatives
+usr/share/dpkg
+usr/share/perl5/Dpkg.pm
+usr/share/perl5/Dpkg/Gettext.pm
+var/lib/dpkg/alternatives
+var/lib/dpkg/info
+var/lib/dpkg/parts
+var/lib/dpkg/updates
diff --git a/debian/patches/01-uclibc-architectures.patch b/debian/patches/01-uclibc-architectures.patch
new file mode 100644
index 0000000..3faac48
--- /dev/null
+++ b/debian/patches/01-uclibc-architectures.patch
@@ -0,0 +1,20 @@
+Index: dpkg/ostable
+===================================================================
+--- dpkg.orig/ostable 2008-12-27 03:02:11.000000000 +0600
++++ dpkg/ostable 2008-12-27 03:02:33.000000000 +0600
+@@ -25,3 +25,5 @@
+ bsd-netbsd netbsd netbsd[^-]*
+ bsd-openbsd openbsd openbsd[^-]*
+ sysv-solaris solaris solaris[^-]*
++uclibc-linux linux-uclibc linux[^-]*-uclibc
++uclibceabi-linux linux-uclibceabi linux[^-]*-uclibceabi
+Index: dpkg/triplettable
+===================================================================
+--- dpkg.orig/triplettable 2008-12-27 03:02:11.000000000 +0600
++++ dpkg/triplettable 2008-12-27 03:02:27.000000000 +0600
+@@ -14,3 +14,5 @@
+ bsd-netbsd-<cpu> netbsd-<cpu>
+ bsd-darwin-<cpu> darwin-<cpu>
+ sysv-solaris-<cpu> solaris-<cpu>
++uclibc-linux-<cpu> uclibc-<cpu>
++uclibceabi-linux-arm uclibc-armel
diff --git a/debian/patches/02-cross-shell-architecture-override.patch b/debian/patches/02-cross-shell-architecture-override.patch
new file mode 100644
index 0000000..3cd9938
--- /dev/null
+++ b/debian/patches/02-cross-shell-architecture-override.patch
@@ -0,0 +1,40 @@
+cross-shell uses black magic to run binaries from host architecture on rootfs
+prepared for target one. This patch removes the dpkg assumption that the build
+architecture is the runtime one.
+
+Index: dpkg/src/main.c
+===================================================================
+--- dpkg.orig/src/main.c 2008-12-27 03:07:25.000000000 +0600
++++ dpkg/src/main.c 2008-12-27 03:09:04.000000000 +0600
+@@ -142,7 +142,7 @@
+ }
+
+ const char thisname[]= "dpkg";
+-const char architecture[]= ARCHITECTURE;
++char *architecture;
+ const char printforhelp[]= N_(
+ "Type dpkg --help for help about installing and deinstalling packages [*];\n"
+ "Use `dselect' or `aptitude' for user-friendly package management;\n"
+@@ -623,6 +623,9 @@
+ int main(int argc, const char *const *argv) {
+ jmp_buf ejbuf;
+ static void (*actionfunction)(const char *const *argv);
++ char *cross_shell_arch = getenv("CROSS_SHELL_ARCH");
++
++ architecture = strdup(cross_shell_arch ? cross_shell_arch : ARCHITECTURE);
+
+ standard_startup(&ejbuf, argc, &argv, DPKG, 1, cmdinfos);
+ if (!cipaction) badusage(_("need an action option"));
+Index: dpkg/src/main.h
+===================================================================
+--- dpkg.orig/src/main.h 2008-12-27 03:07:21.000000000 +0600
++++ dpkg/src/main.h 2008-12-27 03:08:02.000000000 +0600
+@@ -107,7 +107,7 @@
+ extern const char *admindir;
+ extern const char *instdir;
+ extern struct packageinlist *ignoredependss;
+-extern const char architecture[];
++extern char *architecture;
+
+ /* from filesdb.c */
+
diff --git a/debian/patches/03-dpkg-buildpackage-always-check-builddeps.patch b/debian/patches/03-dpkg-buildpackage-always-check-builddeps.patch
new file mode 100644
index 0000000..6f4652c
--- /dev/null
+++ b/debian/patches/03-dpkg-buildpackage-always-check-builddeps.patch
@@ -0,0 +1,21 @@
+Index: dpkg/scripts/dpkg-buildpackage.pl
+===================================================================
+--- dpkg.orig/scripts/dpkg-buildpackage.pl 2008-12-27 03:10:16.000000000 +0600
++++ dpkg/scripts/dpkg-buildpackage.pl 2008-12-27 03:10:28.000000000 +0600
+@@ -49,7 +49,7 @@
+ -spgp the sign-command is called like PGP.
+ -us unsigned source.
+ -uc unsigned changes.
+- -a<arch> Debian architecture we build for (implies -d).
++ -a<arch> Debian architecture we build for.
+ -b binary-only, do not build source. } also passed to
+ -B binary-only, no arch-indep files. } dpkg-genchanges
+ -A binary-only, only arch-indep files. }
+@@ -134,7 +134,6 @@
+ $usepause = 1;
+ } elsif (/^-a(.*)$/) {
+ $targetarch = $1;
+- $checkbuilddep = 0;
+ } elsif (/^-s[iad]$/) {
+ $sourcestyle = $_;
+ } elsif (/^-s[nsAkurKUR]$/) {
diff --git a/debian/patches/04-disable-dpkg-localization.patch b/debian/patches/04-disable-dpkg-localization.patch
new file mode 100644
index 0000000..c75d5f9
--- /dev/null
+++ b/debian/patches/04-disable-dpkg-localization.patch
@@ -0,0 +1,25 @@
+Index: dpkg/debian/dpkg.install
+===================================================================
+--- dpkg.orig/debian/dpkg.install 2008-12-28 02:42:50.000000000 +0600
++++ dpkg/debian/dpkg.install 2008-12-28 02:43:02.000000000 +0600
+@@ -11,7 +11,6 @@
+ usr/lib/dpkg/mksplit
+ usr/sbin
+ usr/share/dpkg
+-usr/share/locale/*/LC_MESSAGES/dpkg.mo
+ usr/share/man/*/*/cleanup-info.8
+ usr/share/man/*/cleanup-info.8
+ usr/share/man/*/*/dpkg-deb.1
+Index: dpkg/man/Makefile.am
+===================================================================
+--- dpkg.orig/man/Makefile.am 2008-12-28 02:43:04.000000000 +0600
++++ dpkg/man/Makefile.am 2008-12-28 02:43:12.000000000 +0600
+@@ -7,8 +7,6 @@
+
+ # FIXME: Use a stamp file until po4a supports them internally.
+ man.stamp:
+- po4a --no-backups --variable srcdir=$(srcdir) \
+- $(srcdir)/po/po4a.cfg
+ touch $@
+
+ clean-local: clean-local-@USE_NLS@
diff --git a/debian/patches/05-fix-va-copy-test-for-crosscompilation.patch b/debian/patches/05-fix-va-copy-test-for-crosscompilation.patch
new file mode 100644
index 0000000..fd754b2
--- /dev/null
+++ b/debian/patches/05-fix-va-copy-test-for-crosscompilation.patch
@@ -0,0 +1,13 @@
+Index: dpkg/m4/funcs.m4
+===================================================================
+--- dpkg.orig/m4/funcs.m4 2008-12-27 03:34:07.000000000 +0600
++++ dpkg/m4/funcs.m4 2008-12-27 03:35:13.000000000 +0600
+@@ -5,7 +5,7 @@
+ # Define HAVE_VA_COPY if we have va_copy, fail if they can't be assigned
+ AC_DEFUN([DPKG_FUNC_VA_COPY],
+ [AC_CACHE_CHECK([for va_copy], [dpkg_cv_va_copy],
+-[AC_TRY_RUN(
++[AC_COMPILE_IFELSE(
+ [#include <stdarg.h>
+ main() {
+ va_list v1, v2;
diff --git a/debian/patches/06-inkpump-origin-file.patch b/debian/patches/06-inkpump-origin-file.patch
new file mode 100644
index 0000000..507ca7b
--- /dev/null
+++ b/debian/patches/06-inkpump-origin-file.patch
@@ -0,0 +1,21 @@
+Index: dpkg/origins/Makefile.am
+===================================================================
+--- dpkg.orig/origins/Makefile.am 2008-12-28 01:04:53.000000000 +0600
++++ dpkg/origins/Makefile.am 2008-12-28 02:25:47.000000000 +0600
+@@ -3,7 +3,7 @@
+ pkgconfdir = $(sysconfdir)/@PACKAGE@
+ originsdir = $(pkgconfdir)/origins
+
+-dist_origins_DATA = debian
++dist_origins_DATA = debian inkpump
+
+
+ install-data-local:
+Index: dpkg/origins/inkpump
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ dpkg/origins/inkpump 2008-12-28 02:26:27.000000000 +0600
+@@ -0,0 +1,3 @@
++Vendor: Inkpump
++Vendor-URL: http://inkpump.org/
++Bugs: trac://inkpump.org/
diff --git a/debian/patches/07-deb_build_options_target.patch b/debian/patches/07-deb_build_options_target.patch
new file mode 100644
index 0000000..7363c7e
--- /dev/null
+++ b/debian/patches/07-deb_build_options_target.patch
@@ -0,0 +1,16 @@
+Index: dpkg/scripts/dpkg-buildpackage.pl
+===================================================================
+--- dpkg.orig/scripts/dpkg-buildpackage.pl 2008-12-28 01:03:41.000000000 +0600
++++ dpkg/scripts/dpkg-buildpackage.pl 2008-12-28 01:03:41.000000000 +0600
+@@ -252,6 +252,11 @@
+ $ENV{MAKEFLAGS} .= " -j$parallel";
+ }
+ $build_opts->{parallel} = $parallel;
++}
++if ($targetarch) {
++ $build_opts->{target} = '';
++}
++if ($parallel || $targetarch) {
+ Dpkg::BuildOptions::set($build_opts);
+ }
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..73afcc8
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,7 @@
+01-uclibc-architectures.patch
+02-cross-shell-architecture-override.patch
+03-dpkg-buildpackage-always-check-builddeps.patch
+04-disable-dpkg-localization.patch
+05-fix-va-copy-test-for-crosscompilation.patch
+06-inkpump-origin-file.patch
+07-deb_build_options_target.patch
diff --git a/debian/rules b/debian/rules
index cccd7d6..b5a6bc5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,6 +2,8 @@
# debian/rules for the dpkg suite.
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>
+include /usr/share/quilt/quilt.make
+
WFLAGS := -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers
CFLAGS = -g $(WFLAGS)
@@ -15,7 +17,11 @@ else
CFLAGS += -O2
CXXFLAGS += -O2
endif
-
+# Enable parallel builds
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ MAKEFLAGS += -j$(NUMJOBS)
+endif
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
@@ -30,13 +36,17 @@ endif
# Don't enable everything on all platforms
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
-ifeq ($(DEB_HOST_ARCH_OS),linux)
+ifeq (,$(findstring target,$(DEB_BUILD_OPTIONS)))
+ ifeq ($(DEB_HOST_ARCH_OS),linux)
confflags += --with-selinux=static
+ endif
+else
+ confflags += --disable-dselect
endif
# Create configure script if necessary, automake handles rebuilding it.
-configure:
+configure: patch
dh_testdir
autoreconf -v -i
@@ -70,6 +80,12 @@ ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
cd build-tree && $(MAKE) check
endif
+control:
+ dh_testdir
+ifneq (,$(findstring target,$(DEB_BUILD_OPTIONS)))
+ cp -f debian/in/* debian
+endif
+
# Install the package underneath debian/tmp
install: check
dh_testdir
@@ -79,27 +95,46 @@ install: check
cd build-tree && $(MAKE) DESTDIR="$(CURDIR)/debian/tmp" install
+ifneq (,$(findstring target,$(DEB_BUILD_OPTIONS)))
+ rm $(CURDIR)/debian/tmp/etc/alternatives/README
+ rm $(CURDIR)/debian/tmp/etc/origins/debian
+endif
+
# Put together the dpkg and dselect packages
-binary-arch: install
+binary-arch: control install
dh_testdir -a
dh_testroot -a
+
dh_install --sourcedir=debian/tmp -a
+ifeq (,$(findstring target,$(DEB_BUILD_OPTIONS)))
dh_installlogrotate -a
+endif
+ifeq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
install -d debian/dpkg/sbin
mv debian/dpkg/usr/sbin/start-stop-daemon debian/dpkg/sbin
+else
+ install -d debian/start-stop-daemon/sbin
+ mv debian/dpkg/usr/sbin/start-stop-daemon debian/start-stop-daemon/sbin
+endif
+ifneq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
dh_installchangelogs -a ChangeLog
dh_installdocs -a
+endif
+ifeq (,$(findstring target, $(DEB_BUILD_OPTIONS)))
install -d debian/dpkg/usr/share/lintian/overrides
install -m 644 debian/dpkg.lintian-overrides \
debian/dpkg/usr/share/lintian/overrides/dpkg
install -d debian/dselect/usr/share/lintian/overrides
install -m 644 debian/dselect.lintian-overrides \
debian/dselect/usr/share/lintian/overrides/dselect
+endif
+ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
dh_strip -a
+endif
dh_compress -a
dh_fixperms -a
dh_installdeb -a
@@ -109,19 +144,23 @@ binary-arch: install
dh_builddeb -a
# Put together the dpkg-dev package
-binary-indep: install
+binary-indep: control install
dh_testdir -i
dh_testroot -i
dh_install --sourcedir=debian/tmp -i -XDpkg/Gettext.pm
+ifneq (,$(findstring nodocs,$(DEB_BUILD_OPTIONS)))
dh_installchangelogs -i ChangeLog
dh_installdocs -i
+endif
install -d debian/dpkg-dev/usr/share/lintian/overrides
install -m 644 debian/dpkg-dev.lintian-overrides \
debian/dpkg-dev/usr/share/lintian/overrides/dpkg-dev
+ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
dh_strip -i
+endif
dh_compress -i
dh_fixperms -i
dh_installdeb -i
@@ -133,11 +172,13 @@ binary: binary-arch binary-indep
# Clean up the mess we made
-clean:
+clean: clean-tree unpatch
+
+clean-tree:
dh_testdir
rm -rf build-tree
dh_clean
-.PHONY: build check install binary-arch binary-indep binary clean
+.PHONY: build check control install binary-arch binary-indep binary clean