blob: 6eec2cde9e0f948d7eb8a40d060c5f22c9ebae98 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Package maintenance system from Debian"
2LICENSE = "GPLv2.0+"
3SECTION = "base"
4
5SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.xz"
6
7SRC_URI_append_class-native = " file://0001-When-running-do_package_write_deb-we-have-trees-of-h.patch"
8
9DEPENDS = "zlib bzip2 perl ncurses"
10DEPENDS_class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native"
11RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} xz run-postinsts perl"
12RDEPENDS_${PN}_class-native = "xz-native"
13
14inherit autotools gettext perlnative pkgconfig systemd
15
16python () {
17 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
18 pn = d.getVar('PN', True)
19 d.setVar('SYSTEMD_SERVICE_%s' % (pn), 'dpkg-configure.service')
20}
21
22export PERL = "${bindir}/perl"
23PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl"
24
25export PERL_LIBDIR = "${libdir}/perl"
26PERL_LIBDIR_class-native = "${libdir}/perl-native/perl"
27
28EXTRA_OECONF = "\
29 --disable-dselect \
30 --enable-start-stop-daemon \
31 --with-zlib \
32 --with-bz2 \
33 --without-liblzma \
34 --without-selinux \
35 "
36
37EXTRA_OECONF_append_class-target = " TAR=tar"
38
39do_configure () {
40 echo >> ${S}/m4/compiler.m4
41 sed -i -e 's#PERL_LIBDIR=.*$#PERL_LIBDIR="${libdir}/perl"#' ${S}/configure
42 autotools_do_configure
43}
44
45do_install_append () {
46 if [ "${PN}" = "dpkg-native" ]; then
47 # update-alternatives doesn't have an offline mode
48 rm ${D}${bindir}/update-alternatives
49 sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env nativeperl|' ${D}${bindir}/dpkg-*
50 else
51 sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env perl|' ${D}${bindir}/dpkg-*
52 fi
53
54 if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)};then
55 install -d ${D}${systemd_unitdir}/system
56 install -m 0644 ${WORKDIR}/dpkg-configure.service ${D}${systemd_unitdir}/system/
57 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
58 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
59 -e 's,@BINDIR@,${bindir},g' \
60 -e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
61 ${D}${systemd_unitdir}/system/dpkg-configure.service
62 fi
63}
64
65PROV = "virtual/update-alternatives"
66PROV_class-native = ""
67
68PROVIDES += "${PROV}"
69
70PACKAGES =+ "update-alternatives-dpkg"
71FILES_update-alternatives-dpkg = "${bindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives"
72RPROVIDES_update-alternatives-dpkg += "update-alternatives"
73
74PACKAGES += "${PN}-perl"
75FILES_${PN}-perl = "${libdir}/perl"
76
77BBCLASSEXTEND = "native"
78
79