1*4882a593SmuzhiyunSUMMARY = "Additional utilities for the opkg package manager" 2*4882a593SmuzhiyunSUMMARY:update-alternatives-opkg = "Utility for managing the alternatives system" 3*4882a593SmuzhiyunSECTION = "base" 4*4882a593SmuzhiyunHOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils" 5*4882a593SmuzhiyunLICENSE = "GPL-2.0-or-later" 6*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ 7*4882a593Smuzhiyun file://opkg.py;beginline=2;endline=18;md5=ffa11ff3c15eb31c6a7ceaa00cc9f986" 8*4882a593SmuzhiyunPROVIDES += "${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'virtual/update-alternatives', '', d)}" 9*4882a593Smuzhiyun 10*4882a593SmuzhiyunSRC_URI = "git://git.yoctoproject.org/opkg-utils;protocol=https;branch=master \ 11*4882a593Smuzhiyun file://0001-update-alternatives-correctly-match-priority.patch \ 12*4882a593Smuzhiyun " 13*4882a593SmuzhiyunSRCREV = "9239541f14a2529b9d01c0a253ab11afa2822dab" 14*4882a593Smuzhiyun 15*4882a593SmuzhiyunS = "${WORKDIR}/git" 16*4882a593Smuzhiyun 17*4882a593SmuzhiyunTARGET_CC_ARCH += "${LDFLAGS}" 18*4882a593Smuzhiyun 19*4882a593SmuzhiyunRDEPENDS:${PN} += "bash" 20*4882a593Smuzhiyun 21*4882a593Smuzhiyuninherit perlnative 22*4882a593Smuzhiyun 23*4882a593Smuzhiyun# For native builds we use the host Python 24*4882a593SmuzhiyunPYTHONRDEPS = "python3 python3-shell python3-io python3-math python3-crypt python3-logging python3-fcntl python3-pickle python3-compression python3-stringold" 25*4882a593SmuzhiyunPYTHONRDEPS:class-native = "" 26*4882a593Smuzhiyun 27*4882a593SmuzhiyunPACKAGECONFIG = "python update-alternatives" 28*4882a593SmuzhiyunPACKAGECONFIG[python] = ",,,${PYTHONRDEPS}" 29*4882a593SmuzhiyunPACKAGECONFIG[update-alternatives] = ",,," 30*4882a593Smuzhiyun 31*4882a593Smuzhiyundo_install() { 32*4882a593Smuzhiyun oe_runmake PREFIX=${prefix} DESTDIR=${D} install 33*4882a593Smuzhiyun if ! ${@bb.utils.contains('PACKAGECONFIG', 'update-alternatives', 'true', 'false', d)}; then 34*4882a593Smuzhiyun rm -f "${D}${bindir}/update-alternatives" 35*4882a593Smuzhiyun fi 36*4882a593Smuzhiyun} 37*4882a593Smuzhiyun 38*4882a593Smuzhiyundo_install:append:class-target() { 39*4882a593Smuzhiyun if ! ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then 40*4882a593Smuzhiyun grep -lZ "/usr/bin/env.*python" ${D}${bindir}/* | xargs -0 rm 41*4882a593Smuzhiyun fi 42*4882a593Smuzhiyun 43*4882a593Smuzhiyun if [ -e "${D}${bindir}/update-alternatives" ]; then 44*4882a593Smuzhiyun sed -i ${D}${bindir}/update-alternatives -e 's,/usr/bin,${bindir},g; s,/usr/lib,${nonarch_libdir},g' 45*4882a593Smuzhiyun fi 46*4882a593Smuzhiyun} 47*4882a593Smuzhiyun 48*4882a593Smuzhiyun# These are empty and will pull python3-dev into images where it wouldn't 49*4882a593Smuzhiyun# have been otherwise, so don't generate them. 50*4882a593SmuzhiyunPACKAGES:remove = "${PN}-dev ${PN}-staticdev" 51*4882a593Smuzhiyun 52*4882a593SmuzhiyunPACKAGES =+ "update-alternatives-opkg" 53*4882a593SmuzhiyunFILES:update-alternatives-opkg = "${bindir}/update-alternatives" 54*4882a593SmuzhiyunRPROVIDES:update-alternatives-opkg = "update-alternatives update-alternatives-cworth" 55*4882a593SmuzhiyunRREPLACES:update-alternatives-opkg = "update-alternatives-cworth" 56*4882a593SmuzhiyunRCONFLICTS:update-alternatives-opkg = "update-alternatives-cworth" 57*4882a593Smuzhiyun 58*4882a593Smuzhiyunpkg_postrm:update-alternatives-opkg() { 59*4882a593Smuzhiyun rm -rf $D${nonarch_libdir}/opkg/alternatives 60*4882a593Smuzhiyun rmdir $D${nonarch_libdir}/opkg || true 61*4882a593Smuzhiyun} 62*4882a593Smuzhiyun 63*4882a593SmuzhiyunBBCLASSEXTEND = "native nativesdk" 64*4882a593Smuzhiyun 65*4882a593SmuzhiyunCLEANBROKEN = "1" 66