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" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 7 | RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} perl" |
| 8 | RDEPENDS_${PN}_class-native = "" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 9 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 10 | UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/d/dpkg/" |
| 11 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 12 | inherit autotools gettext perlnative pkgconfig systemd perl-version |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 13 | |
| 14 | python () { |
| 15 | if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 16 | pn = d.getVar('PN') |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 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 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 23 | export PERL_LIBDIR = "${libdir}/perl/${@get_perl_version(d)}" |
| 24 | PERL_LIBDIR_class-native = "${libdir}/perl-native/perl/${@get_perl_version(d)}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 25 | |
| 26 | EXTRA_OECONF = "\ |
| 27 | --disable-dselect \ |
| 28 | --enable-start-stop-daemon \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 29 | --with-libz \ |
| 30 | --with-libbz2 \ |
| 31 | --without-libselinux \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 32 | " |
| 33 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 34 | PACKAGECONFIG = "liblzma" |
| 35 | PACKAGECONFIG[liblzma] = "--with-liblzma,--without-liblzma, xz" |
| 36 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 37 | EXTRA_OECONF += "TAR=tar" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 38 | EXTRA_OECONF_append_class-target = " DEB_HOST_ARCH=${DPKG_ARCH}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 39 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 40 | do_install_append () { |
| 41 | if [ "${PN}" = "dpkg-native" ]; then |
| 42 | # update-alternatives doesn't have an offline mode |
| 43 | rm ${D}${bindir}/update-alternatives |
| 44 | sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env nativeperl|' ${D}${bindir}/dpkg-* |
| 45 | else |
| 46 | sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env perl|' ${D}${bindir}/dpkg-* |
| 47 | fi |
| 48 | |
| 49 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)};then |
| 50 | install -d ${D}${systemd_unitdir}/system |
| 51 | install -m 0644 ${WORKDIR}/dpkg-configure.service ${D}${systemd_unitdir}/system/ |
| 52 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ |
| 53 | -e 's,@SYSCONFDIR@,${sysconfdir},g' \ |
| 54 | -e 's,@BINDIR@,${bindir},g' \ |
| 55 | -e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \ |
| 56 | ${D}${systemd_unitdir}/system/dpkg-configure.service |
| 57 | fi |
| 58 | } |
| 59 | |
| 60 | PROV = "virtual/update-alternatives" |
| 61 | PROV_class-native = "" |
| 62 | |
| 63 | PROVIDES += "${PROV}" |
| 64 | |
| 65 | PACKAGES =+ "update-alternatives-dpkg" |
| 66 | FILES_update-alternatives-dpkg = "${bindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives" |
| 67 | RPROVIDES_update-alternatives-dpkg += "update-alternatives" |
| 68 | |
| 69 | PACKAGES += "${PN}-perl" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 70 | FILES_${PN}-perl = "${libdir}/perl/${@get_perl_version(d)}" |
| 71 | |
| 72 | RDEPENDS_${PN}-perl += "perl-module-carp perl-module-constant \ |
| 73 | perl-module-cwd perl-module-digest \ |
| 74 | perl-module-digest-md5 perl-module-errno \ |
| 75 | perl-module-exporter perl-module-fcntl \ |
| 76 | perl-module-feature perl-module-file-basename \ |
| 77 | perl-module-file-compare perl-module-file-copy \ |
| 78 | perl-module-file-find perl-module-file-path \ |
| 79 | perl-module-file-spec perl-module-file-temp \ |
| 80 | perl-module-list-util perl-module-overload \ |
| 81 | perl-module-parent perl-module-storable \ |
| 82 | perl-module-filehandle perl-module-io \ |
| 83 | perl-module-io-handle perl-module-io-seekable \ |
| 84 | perl-module-posix perl-module-scalar-util \ |
| 85 | perl-module-selectsaver perl-module-symbol \ |
| 86 | perl-module-term-ansicolor perl-module-tie-handle \ |
| 87 | perl-module-tie-hash perl-module-storable \ |
| 88 | perl-module-time-hires perl-module-time-piece \ |
| 89 | perl-module-xsloader" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 90 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 91 | # Split out start-stop-daemon to its own package. Note that it |
| 92 | # is installed in a different directory than the one used for |
| 93 | # the bitbake version. |
| 94 | # |
| 95 | PACKAGES =+ "${PN}-start-stop" |
| 96 | FILES_${PN}-start-stop = "${sbindir}/start-stop-daemon" |
| 97 | |
| 98 | RDEPENDS_${PN} += "${PN}-start-stop" |
| 99 | |
| 100 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 101 | BBCLASSEXTEND = "native" |