blob: f9df58a2956113e9dc0281133d4502eeb0a80b8b [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "Additional utilities for the opkg package manager"
2SUMMARY_update-alternatives-opkg = "Utility for managing the alternatives system"
3SECTION = "base"
4HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils"
5LICENSE = "GPLv2+"
6LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
7 file://opkg.py;beginline=2;endline=18;md5=ffa11ff3c15eb31c6a7ceaa00cc9f986"
8PROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtual/update-alternatives', '', d)}"
9
10SRC_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/${BPN}/snapshot/${BPN}-${PV}.tar.gz \
Andrew Geissler82c905d2020-04-13 13:39:40 -050011"
12UPSTREAM_CHECK_URI = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/refs/"
13
Andrew Geissler475cb722020-07-10 16:00:51 -050014SRC_URI[md5sum] = "7bbadb3c381f3ea935b21d3bb8cc4671"
15SRC_URI[sha256sum] = "046517600fb0aed6c4645edefe02281f4fa2f1c02f71596152d93172452c0b01"
Andrew Geissler82c905d2020-04-13 13:39:40 -050016
17TARGET_CC_ARCH += "${LDFLAGS}"
18
19RDEPENDS_${PN} += "bash"
20
21inherit perlnative
22
23# For native builds we use the host Python
24PYTHONRDEPS = "python3 python3-shell python3-io python3-math python3-crypt python3-logging python3-fcntl python3-pickle python3-compression python3-stringold"
25PYTHONRDEPS_class-native = ""
26
27PACKAGECONFIG = "python update-alternatives"
28PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"
29PACKAGECONFIG[update-alternatives] = ",,,"
30
31do_install() {
32 oe_runmake PREFIX=${prefix} DESTDIR=${D} install
33 if ! ${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'true', 'false', d)}; then
34 rm -f "${D}${bindir}/update-alternatives"
35 fi
36}
37
38do_install_append_class-target() {
39 if ! ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
40 grep -lZ "/usr/bin/env.*python" ${D}${bindir}/* | xargs -0 rm
41 fi
42
43 if [ -e "${D}${bindir}/update-alternatives" ]; then
44 sed -i ${D}${bindir}/update-alternatives -e 's,/usr/bin,${bindir},g; s,/usr/lib,${nonarch_libdir},g'
45 fi
46}
47
48# These are empty and will pull python3-dev into images where it wouldn't
49# have been otherwise, so don't generate them.
50PACKAGES_remove = "${PN}-dev ${PN}-staticdev"
51
52PACKAGES =+ "update-alternatives-opkg"
53FILES_update-alternatives-opkg = "${bindir}/update-alternatives"
54RPROVIDES_update-alternatives-opkg = "update-alternatives update-alternatives-cworth"
55RREPLACES_update-alternatives-opkg = "update-alternatives-cworth"
56RCONFLICTS_update-alternatives-opkg = "update-alternatives-cworth"
57
58pkg_postrm_update-alternatives-opkg() {
59 rm -rf $D${nonarch_libdir}/opkg/alternatives
60 rmdir $D${nonarch_libdir}/opkg || true
61}
62
63BBCLASSEXTEND = "native nativesdk"
64
65CLEANBROKEN = "1"