blob: 3419aa56bfa674acc57f5fd06652093929866de7 [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
Andrew Geisslerb7d28612020-07-24 16:15:54 -050010UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060011
Brad Bishop08902b02019-08-20 09:16:51 -040012inherit autotools gettext perlnative pkgconfig perl-version update-alternatives
Patrick Williamsc124f4f2015-09-15 14:41:29 -050013
Patrick Williamsc124f4f2015-09-15 14:41:29 -050014PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl"
15
Brad Bishop6e60e8b2018-02-01 10:27:11 -050016export PERL_LIBDIR = "${libdir}/perl/${@get_perl_version(d)}"
17PERL_LIBDIR_class-native = "${libdir}/perl-native/perl/${@get_perl_version(d)}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050018
19EXTRA_OECONF = "\
20 --disable-dselect \
21 --enable-start-stop-daemon \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050022 --with-libz \
23 --with-libbz2 \
24 --without-libselinux \
Brad Bishop19323692019-04-05 15:28:33 -040025 TAR=tar \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026 "
27
Brad Bishop19323692019-04-05 15:28:33 -040028EXTRA_OECONF_append_class-target = " --disable-update-alternatives DEB_HOST_ARCH=${DPKG_ARCH}"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060029EXTRA_OECONF_append_class-nativesdk = " --disable-update-alternatives DEB_HOST_ARCH=${DPKG_ARCH}"
Brad Bishop19323692019-04-05 15:28:33 -040030
Brad Bishop6e60e8b2018-02-01 10:27:11 -050031PACKAGECONFIG = "liblzma"
32PACKAGECONFIG[liblzma] = "--with-liblzma,--without-liblzma, xz"
33
Andrew Geisslerb7d28612020-07-24 16:15:54 -050034
35#autotools.bbclass default AUTOTOOLS_AUXDIR is ${S}, we need to under ${S}/build-aux
36AUTOTOOLS_AUXDIR = "${S}/build-aux"
37
38do_configure_prepend () {
39 mkdir -p ${AUTOTOOLS_AUXDIR}
40 # autotools_do_configure updates po/Makefile.in.in, we also need
41 # update dselect/po and scripts/po
42 cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/dselect/po/
43 cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/scripts/po/
44}
45
Patrick Williamsc124f4f2015-09-15 14:41:29 -050046do_install_append () {
47 if [ "${PN}" = "dpkg-native" ]; then
48 # update-alternatives doesn't have an offline mode
49 rm ${D}${bindir}/update-alternatives
Andrew Geisslerd1e89492021-02-12 15:35:20 -060050 sed -i -e 's|^#!.*${STAGING_BINDIR_NATIVE}/perl-native.*/perl|#!/usr/bin/env nativeperl|' ${D}${bindir}/dpkg-*
Patrick Williamsc124f4f2015-09-15 14:41:29 -050051 else
Andrew Geisslerd1e89492021-02-12 15:35:20 -060052 sed -i -e 's|^#!.*${STAGING_BINDIR_NATIVE}/perl-native.*/perl|#!/usr/bin/env perl|' ${D}${bindir}/dpkg-*
Patrick Williamsc124f4f2015-09-15 14:41:29 -050053 fi
Patrick Williamsc124f4f2015-09-15 14:41:29 -050054}
55
56PROV = "virtual/update-alternatives"
57PROV_class-native = ""
Andrew Geisslerd1e89492021-02-12 15:35:20 -060058PROV_class-nativesdk = ""
Patrick Williamsc124f4f2015-09-15 14:41:29 -050059
60PROVIDES += "${PROV}"
61
62PACKAGES =+ "update-alternatives-dpkg"
63FILES_update-alternatives-dpkg = "${bindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives"
64RPROVIDES_update-alternatives-dpkg += "update-alternatives"
65
66PACKAGES += "${PN}-perl"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050067FILES_${PN}-perl = "${libdir}/perl/${@get_perl_version(d)}"
68
69RDEPENDS_${PN}-perl += "perl-module-carp perl-module-constant \
70 perl-module-cwd perl-module-digest \
71 perl-module-digest-md5 perl-module-errno \
72 perl-module-exporter perl-module-fcntl \
73 perl-module-feature perl-module-file-basename \
74 perl-module-file-compare perl-module-file-copy \
75 perl-module-file-find perl-module-file-path \
76 perl-module-file-spec perl-module-file-temp \
77 perl-module-list-util perl-module-overload \
78 perl-module-parent perl-module-storable \
79 perl-module-filehandle perl-module-io \
80 perl-module-io-handle perl-module-io-seekable \
81 perl-module-posix perl-module-scalar-util \
82 perl-module-selectsaver perl-module-symbol \
83 perl-module-term-ansicolor perl-module-tie-handle \
84 perl-module-tie-hash perl-module-storable \
85 perl-module-time-hires perl-module-time-piece \
86 perl-module-xsloader"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050087
Patrick Williamsc0f7c042017-02-23 20:41:17 -060088# Split out start-stop-daemon to its own package. Note that it
89# is installed in a different directory than the one used for
90# the bitbake version.
91#
92PACKAGES =+ "${PN}-start-stop"
Brad Bishop08902b02019-08-20 09:16:51 -040093FILES_${PN}-start-stop = "${sbindir}/start-stop-daemon.${BPN}"
94ALTERNATIVE_${PN}-start-stop = "start-stop-daemon"
95ALTERNATIVE_LINK_NAME[start-stop-daemon] = "${sbindir}/start-stop-daemon"
96ALTERNATIVE_PRIORITY = "100"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060097
Andrew Geisslerd1e89492021-02-12 15:35:20 -060098EXTRA_RDPENDS = "ldconfig"
99EXTRA_RDPENDS_libc-musl = ""
100RDEPENDS_${PN} += "${PN}-start-stop ${EXTRA_RDPENDS}"
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600101
Andrew Geisslerd1e89492021-02-12 15:35:20 -0600102BBCLASSEXTEND = "native nativesdk"