summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/dpkg
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/dpkg')
-rw-r--r--meta/recipes-devtools/dpkg/dpkg.inc86
-rw-r--r--meta/recipes-devtools/dpkg/dpkg/arch_pm.patch22
-rw-r--r--meta/recipes-devtools/dpkg/dpkg/check_snprintf.patch34
-rw-r--r--meta/recipes-devtools/dpkg/dpkg/check_version.patch28
-rw-r--r--meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch40
-rw-r--r--meta/recipes-devtools/dpkg/dpkg/fix-timestamps.patch21
-rw-r--r--meta/recipes-devtools/dpkg/dpkg/ignore_extra_fields.patch21
-rw-r--r--meta/recipes-devtools/dpkg/dpkg/noman.patch14
-rw-r--r--meta/recipes-devtools/dpkg/dpkg/preinst.patch51
-rw-r--r--meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch17
-rw-r--r--meta/recipes-devtools/dpkg/dpkg_1.17.1.bb16
11 files changed, 350 insertions, 0 deletions
diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
new file mode 100644
index 0000000000..b1da4fbe59
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -0,0 +1,86 @@
1DESCRIPTION = "Package maintenance system for Debian."
2LICENSE = "GPLv2.0+"
3SECTION = "base"
4
5SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.xz \
6 file://ignore_extra_fields.patch"
7
8DEPENDS = "zlib bzip2 perl ncurses"
9DEPENDS_class-native = "bzip2-native zlib-native virtual/update-alternatives-native gettext-native perl-native"
10RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} xz"
11RDEPENDS_${PN}_class-native = "xz"
12
13S = "${WORKDIR}/${BPN}-${PV}"
14
15PARALLEL_MAKE = ""
16
17inherit autotools gettext perlnative pkgconfig
18
19export PERL = "${bindir}/perl"
20PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl"
21
22export PERL_LIBDIR = "${libdir}/perl"
23PERL_LIBDIR_class-native = "${libdir}/perl-native/perl"
24
25EXTRA_OECONF = "--without-static-progs \
26 --without-dselect \
27 --with-start-stop-daemon \
28 --with-zlib \
29 --with-bz2lib \
30 --without-liblzma \
31 --without-selinux \
32 --without-sgml-doc"
33
34do_configure () {
35 echo >> ${S}/m4/compiler.m4
36 sed -i -e 's#PERL_LIBDIR=.*$#PERL_LIBDIR="${libdir}/perl"#' ${S}/configure
37 autotools_do_configure
38}
39
40DPKG_INIT_POSITION ?= "98"
41
42do_install_append () {
43 if [ "${PN}" = "dpkg-native" ]; then
44 # update-alternatives doesn't have an offline mode
45 rm ${D}${bindir}/update-alternatives
46 sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env nativeperl|' ${D}${bindir}/dpkg-*
47 else
48 mv ${D}${bindir}/update-alternatives ${D}${sbindir}
49 sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env perl|' ${D}${bindir}/dpkg-*
50 fi
51}
52
53pkg_postinst_${PN} () {
54#!/bin/sh
55if [ "x$D" != "x" ] && [ -f $D/var/lib/dpkg/status ]; then
56 install -d $D${sysconfdir}/rcS.d
57
58 # this happens at S98 where our good 'ole packages script used to run
59 echo "#!/bin/sh
60[ -e ${sysconfdir}/default/postinst ] && . ${sysconfdir}/default/postinst
61if [ \"\$POSTINST_LOGGING\" = \"1\" ]; then
62 dpkg --configure -a >\$LOGFILE 2>&1
63else
64 dpkg --configure -a
65fi
66rm -f ${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
67" > $D${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
68 chmod 0755 $D${sysconfdir}/rcS.d/S${DPKG_INIT_POSITION}run-postinsts
69fi
70}
71
72PROV = "virtual/update-alternatives"
73PROV_class-native = ""
74
75PROVIDES += "${PROV}"
76
77PACKAGES =+ "update-alternatives-dpkg"
78FILES_update-alternatives-dpkg = "${sbindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives"
79RPROVIDES_update-alternatives-dpkg += "update-alternatives"
80
81PACKAGES += "${PN}-perl"
82FILES_${PN}-perl = "${libdir}/perl"
83
84BBCLASSEXTEND = "native"
85
86
diff --git a/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch b/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch
new file mode 100644
index 0000000000..cad4c0f0a1
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch
@@ -0,0 +1,22 @@
1configure cannot determine the proper cpu, os, or
2architecture for mips64, and possibly other arch's
3because of faulty code added to Arch.pm in the latest
4release from upstream. We remove that code.
5
6Upstream-Status: Pending
7
8Signed-off-by: Joe Slater <jslater@windriver.com>
9
10
11--- a/scripts/Dpkg/Arch.pm
12+++ b/scripts/Dpkg/Arch.pm
13@@ -233,9 +233,6 @@ sub read_triplettable()
14 (my $dt = $debtriplet) =~ s/<cpu>/$_cpu/;
15 (my $da = $debarch) =~ s/<cpu>/$_cpu/;
16
17- next if exists $debarch_to_debtriplet{$da}
18- or exists $debtriplet_to_debarch{$dt};
19-
20 $debarch_to_debtriplet{$da} = $dt;
21 $debtriplet_to_debarch{$dt} = $da;
22 }
diff --git a/meta/recipes-devtools/dpkg/dpkg/check_snprintf.patch b/meta/recipes-devtools/dpkg/dpkg/check_snprintf.patch
new file mode 100644
index 0000000000..56eb0ca5be
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/check_snprintf.patch
@@ -0,0 +1,34 @@
1Upstream-Status: Inappropriate [configuration]
2
3diff -ruN dpkg-1.15.8.5-orig/m4/dpkg-funcs.m4 dpkg-1.15.8.5/m4/dpkg-funcs.m4
4--- dpkg-1.15.8.5-orig/m4/dpkg-funcs.m4 2010-10-08 12:27:15.082131611 +0800
5+++ dpkg-1.15.8.5/m4/dpkg-funcs.m4 2010-10-08 13:56:50.074284346 +0800
6@@ -27,7 +27,7 @@
7 # -----------------------
8 # Define HAVE_C99_SNPRINTF if we have C99 snprintf family semantics
9 AC_DEFUN([DPKG_FUNC_C99_SNPRINTF],
10-[AC_CACHE_CHECK([for C99 snprintf functions], [dpkg_cv_c99_snprintf],
11+[AC_CACHE_CHECK([for C99 snprintf functions], [ac_cv_func_snprintf_c99],
12 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
13 #include <stdarg.h>
14 #include <stdio.h>
15@@ -58,14 +58,14 @@
16 return 0;
17 }
18 ]])],
19- [dpkg_cv_c99_snprintf=yes],
20- [dpkg_cv_c99_snprintf=no],
21- [dpkg_cv_c99_snprintf=no])])
22-AS_IF([test "x$dpkg_cv_c99_snprintf" = "xyes"],
23+ [ac_cv_func_snprintf_c99=yes],
24+ [ac_cv_func_snprintf_c99=no],
25+ [ac_cv_func_snprintf_c99=no])])
26+AS_IF([test "x$ac_cv_func_snprintf_c99" = "xyes"],
27 [AC_DEFINE([HAVE_C99_SNPRINTF], 1,
28 [Define to 1 if the 'snprintf' family is C99 conformant])],
29 )
30-AM_CONDITIONAL(HAVE_C99_SNPRINTF, [test "x$dpkg_cv_c99_snprintf" = "xyes"])
31+AM_CONDITIONAL(HAVE_C99_SNPRINTF, [test "x$ac_cv_func_snprintf_c99" = "xyes"])
32 ])# DPKG_FUNC_C99_SNPRINTF
33
34 # DPKG_MMAP
diff --git a/meta/recipes-devtools/dpkg/dpkg/check_version.patch b/meta/recipes-devtools/dpkg/dpkg/check_version.patch
new file mode 100644
index 0000000000..3175731522
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/check_version.patch
@@ -0,0 +1,28 @@
1Adapt to linux-wrs kernel version, which has character '_' inside.
2Remove the first-char-digit-check (as the 1.15.8.5 version does).
3
4Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
5Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
6
7Upstream-Status: Inappropriate [embedded specific]
8
9Index: dpkg-1.16.8/lib/dpkg/parsehelp.c
10===================================================================
11--- dpkg-1.16.8.orig/lib/dpkg/parsehelp.c
12+++ dpkg-1.16.8/lib/dpkg/parsehelp.c
13@@ -258,14 +258,12 @@ parseversion(struct dpkg_version *rversi
14
15 /* XXX: Would be faster to use something like cisversion and cisrevision. */
16 ptr = rversion->version;
17- if (*ptr && !cisdigit(*ptr++))
18- return dpkg_put_warn(err, _("version number does not start with digit"));
19 for (; *ptr; ptr++) {
20- if (!cisdigit(*ptr) && !cisalpha(*ptr) && strchr(".-+~:", *ptr) == NULL)
21+ if (!cisdigit(*ptr) && !cisalpha(*ptr) && strchr(".-+~:_", *ptr) == NULL)
22 return dpkg_put_warn(err, _("invalid character in version number"));
23 }
24 for (ptr = rversion->revision; *ptr; ptr++) {
25- if (!cisdigit(*ptr) && !cisalpha(*ptr) && strchr(".+~", *ptr) == NULL)
26+ if (!cisdigit(*ptr) && !cisalpha(*ptr) && strchr(".-+~_", *ptr) == NULL)
27 return dpkg_put_warn(err, _("invalid character in revision number"));
28 }
diff --git a/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch b/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch
new file mode 100644
index 0000000000..e73311c294
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch
@@ -0,0 +1,40 @@
1Upstream-Status: Pending
2
3dpkg defines:
4#define DPKG_BEGIN_DECLS extern "C" {
5
6That makes header cstdlib included in a extern "C" block which is not supported
7by gcc 4.8. It fails on Fedora 19:
8
9/usr/include/c++/4.8.1/cstdlib: In function ‘long long int std::abs(long long int)’:
10/usr/include/c++/4.8.1/cstdlib:174:20: error: declaration of C function ‘long long int std::abs(long long int)’ conflicts with
11 abs(long long __x) { return __builtin_llabs (__x); }
12 ^
13/usr/include/c++/4.8.1/cstdlib:166:3: error: previous declaration ‘long int std::abs(long int)’ here
14 abs(long __i) { return __builtin_labs(__i); }
15 ^
16
17Move include gettext.h out of the extern "C" block to fix this issue.
18
19Signed-off-by: Kai Kang <kai.kang@windriver.com>
20
21--- dpkg-1.17.1/lib/dpkg/i18n.h.orig 2013-08-13 17:31:28.870935573 +0800
22+++ dpkg-1.17.1/lib/dpkg/i18n.h 2013-08-13 17:31:37.893065249 +0800
23@@ -23,8 +23,6 @@
24
25 #include <dpkg/macros.h>
26
27-DPKG_BEGIN_DECLS
28-
29 /**
30 * @defgroup i18n Internationalization support
31 * @ingroup dpkg-internal
32@@ -33,6 +31,8 @@
33
34 #include <gettext.h>
35
36+DPKG_BEGIN_DECLS
37+
38 /* We need to include this because pgettext() uses LC_MESSAGES, but libintl.h
39 * which gets pulled by gettext.h only includes it if building optimized. */
40 #include <locale.h>
diff --git a/meta/recipes-devtools/dpkg/dpkg/fix-timestamps.patch b/meta/recipes-devtools/dpkg/dpkg/fix-timestamps.patch
new file mode 100644
index 0000000000..d2cabbe065
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/fix-timestamps.patch
@@ -0,0 +1,21 @@
1The lutimes function doesn't work properly for all systems.
2
3Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
4
5Upstream-Status: Inappropriate [embedded specific]
6
7Index: dpkg-1.16.8/src/archives.c
8===================================================================
9--- dpkg-1.16.8.orig/src/archives.c
10+++ dpkg-1.16.8/src/archives.c
11@@ -440,8 +440,10 @@ tarobject_set_mtime(struct tar_entry *te
12
13 if (te->type == tar_filetype_symlink) {
14 #ifdef HAVE_LUTIMES
15+/*
16 if (lutimes(path, tv) && errno != ENOSYS)
17 ohshite(_("error setting timestamps of `%.255s'"), path);
18+*/
19 #endif
20 } else {
21 if (utimes(path, tv))
diff --git a/meta/recipes-devtools/dpkg/dpkg/ignore_extra_fields.patch b/meta/recipes-devtools/dpkg/dpkg/ignore_extra_fields.patch
new file mode 100644
index 0000000000..4e3eb97ed8
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/ignore_extra_fields.patch
@@ -0,0 +1,21 @@
1Upstream-Status: Inappropriate [workaround]
2
3Index: dpkg-1.16.8/dpkg-deb/build.c
4===================================================================
5--- dpkg-1.16.8.orig/dpkg-deb/build.c
6+++ dpkg-1.16.8/dpkg-deb/build.c
7@@ -340,13 +340,13 @@ check_new_pkg(const char *dir)
8 if (pkg->priority == pri_other)
9 warning(_("'%s' contains user-defined Priority value '%s'"),
10 controlfile, pkg->otherpriority);
11- for (field = pkg->available.arbs; field; field = field->next) {
12+ /*for (field = pkg->available.arbs; field; field = field->next) {
13 if (known_arbitrary_field(field))
14 continue;
15
16 warning(_("'%s' contains user-defined field '%s'"), controlfile,
17 field->name);
18- }
19+ }*/
20
21 free(controlfile);
diff --git a/meta/recipes-devtools/dpkg/dpkg/noman.patch b/meta/recipes-devtools/dpkg/dpkg/noman.patch
new file mode 100644
index 0000000000..d30c15018a
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/noman.patch
@@ -0,0 +1,14 @@
1Upstream-Status: Inappropriate [disable feature]
2
3diff -ruN dpkg-1.15.8.5-orig/Makefile.am dpkg-1.15.8.5/Makefile.am
4--- dpkg-1.15.8.5-orig/Makefile.am 2010-10-08 12:27:15.042083703 +0800
5+++ dpkg-1.15.8.5/Makefile.am 2010-10-08 12:27:27.755148228 +0800
6@@ -12,8 +12,7 @@
7 utils \
8 $(MAYBE_DSELECT) \
9 scripts \
10- po \
11- man
12+ po
13
14 ACLOCAL_AMFLAGS = -I m4
diff --git a/meta/recipes-devtools/dpkg/dpkg/preinst.patch b/meta/recipes-devtools/dpkg/dpkg/preinst.patch
new file mode 100644
index 0000000000..0549121ef1
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/preinst.patch
@@ -0,0 +1,51 @@
1Our pre/postinsts expect $D to be set when running in a sysroot and
2don't expect a chroot. This matches up our system expectations with
3what dpkg does.
4
5Upstream-Status: Inappropriate [OE Specific]
6
7RP 2011/12/07
8
9Index: dpkg-1.17.1/src/script.c
10===================================================================
11--- dpkg-1.17.1.orig/src/script.c
12+++ dpkg-1.17.1/src/script.c
13@@ -111,36 +111,9 @@ preexecscript(struct command *cmd)
14 size_t instdirl = strlen(instdir);
15
16 if (*instdir) {
17- if (strncmp(admindir, instdir, instdirl) != 0)
18- ohshit(_("admindir must be inside instdir for dpkg to work properly"));
19- if (setenv("DPKG_ADMINDIR", admindir + instdirl, 1) < 0)
20- ohshite(_("unable to setenv for subprocesses"));
21-
22- if (chroot(instdir))
23- ohshite(_("failed to chroot to `%.250s'"), instdir);
24- }
25- /* Switch to a known good directory to give the maintainer script
26- * a saner environment, also needed after the chroot(). */
27- if (chdir("/"))
28- ohshite(_("failed to chdir to `%.255s'"), "/");
29- if (debug_has_flag(dbg_scripts)) {
30- struct varbuf args = VARBUF_INIT;
31- const char **argv = cmd->argv;
32-
33- while (*++argv) {
34- varbuf_add_char(&args, ' ');
35- varbuf_add_str(&args, *argv);
36- }
37- varbuf_end_str(&args);
38- debug(dbg_scripts, "fork/exec %s (%s )", cmd->filename,
39- args.buf);
40- varbuf_destroy(&args);
41+ setenv("D", instdir, 1);
42 }
43- if (!instdirl)
44- return cmd->filename;
45-
46- assert(strlen(cmd->filename) >= instdirl);
47- return cmd->filename + instdirl;
48+ return cmd->filename;
49 }
50
51 /**
diff --git a/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch b/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch
new file mode 100644
index 0000000000..4f408ff777
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch
@@ -0,0 +1,17 @@
1busybox-1.19.4 tar utility doesn't support --warning=no-timestamp
2
3Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
4
5Upstream-Status: Inappropriate [configuration]
6Index: dpkg-1.17.1/dpkg-deb/extract.c
7===================================================================
8--- dpkg-1.17.1.orig/dpkg-deb/extract.c
9+++ dpkg-1.17.1/dpkg-deb/extract.c
10@@ -318,7 +318,6 @@ extracthalf(const char *debar, const cha
11
12 command_add_arg(&cmd, "-f");
13 command_add_arg(&cmd, "-");
14- command_add_arg(&cmd, "--warning=no-timestamp");
15
16 m_dup2(p2[0],0);
17 close(p2[0]);
diff --git a/meta/recipes-devtools/dpkg/dpkg_1.17.1.bb b/meta/recipes-devtools/dpkg/dpkg_1.17.1.bb
new file mode 100644
index 0000000000..525f75908b
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg_1.17.1.bb
@@ -0,0 +1,16 @@
1require dpkg.inc
2LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
3
4SRC_URI += "file://noman.patch \
5 file://check_snprintf.patch \
6 file://check_version.patch \
7 file://preinst.patch \
8 file://fix-timestamps.patch \
9 file://remove-tar-no-timestamp.patch \
10 file://fix-abs-redefine.patch \
11 file://arch_pm.patch \
12 "
13
14SRC_URI[md5sum] = "ece3ae87a099158c17bde95c0036c575"
15SRC_URI[sha256sum] = "8912ea77bc9c14297c0a340f5f461fbd212582ce814e1805d1d0436ca885e3a1"
16