blob: 149ee3ca190eed12eda19c3089808ad131c89a3f [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001SUMMARY = "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=2;endline=21;md5=90435a519c6ea69ef22e4a88bcc52fa0"
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 \
Brad Bishopc342db32019-05-15 21:57:59 -040017 file://run-ptest \
Brad Bishop19323692019-04-05 15:28:33 -040018"
19
Brad Bishop96ff1982019-08-19 13:50:42 -040020SRC_URI[md5sum] = "ba0c21305fc93b26e844981ef100dc85"
21SRC_URI[sha256sum] = "45ac1e037d3877f635d883f8a555e172883a25d3eeb7986c75890fdd31250a43"
Brad Bishop19323692019-04-05 15:28:33 -040022
Brad Bishopc342db32019-05-15 21:57:59 -040023# 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
Brad Bishop00e122a2019-10-05 11:10:57 -040028inherit autotools pkgconfig ptest
Brad Bishop19323692019-04-05 15:28:33 -040029
30target_localstatedir := "${localstatedir}"
Brad Bishop96ff1982019-08-19 13:50:42 -040031OPKGLIBDIR ??= "${target_localstatedir}/lib"
Brad Bishop19323692019-04-05 15:28:33 -040032
33PACKAGECONFIG ??= "libsolv"
34
Brad Bishop1d80a2e2019-11-15 16:35:03 -050035PACKAGECONFIG[gpg] = "--enable-gpg,--disable-gpg,\
36 gnupg gpgme libgpg-error,\
37 ${@ "gnupg" if ("native" in d.getVar("PN")) else "gnupg-gpg"}\
38 "
Brad Bishop19323692019-04-05 15:28:33 -040039PACKAGECONFIG[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"
Brad Bishop19323692019-04-05 15:28:33 -040043PACKAGECONFIG[libsolv] = "--with-libsolv,--without-libsolv,libsolv"
44
Brad Bishop00e122a2019-10-05 11:10:57 -040045EXTRA_OECONF += " --disable-pathfinder"
Brad Bishop19323692019-04-05 15:28:33 -040046EXTRA_OECONF_class-native = "--localstatedir=/${@os.path.relpath('${localstatedir}', '${STAGING_DIR_NATIVE}')} --sysconfdir=/${@os.path.relpath('${sysconfdir}', '${STAGING_DIR_NATIVE}')}"
47
Brad Bishop96ff1982019-08-19 13:50:42 -040048# Release tarball has unused binaries on the tests folder, automatically created by automake.
49# For now, delete them to avoid packaging errors (wrong architecture)
50do_unpack_append () {
51 bb.build.exec_func('remove_test_binaries', d)
52}
53
54remove_test_binaries () {
55 rm ${WORKDIR}/opkg-${PV}/tests/libopkg_test*
56}
57
Brad Bishop19323692019-04-05 15:28:33 -040058do_install_append () {
59 install -d ${D}${sysconfdir}/opkg
60 install -m 0644 ${WORKDIR}/opkg.conf ${D}${sysconfdir}/opkg/opkg.conf
61 echo "option lists_dir ${OPKGLIBDIR}/opkg/lists" >>${D}${sysconfdir}/opkg/opkg.conf
62
63 # We need to create the lock directory
64 install -d ${D}${OPKGLIBDIR}/opkg
65}
66
Brad Bishop96ff1982019-08-19 13:50:42 -040067do_install_ptest () {
68 sed -i -e '/@echo $^/d' ${D}${PTEST_PATH}/tests/Makefile
69 sed -i -e '/@PYTHONPATH=. $(PYTHON) $^/a\\t@if [ "$$?" != "0" ];then echo "FAIL:"$^;else echo "PASS:"$^;fi' ${D}${PTEST_PATH}/tests/Makefile
70}
71
Brad Bishop19323692019-04-05 15:28:33 -040072RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-arch-config libarchive"
73RDEPENDS_${PN}_class-native = ""
74RDEPENDS_${PN}_class-nativesdk = ""
Brad Bishopc342db32019-05-15 21:57:59 -040075RDEPENDS_${PN}-ptest += "make binutils python3-core python3-compression"
Brad Bishop19323692019-04-05 15:28:33 -040076RREPLACES_${PN} = "opkg-nogpg opkg-collateral"
77RCONFLICTS_${PN} = "opkg-collateral"
78RPROVIDES_${PN} = "opkg-collateral"
79
Brad Bishop19323692019-04-05 15:28:33 -040080FILES_libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/"
81
82BBCLASSEXTEND = "native nativesdk"
83
84CONFFILES_${PN} = "${sysconfdir}/opkg/opkg.conf"