diff options
Diffstat (limited to 'meta/recipes-devtools/dpkg/dpkg.inc')
-rw-r--r-- | meta/recipes-devtools/dpkg/dpkg.inc | 81 |
1 files changed, 81 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..eef7ce9d40 --- /dev/null +++ b/meta/recipes-devtools/dpkg/dpkg.inc | |||
@@ -0,0 +1,81 @@ | |||
1 | SUMMARY = "Package maintenance system from 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-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native" | ||
10 | RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} xz run-postinsts" | ||
11 | RDEPENDS_${PN}_class-native = "xz-native" | ||
12 | |||
13 | S = "${WORKDIR}/${BPN}-${PV}" | ||
14 | |||
15 | PARALLEL_MAKE = "" | ||
16 | |||
17 | inherit autotools gettext perlnative pkgconfig systemd | ||
18 | |||
19 | python () { | ||
20 | if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): | ||
21 | pn = d.getVar('PN', True) | ||
22 | d.setVar('SYSTEMD_SERVICE_%s' % (pn), 'dpkg-configure.service') | ||
23 | } | ||
24 | |||
25 | export PERL = "${bindir}/perl" | ||
26 | PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl" | ||
27 | |||
28 | export PERL_LIBDIR = "${libdir}/perl" | ||
29 | PERL_LIBDIR_class-native = "${libdir}/perl-native/perl" | ||
30 | |||
31 | EXTRA_OECONF = "\ | ||
32 | --disable-dselect \ | ||
33 | --enable-start-stop-daemon \ | ||
34 | --with-zlib \ | ||
35 | --with-bz2 \ | ||
36 | --without-liblzma \ | ||
37 | --without-selinux \ | ||
38 | " | ||
39 | |||
40 | do_configure () { | ||
41 | echo >> ${S}/m4/compiler.m4 | ||
42 | sed -i -e 's#PERL_LIBDIR=.*$#PERL_LIBDIR="${libdir}/perl"#' ${S}/configure | ||
43 | autotools_do_configure | ||
44 | } | ||
45 | |||
46 | do_install_append () { | ||
47 | if [ "${PN}" = "dpkg-native" ]; then | ||
48 | # update-alternatives doesn't have an offline mode | ||
49 | rm ${D}${bindir}/update-alternatives | ||
50 | sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env nativeperl|' ${D}${bindir}/dpkg-* | ||
51 | else | ||
52 | mv ${D}${bindir}/update-alternatives ${D}${sbindir} | ||
53 | sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env perl|' ${D}${bindir}/dpkg-* | ||
54 | fi | ||
55 | |||
56 | if ${@base_contains('DISTRO_FEATURES','sysvinit','false','true',d)};then | ||
57 | install -d ${D}${systemd_unitdir}/system | ||
58 | install -m 0644 ${WORKDIR}/dpkg-configure.service ${D}${systemd_unitdir}/system/ | ||
59 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ | ||
60 | -e 's,@SYSCONFDIR@,${sysconfdir},g' \ | ||
61 | -e 's,@BINDIR@,${bindir},g' \ | ||
62 | -e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \ | ||
63 | ${D}${systemd_unitdir}/system/dpkg-configure.service | ||
64 | fi | ||
65 | } | ||
66 | |||
67 | PROV = "virtual/update-alternatives" | ||
68 | PROV_class-native = "" | ||
69 | |||
70 | PROVIDES += "${PROV}" | ||
71 | |||
72 | PACKAGES =+ "update-alternatives-dpkg" | ||
73 | FILES_update-alternatives-dpkg = "${sbindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives" | ||
74 | RPROVIDES_update-alternatives-dpkg += "update-alternatives" | ||
75 | |||
76 | PACKAGES += "${PN}-perl" | ||
77 | FILES_${PN}-perl = "${libdir}/perl" | ||
78 | |||
79 | BBCLASSEXTEND = "native" | ||
80 | |||
81 | |||