Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Package maintenance system from Debian" |
| 2 | LICENSE = "GPLv2.0+" |
| 3 | SECTION = "base" |
| 4 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 5 | DEPENDS = "zlib bzip2 perl ncurses" |
| 6 | DEPENDS_class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native" |
| 7 | RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} xz run-postinsts perl" |
| 8 | RDEPENDS_${PN}_class-native = "xz-native" |
| 9 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 10 | UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/d/dpkg/" |
| 11 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 12 | inherit autotools gettext perlnative pkgconfig systemd |
| 13 | |
| 14 | python () { |
| 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 | |
| 20 | export PERL = "${bindir}/perl" |
| 21 | PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl" |
| 22 | |
| 23 | export PERL_LIBDIR = "${libdir}/perl" |
| 24 | PERL_LIBDIR_class-native = "${libdir}/perl-native/perl" |
| 25 | |
| 26 | EXTRA_OECONF = "\ |
| 27 | --disable-dselect \ |
| 28 | --enable-start-stop-daemon \ |
| 29 | --with-zlib \ |
| 30 | --with-bz2 \ |
| 31 | --without-liblzma \ |
| 32 | --without-selinux \ |
| 33 | " |
| 34 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 35 | EXTRA_OECONF += "TAR=tar" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 36 | EXTRA_OECONF_append_class-target = " DEB_HOST_ARCH=${DPKG_ARCH}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 37 | |
| 38 | do_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 | |
| 44 | do_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 | |
| 64 | PROV = "virtual/update-alternatives" |
| 65 | PROV_class-native = "" |
| 66 | |
| 67 | PROVIDES += "${PROV}" |
| 68 | |
| 69 | PACKAGES =+ "update-alternatives-dpkg" |
| 70 | FILES_update-alternatives-dpkg = "${bindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives" |
| 71 | RPROVIDES_update-alternatives-dpkg += "update-alternatives" |
| 72 | |
| 73 | PACKAGES += "${PN}-perl" |
| 74 | FILES_${PN}-perl = "${libdir}/perl" |
| 75 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 76 | # 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 | # |
| 80 | PACKAGES =+ "${PN}-start-stop" |
| 81 | FILES_${PN}-start-stop = "${sbindir}/start-stop-daemon" |
| 82 | |
| 83 | RDEPENDS_${PN} += "${PN}-start-stop" |
| 84 | |
| 85 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 86 | BBCLASSEXTEND = "native" |