xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-devtools/dpkg/dpkg.inc (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1SUMMARY = "Package maintenance system from Debian"
2LICENSE = "GPL-2.0-or-later"
3HOMEPAGE = "https://salsa.debian.org/dpkg-team/dpkg"
4DESCRIPTION = "The primary interface for the dpkg suite is the dselect program. A more low-level and less user-friendly interface is available in the form of the dpkg command."
5SECTION = "base"
6
7DEPENDS = "zlib bzip2 perl ncurses"
8DEPENDS:class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native"
9RDEPENDS:${PN} = "${VIRTUAL-RUNTIME_update-alternatives} perl"
10RDEPENDS:${PN}:class-native = ""
11
12UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
13
14inherit autotools gettext perlnative pkgconfig perl-version update-alternatives
15
16PERL:class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl"
17
18export PERL_LIBDIR = "${libdir}/perl5/${@get_perl_version(d)}"
19PERL_LIBDIR:class-native = "${libdir}/perl-native/perl/${@get_perl_version(d)}"
20
21EXTRA_OECONF = "\
22		--disable-dselect \
23		--enable-start-stop-daemon \
24		--with-libz \
25		--with-libbz2 \
26		--without-libselinux \
27		TAR=tar \
28		"
29
30EXTRA_OECONF:append:class-target = " --disable-update-alternatives DEB_HOST_ARCH=${DPKG_ARCH}"
31EXTRA_OECONF:append:class-nativesdk = " --disable-update-alternatives DEB_HOST_ARCH=${DPKG_ARCH}"
32
33PACKAGECONFIG = "liblzma"
34PACKAGECONFIG[liblzma] = "--with-liblzma,--without-liblzma, xz"
35
36
37#autotools.bbclass default AUTOTOOLS_AUXDIR is ${S}, we need to under ${S}/build-aux
38AUTOTOOLS_AUXDIR = "${S}/build-aux"
39
40do_configure:prepend () {
41        mkdir -p ${AUTOTOOLS_AUXDIR}
42        # autotools_do_configure updates po/Makefile.in.in, we also need
43        # update dselect/po and scripts/po
44        cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/dselect/po/
45        cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/scripts/po/
46}
47
48do_install:append () {
49	if [ "${PN}" = "dpkg-native" ]; then
50		# update-alternatives doesn't have an offline mode
51		rm ${D}${bindir}/update-alternatives
52		sed -i -e 's|^#!.*${STAGING_BINDIR_NATIVE}/perl-native.*/perl|#!/usr/bin/env nativeperl|' ${D}${bindir}/dpkg-* ${D}${sbindir}/dpkg-*
53	else
54		sed -i -e 's|^#!.*${STAGING_BINDIR_NATIVE}/perl-native.*/perl|#!/usr/bin/env perl|' ${D}${bindir}/dpkg-* ${D}${sbindir}/dpkg-*
55	fi
56}
57
58PROV = "virtual/update-alternatives"
59PROV:class-native = ""
60PROV:class-nativesdk = ""
61
62PROVIDES += "${PROV}"
63
64FILES:${PN} += "${datadir}/zsh"
65
66PACKAGES =+ "update-alternatives-dpkg"
67FILES:update-alternatives-dpkg = "${bindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives"
68RPROVIDES:update-alternatives-dpkg += "update-alternatives"
69
70PACKAGES += "${PN}-perl"
71FILES:${PN}-perl = "${libdir}/perl5/${@get_perl_version(d)}"
72
73RDEPENDS:${PN}-perl += "perl-module-carp perl-module-constant \
74                        perl-module-cwd perl-module-digest \
75                        perl-module-digest-md5 perl-module-errno \
76                        perl-module-exporter perl-module-fcntl \
77                        perl-module-feature perl-module-file-basename \
78                        perl-module-file-compare perl-module-file-copy \
79                        perl-module-file-find perl-module-file-path \
80                        perl-module-file-spec perl-module-file-temp \
81                        perl-module-list-util perl-module-overload \
82                        perl-module-parent perl-module-storable \
83                        perl-module-filehandle perl-module-io \
84                        perl-module-io-handle perl-module-io-seekable \
85                        perl-module-posix perl-module-scalar-util \
86                        perl-module-selectsaver perl-module-symbol \
87                        perl-module-term-ansicolor perl-module-tie-handle \
88                        perl-module-tie-hash perl-module-storable \
89                        perl-module-time-hires perl-module-time-piece \
90                        perl-module-xsloader"
91
92# Split out start-stop-daemon to its own package.  Note that it
93# is installed in a different directory than the one used for
94# the bitbake version.
95#
96PACKAGES =+ "${PN}-start-stop"
97FILES:${PN}-start-stop = "${sbindir}/start-stop-daemon.${BPN}"
98ALTERNATIVE:${PN}-start-stop = "start-stop-daemon"
99ALTERNATIVE_LINK_NAME[start-stop-daemon] = "${sbindir}/start-stop-daemon"
100ALTERNATIVE_PRIORITY = "100"
101
102EXTRA_RDPENDS = "ldconfig"
103EXTRA_RDPENDS:libc-musl = ""
104RDEPENDS:${PN} += "${PN}-start-stop ${EXTRA_RDPENDS}"
105
106BBCLASSEXTEND = "native nativesdk"
107