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