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.inc85
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 @@
1SUMMARY = "Package maintenance system from 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
8SRC_URI_append_class-native = " file://tar-error-code.patch"
9
10DEPENDS = "zlib bzip2 perl ncurses"
11DEPENDS_class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native"
12RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} xz run-postinsts perl"
13RDEPENDS_${PN}_class-native = "xz-native"
14
15S = "${WORKDIR}/${BPN}-${PV}"
16
17PARALLEL_MAKE = ""
18
19inherit autotools gettext perlnative pkgconfig systemd
20
21python () {
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
27export PERL = "${bindir}/perl"
28PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl"
29
30export PERL_LIBDIR = "${libdir}/perl"
31PERL_LIBDIR_class-native = "${libdir}/perl-native/perl"
32
33EXTRA_OECONF = "\
34 --disable-dselect \
35 --enable-start-stop-daemon \
36 --with-zlib \
37 --with-bz2 \
38 --without-liblzma \
39 --without-selinux \
40 "
41
42EXTRA_OECONF_append_class-target = " TAR=tar"
43
44do_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
50do_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
71PROV = "virtual/update-alternatives"
72PROV_class-native = ""
73
74PROVIDES += "${PROV}"
75
76PACKAGES =+ "update-alternatives-dpkg"
77FILES_update-alternatives-dpkg = "${sbindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives"
78RPROVIDES_update-alternatives-dpkg += "update-alternatives"
79
80PACKAGES += "${PN}-perl"
81FILES_${PN}-perl = "${libdir}/perl"
82
83BBCLASSEXTEND = "native"
84
85