2024-09-09 08:57:42 +00:00
|
|
|
SUMMARY = "Package maintenance system from Debian"
|
2024-09-09 08:52:07 +00:00
|
|
|
LICENSE = "GPLv2.0+"
|
|
|
|
SECTION = "base"
|
|
|
|
|
2024-09-09 08:57:42 +00:00
|
|
|
SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.xz"
|
2024-09-09 08:52:07 +00:00
|
|
|
|
2024-09-09 08:57:42 +00:00
|
|
|
DEPENDS = "zlib bzip2 perl ncurses"
|
|
|
|
DEPENDS_class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native"
|
|
|
|
RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} xz run-postinsts perl"
|
|
|
|
RDEPENDS_${PN}_class-native = "xz-native"
|
2024-09-09 08:52:07 +00:00
|
|
|
|
2024-09-09 08:57:42 +00:00
|
|
|
inherit autotools gettext perlnative pkgconfig systemd
|
2024-09-09 08:52:07 +00:00
|
|
|
|
2024-09-09 08:57:42 +00:00
|
|
|
python () {
|
|
|
|
if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
|
|
|
|
pn = d.getVar('PN', True)
|
|
|
|
d.setVar('SYSTEMD_SERVICE_%s' % (pn), 'dpkg-configure.service')
|
|
|
|
}
|
2024-09-09 08:52:07 +00:00
|
|
|
|
2024-09-09 08:57:42 +00:00
|
|
|
export PERL = "${bindir}/perl"
|
|
|
|
PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl"
|
2024-09-09 08:52:07 +00:00
|
|
|
|
|
|
|
export PERL_LIBDIR = "${libdir}/perl"
|
2024-09-09 08:57:42 +00:00
|
|
|
PERL_LIBDIR_class-native = "${libdir}/perl-native/perl"
|
2024-09-09 08:52:07 +00:00
|
|
|
|
2024-09-09 08:57:42 +00:00
|
|
|
EXTRA_OECONF = "\
|
|
|
|
--disable-dselect \
|
|
|
|
--enable-start-stop-daemon \
|
2024-09-09 08:52:07 +00:00
|
|
|
--with-zlib \
|
2024-09-09 08:57:42 +00:00
|
|
|
--with-bz2 \
|
|
|
|
--without-liblzma \
|
2024-09-09 08:52:07 +00:00
|
|
|
--without-selinux \
|
2024-09-09 08:57:42 +00:00
|
|
|
"
|
|
|
|
|
|
|
|
EXTRA_OECONF_append_class-target = " TAR=tar"
|
2024-09-09 08:52:07 +00:00
|
|
|
|
|
|
|
do_configure () {
|
2024-09-09 08:57:42 +00:00
|
|
|
echo >> ${S}/m4/compiler.m4
|
2024-09-09 08:52:07 +00:00
|
|
|
sed -i -e 's#PERL_LIBDIR=.*$#PERL_LIBDIR="${libdir}/perl"#' ${S}/configure
|
|
|
|
autotools_do_configure
|
|
|
|
}
|
|
|
|
|
|
|
|
do_install_append () {
|
|
|
|
if [ "${PN}" = "dpkg-native" ]; then
|
|
|
|
# update-alternatives doesn't have an offline mode
|
|
|
|
rm ${D}${bindir}/update-alternatives
|
2024-09-09 08:57:42 +00:00
|
|
|
sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env nativeperl|' ${D}${bindir}/dpkg-*
|
2024-09-09 08:52:07 +00:00
|
|
|
else
|
|
|
|
mv ${D}${bindir}/update-alternatives ${D}${sbindir}
|
2024-09-09 08:57:42 +00:00
|
|
|
sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env perl|' ${D}${bindir}/dpkg-*
|
|
|
|
fi
|
|
|
|
|
|
|
|
if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)};then
|
|
|
|
install -d ${D}${systemd_unitdir}/system
|
|
|
|
install -m 0644 ${WORKDIR}/dpkg-configure.service ${D}${systemd_unitdir}/system/
|
|
|
|
sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
|
|
|
|
-e 's,@SYSCONFDIR@,${sysconfdir},g' \
|
|
|
|
-e 's,@BINDIR@,${bindir},g' \
|
|
|
|
-e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
|
|
|
|
${D}${systemd_unitdir}/system/dpkg-configure.service
|
2024-09-09 08:52:07 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
PROV = "virtual/update-alternatives"
|
2024-09-09 08:57:42 +00:00
|
|
|
PROV_class-native = ""
|
2024-09-09 08:52:07 +00:00
|
|
|
|
|
|
|
PROVIDES += "${PROV}"
|
|
|
|
|
|
|
|
PACKAGES =+ "update-alternatives-dpkg"
|
|
|
|
FILES_update-alternatives-dpkg = "${sbindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives"
|
|
|
|
RPROVIDES_update-alternatives-dpkg += "update-alternatives"
|
|
|
|
|
|
|
|
PACKAGES += "${PN}-perl"
|
|
|
|
FILES_${PN}-perl = "${libdir}/perl"
|
|
|
|
|
|
|
|
BBCLASSEXTEND = "native"
|
|
|
|
|
|
|
|
|