blob: 71c0b44aed0248409879b7ec68a5ca05f0f09bdd [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
Patrick Williams169d7bc2024-01-05 11:33:25 -060011DEPENDS = "libarchive zstd"
Andrew Geissler517393d2023-01-13 08:55:19 -060012
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 \
Patrick Williams169d7bc2024-01-05 11:33:25 -060018 file://0001-libopkg-Use-libgen.h-to-provide-basename-API.patch \
Andrew Geissler517393d2023-01-13 08:55:19 -060019 file://run-ptest \
Andrew Geissler8f840682023-07-21 09:09:43 -050020 "
Andrew Geissler517393d2023-01-13 08:55:19 -060021
Andrew Geissler8f840682023-07-21 09:09:43 -050022SRC_URI[sha256sum] = "ac73a90a2549cd04948e563d915912c78e1b8ba0f43af75c5a53fcca474adbd5"
Andrew Geissler517393d2023-01-13 08:55:19 -060023
24# This needs to be before ptest inherit, otherwise all ptest files end packaged
25# in libopkg package if OPKGLIBDIR == libdir, because default
26# PTEST_PATH ?= "${libdir}/${BPN}/ptest"
27PACKAGES =+ "libopkg"
28
29inherit autotools pkgconfig ptest
30
31target_localstatedir := "${localstatedir}"
32OPKGLIBDIR ??= "${target_localstatedir}/lib"
33
34PACKAGECONFIG ??= "libsolv"
35
36PACKAGECONFIG[gpg] = "--enable-gpg,--disable-gpg,\
37 gnupg gpgme libgpg-error,\
38 ${@ "gnupg" if ("native" in d.getVar("PN")) else "gnupg-gpg"}\
39 "
40PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl"
41PACKAGECONFIG[ssl-curl] = "--enable-ssl-curl,--disable-ssl-curl,curl openssl"
42PACKAGECONFIG[sha256] = "--enable-sha256,--disable-sha256"
Andrew Geissler517393d2023-01-13 08:55:19 -060043PACKAGECONFIG[libsolv] = "--with-libsolv,--without-libsolv,libsolv"
44
Patrick Williams169d7bc2024-01-05 11:33:25 -060045EXTRA_OECONF = "--enable-zstd"
46EXTRA_OECONF:append:class-native = " --localstatedir=/${@os.path.relpath('${localstatedir}', '${STAGING_DIR_NATIVE}')} --sysconfdir=/${@os.path.relpath('${sysconfdir}', '${STAGING_DIR_NATIVE}')}"
Andrew Geissler517393d2023-01-13 08:55:19 -060047
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 echo "option info_dir ${OPKGLIBDIR}/opkg/info" >>${D}${sysconfdir}/opkg/opkg.conf
53 echo "option status_file ${OPKGLIBDIR}/opkg/status" >>${D}${sysconfdir}/opkg/opkg.conf
54
55 # We need to create the lock directory
56 install -d ${D}${OPKGLIBDIR}/opkg
57}
58
59do_install_ptest () {
60 sed -i -e '/@echo $^/d' ${D}${PTEST_PATH}/tests/Makefile
61 sed -i -e '/@PYTHONPATH=. $(PYTHON) $^/a\\t@if [ "$$?" != "0" ];then echo "FAIL:"$^;else echo "PASS:"$^;fi' ${D}${PTEST_PATH}/tests/Makefile
62}
63
64RDEPENDS:${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-arch-config libarchive"
65RDEPENDS:${PN}:class-native = ""
66RDEPENDS:${PN}:class-nativesdk = ""
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050067RDEPENDS:${PN}-ptest += "make binutils python3-core python3-compression bash python3-crypt python3-io"
Andrew Geissler517393d2023-01-13 08:55:19 -060068RREPLACES:${PN} = "opkg-nogpg opkg-collateral"
69RCONFLICTS:${PN} = "opkg-collateral"
70RPROVIDES:${PN} = "opkg-collateral"
71
72FILES:libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/"
73
74BBCLASSEXTEND = "native nativesdk"
75
76CONFFILES:${PN} = "${sysconfdir}/opkg/opkg.conf"