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.inc81
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 0000000..eef7ce9
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -0,0 +1,81 @@
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
8DEPENDS = "zlib bzip2 perl ncurses"
9DEPENDS_class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native"
10RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} xz run-postinsts"
11RDEPENDS_${PN}_class-native = "xz-native"
12
13S = "${WORKDIR}/${BPN}-${PV}"
14
15PARALLEL_MAKE = ""
16
17inherit autotools gettext perlnative pkgconfig systemd
18
19python () {
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
25export PERL = "${bindir}/perl"
26PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl"
27
28export PERL_LIBDIR = "${libdir}/perl"
29PERL_LIBDIR_class-native = "${libdir}/perl-native/perl"
30
31EXTRA_OECONF = "\
32 --disable-dselect \
33 --enable-start-stop-daemon \
34 --with-zlib \
35 --with-bz2 \
36 --without-liblzma \
37 --without-selinux \
38 "
39
40do_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
46do_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
67PROV = "virtual/update-alternatives"
68PROV_class-native = ""
69
70PROVIDES += "${PROV}"
71
72PACKAGES =+ "update-alternatives-dpkg"
73FILES_update-alternatives-dpkg = "${sbindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives"
74RPROVIDES_update-alternatives-dpkg += "update-alternatives"
75
76PACKAGES += "${PN}-perl"
77FILES_${PN}-perl = "${libdir}/perl"
78
79BBCLASSEXTEND = "native"
80
81