summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/dpkg/dpkg.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/dpkg/dpkg.inc')
-rw-r--r--meta/recipes-devtools/dpkg/dpkg.inc86
1 files changed, 86 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