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 | |
| 5 | SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.xz" |
| 6 | |
| 7 | SRC_URI_append_class-native = " file://0001-When-running-do_package_write_deb-we-have-trees-of-h.patch" |
| 8 | |
| 9 | DEPENDS = "zlib bzip2 perl ncurses" |
| 10 | DEPENDS_class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native" |
| 11 | RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} xz run-postinsts perl" |
| 12 | RDEPENDS_${PN}_class-native = "xz-native" |
| 13 | |
| 14 | inherit autotools gettext perlnative pkgconfig systemd |
| 15 | |
| 16 | python () { |
| 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 | |
| 22 | export PERL = "${bindir}/perl" |
| 23 | PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl" |
| 24 | |
| 25 | export PERL_LIBDIR = "${libdir}/perl" |
| 26 | PERL_LIBDIR_class-native = "${libdir}/perl-native/perl" |
| 27 | |
| 28 | EXTRA_OECONF = "\ |
| 29 | --disable-dselect \ |
| 30 | --enable-start-stop-daemon \ |
| 31 | --with-zlib \ |
| 32 | --with-bz2 \ |
| 33 | --without-liblzma \ |
| 34 | --without-selinux \ |
| 35 | " |
| 36 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame^] | 37 | EXTRA_OECONF += "TAR=tar" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 38 | |
| 39 | do_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 | |
| 45 | do_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 | |
| 65 | PROV = "virtual/update-alternatives" |
| 66 | PROV_class-native = "" |
| 67 | |
| 68 | PROVIDES += "${PROV}" |
| 69 | |
| 70 | PACKAGES =+ "update-alternatives-dpkg" |
| 71 | FILES_update-alternatives-dpkg = "${bindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives" |
| 72 | RPROVIDES_update-alternatives-dpkg += "update-alternatives" |
| 73 | |
| 74 | PACKAGES += "${PN}-perl" |
| 75 | FILES_${PN}-perl = "${libdir}/perl" |
| 76 | |
| 77 | BBCLASSEXTEND = "native" |
| 78 | |
| 79 | |