diff options
Diffstat (limited to 'meta/recipes-devtools/dpkg/dpkg.inc')
-rw-r--r-- | meta/recipes-devtools/dpkg/dpkg.inc | 86 |
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 @@ | |||
1 | DESCRIPTION = "Package maintenance system for Debian." | ||
2 | LICENSE = "GPLv2.0+" | ||
3 | SECTION = "base" | ||
4 | |||
5 | SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.xz \ | ||
6 | file://ignore_extra_fields.patch" | ||
7 | |||
8 | DEPENDS = "zlib bzip2 perl ncurses" | ||
9 | DEPENDS_class-native = "bzip2-native zlib-native virtual/update-alternatives-native gettext-native perl-native" | ||
10 | RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} xz" | ||
11 | RDEPENDS_${PN}_class-native = "xz" | ||
12 | |||
13 | S = "${WORKDIR}/${BPN}-${PV}" | ||
14 | |||
15 | PARALLEL_MAKE = "" | ||
16 | |||
17 | inherit autotools gettext perlnative pkgconfig | ||
18 | |||
19 | export PERL = "${bindir}/perl" | ||
20 | PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl" | ||
21 | |||
22 | export PERL_LIBDIR = "${libdir}/perl" | ||
23 | PERL_LIBDIR_class-native = "${libdir}/perl-native/perl" | ||
24 | |||
25 | EXTRA_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 | |||
34 | do_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 | |||
40 | DPKG_INIT_POSITION ?= "98" | ||
41 | |||
42 | do_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 | |||
53 | pkg_postinst_${PN} () { | ||
54 | #!/bin/sh | ||
55 | if [ "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 | ||
61 | if [ \"\$POSTINST_LOGGING\" = \"1\" ]; then | ||
62 | dpkg --configure -a >\$LOGFILE 2>&1 | ||
63 | else | ||
64 | dpkg --configure -a | ||
65 | fi | ||
66 | rm -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 | ||
69 | fi | ||
70 | } | ||
71 | |||
72 | PROV = "virtual/update-alternatives" | ||
73 | PROV_class-native = "" | ||
74 | |||
75 | PROVIDES += "${PROV}" | ||
76 | |||
77 | PACKAGES =+ "update-alternatives-dpkg" | ||
78 | FILES_update-alternatives-dpkg = "${sbindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives" | ||
79 | RPROVIDES_update-alternatives-dpkg += "update-alternatives" | ||
80 | |||
81 | PACKAGES += "${PN}-perl" | ||
82 | FILES_${PN}-perl = "${libdir}/perl" | ||
83 | |||
84 | BBCLASSEXTEND = "native" | ||
85 | |||
86 | |||