blob: 66a74dc5ed66a4c3f39b114c84008b89944c3326 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "Open Package Manager"
2SUMMARY_libopkg = "Open Package Manager library"
3SECTION = "base"
4HOMEPAGE = "http://code.google.com/p/opkg/"
5BUGTRACKER = "http://code.google.com/p/opkg/issues/list"
6LICENSE = "GPLv2+"
7LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
8 file://src/opkg.c;beginline=4;endline=18;md5=d6200b0f2b41dee278aa5fad333eecae"
9
10DEPENDS = "libarchive"
11
12PE = "1"
13
14SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \
15 file://opkg.conf \
16 file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \
17 file://run-ptest \
18"
19
20SRC_URI[md5sum] = "bd13e5dfc1c2536f0c7b2e15f795278e"
21SRC_URI[sha256sum] = "86887852c43457edfff9d8b6d9520f3f1cdd55f25eb600a6eb31e1c4e151e106"
22
23# This needs to be before ptest inherit, otherwise all ptest files end packaged
24# in libopkg package if OPKGLIBDIR == libdir, because default
25# PTEST_PATH ?= "${libdir}/${BPN}/ptest"
26PACKAGES =+ "libopkg"
27
28inherit autotools pkgconfig ptest
29
30target_localstatedir := "${localstatedir}"
31OPKGLIBDIR ??= "${target_localstatedir}/lib"
32
33PACKAGECONFIG ??= "libsolv"
34
35PACKAGECONFIG[gpg] = "--enable-gpg,--disable-gpg,\
36 gnupg gpgme libgpg-error,\
37 ${@ "gnupg" if ("native" in d.getVar("PN")) else "gnupg-gpg"}\
38 "
39PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl"
40PACKAGECONFIG[ssl-curl] = "--enable-ssl-curl,--disable-ssl-curl,curl openssl"
41PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
42PACKAGECONFIG[sha256] = "--enable-sha256,--disable-sha256"
43PACKAGECONFIG[libsolv] = "--with-libsolv,--without-libsolv,libsolv"
44
45EXTRA_OECONF += " --disable-pathfinder"
46EXTRA_OECONF_class-native = "--localstatedir=/${@os.path.relpath('${localstatedir}', '${STAGING_DIR_NATIVE}')} --sysconfdir=/${@os.path.relpath('${sysconfdir}', '${STAGING_DIR_NATIVE}')}"
47
48do_install_append () {
49 install -d ${D}${sysconfdir}/opkg
50 install -m 0644 ${WORKDIR}/opkg.conf ${D}${sysconfdir}/opkg/opkg.conf
51 echo "option lists_dir ${OPKGLIBDIR}/opkg/lists" >>${D}${sysconfdir}/opkg/opkg.conf
52
53 # We need to create the lock directory
54 install -d ${D}${OPKGLIBDIR}/opkg
55}
56
57do_install_ptest () {
58 sed -i -e '/@echo $^/d' ${D}${PTEST_PATH}/tests/Makefile
59 sed -i -e '/@PYTHONPATH=. $(PYTHON) $^/a\\t@if [ "$$?" != "0" ];then echo "FAIL:"$^;else echo "PASS:"$^;fi' ${D}${PTEST_PATH}/tests/Makefile
60}
61
62RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-arch-config libarchive"
63RDEPENDS_${PN}_class-native = ""
64RDEPENDS_${PN}_class-nativesdk = ""
65RDEPENDS_${PN}-ptest += "make binutils python3-core python3-compression"
66RREPLACES_${PN} = "opkg-nogpg opkg-collateral"
67RCONFLICTS_${PN} = "opkg-collateral"
68RPROVIDES_${PN} = "opkg-collateral"
69
70FILES_libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/"
71
72BBCLASSEXTEND = "native nativesdk"
73
74CONFFILES_${PN} = "${sysconfdir}/opkg/opkg.conf"