blob: e8d8a9b4f7210cdb41bf61c5bee44dd580ea4c77 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Package maintenance system from Debian"
2LICENSE = "GPLv2.0+"
3SECTION = "base"
4
Patrick Williamsc124f4f2015-09-15 14:41:29 -05005DEPENDS = "zlib bzip2 perl ncurses"
6DEPENDS_class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native"
7RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} xz run-postinsts perl"
8RDEPENDS_${PN}_class-native = "xz-native"
9
Patrick Williamsc0f7c042017-02-23 20:41:17 -060010UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/d/dpkg/"
11
Patrick Williamsc124f4f2015-09-15 14:41:29 -050012inherit autotools gettext perlnative pkgconfig systemd
13
14python () {
15 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
16 pn = d.getVar('PN', True)
17 d.setVar('SYSTEMD_SERVICE_%s' % (pn), 'dpkg-configure.service')
18}
19
20export PERL = "${bindir}/perl"
21PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl"
22
23export PERL_LIBDIR = "${libdir}/perl"
24PERL_LIBDIR_class-native = "${libdir}/perl-native/perl"
25
26EXTRA_OECONF = "\
27 --disable-dselect \
28 --enable-start-stop-daemon \
29 --with-zlib \
30 --with-bz2 \
31 --without-liblzma \
32 --without-selinux \
33 "
34
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050035EXTRA_OECONF += "TAR=tar"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060036EXTRA_OECONF_append_class-target = " DEB_HOST_ARCH=${DPKG_ARCH}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050037
38do_configure () {
39 echo >> ${S}/m4/compiler.m4
40 sed -i -e 's#PERL_LIBDIR=.*$#PERL_LIBDIR="${libdir}/perl"#' ${S}/configure
41 autotools_do_configure
42}
43
44do_install_append () {
45 if [ "${PN}" = "dpkg-native" ]; then
46 # update-alternatives doesn't have an offline mode
47 rm ${D}${bindir}/update-alternatives
48 sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env nativeperl|' ${D}${bindir}/dpkg-*
49 else
50 sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env perl|' ${D}${bindir}/dpkg-*
51 fi
52
53 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)};then
54 install -d ${D}${systemd_unitdir}/system
55 install -m 0644 ${WORKDIR}/dpkg-configure.service ${D}${systemd_unitdir}/system/
56 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
57 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
58 -e 's,@BINDIR@,${bindir},g' \
59 -e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
60 ${D}${systemd_unitdir}/system/dpkg-configure.service
61 fi
62}
63
64PROV = "virtual/update-alternatives"
65PROV_class-native = ""
66
67PROVIDES += "${PROV}"
68
69PACKAGES =+ "update-alternatives-dpkg"
70FILES_update-alternatives-dpkg = "${bindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives"
71RPROVIDES_update-alternatives-dpkg += "update-alternatives"
72
73PACKAGES += "${PN}-perl"
74FILES_${PN}-perl = "${libdir}/perl"
75
Patrick Williamsc0f7c042017-02-23 20:41:17 -060076# Split out start-stop-daemon to its own package. Note that it
77# is installed in a different directory than the one used for
78# the bitbake version.
79#
80PACKAGES =+ "${PN}-start-stop"
81FILES_${PN}-start-stop = "${sbindir}/start-stop-daemon"
82
83RDEPENDS_${PN} += "${PN}-start-stop"
84
85
Patrick Williamsc124f4f2015-09-15 14:41:29 -050086BBCLASSEXTEND = "native"