blob: c95a40d2689251d58f7f7b10fd13e447c5abcfa6 [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001SUMMARY = "Open Package Manager"
2SUMMARY:libopkg = "Open Package Manager library"
3SECTION = "base"
4HOMEPAGE = "http://code.google.com/p/opkg/"
5DESCRIPTION = "Opkg is a lightweight package management system based on Ipkg."
6BUGTRACKER = "http://code.google.com/p/opkg/issues/list"
7LICENSE = "GPL-2.0-or-later"
8LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
9 file://src/opkg.c;beginline=4;endline=18;md5=d6200b0f2b41dee278aa5fad333eecae"
10
11DEPENDS = "libarchive"
12
13PE = "1"
14
15SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \
16 file://opkg.conf \
17 file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \
18 file://0002-opkg-key-remove-no-options-flag-from-gpg-calls.patch \
Andrew Geisslerc5535c92023-01-27 16:10:19 -060019 file://0001-Define-alignof-using-_Alignof-when-using-C11-or-newe.patch \
Andrew Geissler517393d2023-01-13 08:55:19 -060020 file://run-ptest \
21"
22
23SRC_URI[sha256sum] = "e87fccb575c64d3ac0559444016a2795f12125986a0da896bab97c4a1a2f1b2a"
24
25# This needs to be before ptest inherit, otherwise all ptest files end packaged
26# in libopkg package if OPKGLIBDIR == libdir, because default
27# PTEST_PATH ?= "${libdir}/${BPN}/ptest"
28PACKAGES =+ "libopkg"
29
30inherit autotools pkgconfig ptest
31
32target_localstatedir := "${localstatedir}"
33OPKGLIBDIR ??= "${target_localstatedir}/lib"
34
35PACKAGECONFIG ??= "libsolv"
36
37PACKAGECONFIG[gpg] = "--enable-gpg,--disable-gpg,\
38 gnupg gpgme libgpg-error,\
39 ${@ "gnupg" if ("native" in d.getVar("PN")) else "gnupg-gpg"}\
40 "
41PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl"
42PACKAGECONFIG[ssl-curl] = "--enable-ssl-curl,--disable-ssl-curl,curl openssl"
43PACKAGECONFIG[sha256] = "--enable-sha256,--disable-sha256"
44PACKAGECONFIG[zstd] = "--enable-zstd,--disable-zstd,zstd"
45PACKAGECONFIG[libsolv] = "--with-libsolv,--without-libsolv,libsolv"
46
47EXTRA_OECONF:class-native = "--localstatedir=/${@os.path.relpath('${localstatedir}', '${STAGING_DIR_NATIVE}')} --sysconfdir=/${@os.path.relpath('${sysconfdir}', '${STAGING_DIR_NATIVE}')}"
48
49do_install:append () {
50 install -d ${D}${sysconfdir}/opkg
51 install -m 0644 ${WORKDIR}/opkg.conf ${D}${sysconfdir}/opkg/opkg.conf
52 echo "option lists_dir ${OPKGLIBDIR}/opkg/lists" >>${D}${sysconfdir}/opkg/opkg.conf
53 echo "option info_dir ${OPKGLIBDIR}/opkg/info" >>${D}${sysconfdir}/opkg/opkg.conf
54 echo "option status_file ${OPKGLIBDIR}/opkg/status" >>${D}${sysconfdir}/opkg/opkg.conf
55
56 # We need to create the lock directory
57 install -d ${D}${OPKGLIBDIR}/opkg
58}
59
60do_install_ptest () {
61 sed -i -e '/@echo $^/d' ${D}${PTEST_PATH}/tests/Makefile
62 sed -i -e '/@PYTHONPATH=. $(PYTHON) $^/a\\t@if [ "$$?" != "0" ];then echo "FAIL:"$^;else echo "PASS:"$^;fi' ${D}${PTEST_PATH}/tests/Makefile
63}
64
65RDEPENDS:${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-arch-config libarchive"
66RDEPENDS:${PN}:class-native = ""
67RDEPENDS:${PN}:class-nativesdk = ""
68RDEPENDS:${PN}-ptest += "make binutils python3-core python3-compression"
69RREPLACES:${PN} = "opkg-nogpg opkg-collateral"
70RCONFLICTS:${PN} = "opkg-collateral"
71RPROVIDES:${PN} = "opkg-collateral"
72
73FILES:libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/"
74
75BBCLASSEXTEND = "native nativesdk"
76
77CONFFILES:${PN} = "${sysconfdir}/opkg/opkg.conf"