blob: fe4732d1db89897cc222ff844d2a01e30f3c7d0b [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"
Brad Bishop6e60e8b2018-02-01 10:27:11 -05007RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} perl"
8RDEPENDS_${PN}_class-native = ""
Patrick Williamsc124f4f2015-09-15 14:41:29 -05009
Patrick Williamsc0f7c042017-02-23 20:41:17 -060010UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/d/dpkg/"
11
Brad Bishop6e60e8b2018-02-01 10:27:11 -050012inherit autotools gettext perlnative pkgconfig systemd perl-version
Patrick Williamsc124f4f2015-09-15 14:41:29 -050013
14python () {
15 if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
Brad Bishop6e60e8b2018-02-01 10:27:11 -050016 pn = d.getVar('PN')
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017 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
Brad Bishop6e60e8b2018-02-01 10:27:11 -050023export PERL_LIBDIR = "${libdir}/perl/${@get_perl_version(d)}"
24PERL_LIBDIR_class-native = "${libdir}/perl-native/perl/${@get_perl_version(d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050025
26EXTRA_OECONF = "\
27 --disable-dselect \
28 --enable-start-stop-daemon \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050029 --with-libz \
30 --with-libbz2 \
31 --without-libselinux \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050032 "
33
Brad Bishop6e60e8b2018-02-01 10:27:11 -050034PACKAGECONFIG = "liblzma"
35PACKAGECONFIG[liblzma] = "--with-liblzma,--without-liblzma, xz"
36
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050037EXTRA_OECONF += "TAR=tar"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060038EXTRA_OECONF_append_class-target = " DEB_HOST_ARCH=${DPKG_ARCH}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050039
Patrick Williamsc124f4f2015-09-15 14:41:29 -050040do_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
60PROV = "virtual/update-alternatives"
61PROV_class-native = ""
62
63PROVIDES += "${PROV}"
64
65PACKAGES =+ "update-alternatives-dpkg"
66FILES_update-alternatives-dpkg = "${bindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives"
67RPROVIDES_update-alternatives-dpkg += "update-alternatives"
68
69PACKAGES += "${PN}-perl"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050070FILES_${PN}-perl = "${libdir}/perl/${@get_perl_version(d)}"
71
72RDEPENDS_${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 Williamsc124f4f2015-09-15 14:41:29 -050090
Patrick Williamsc0f7c042017-02-23 20:41:17 -060091# 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#
95PACKAGES =+ "${PN}-start-stop"
96FILES_${PN}-start-stop = "${sbindir}/start-stop-daemon"
97
98RDEPENDS_${PN} += "${PN}-start-stop"
99
100
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500101BBCLASSEXTEND = "native"