xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-devtools/opkg/opkg_0.5.0.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSUMMARY = "Open Package Manager"
2*4882a593SmuzhiyunSUMMARY:libopkg = "Open Package Manager library"
3*4882a593SmuzhiyunSECTION = "base"
4*4882a593SmuzhiyunHOMEPAGE = "http://code.google.com/p/opkg/"
5*4882a593SmuzhiyunDESCRIPTION = "Opkg is a lightweight package management system based on Ipkg."
6*4882a593SmuzhiyunBUGTRACKER = "http://code.google.com/p/opkg/issues/list"
7*4882a593SmuzhiyunLICENSE = "GPL-2.0-or-later"
8*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
9*4882a593Smuzhiyun                    file://src/opkg.c;beginline=4;endline=18;md5=d6200b0f2b41dee278aa5fad333eecae"
10*4882a593Smuzhiyun
11*4882a593SmuzhiyunDEPENDS = "libarchive"
12*4882a593Smuzhiyun
13*4882a593SmuzhiyunPE = "1"
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunSRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \
16*4882a593Smuzhiyun           file://opkg.conf \
17*4882a593Smuzhiyun           file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \
18*4882a593Smuzhiyun           file://run-ptest \
19*4882a593Smuzhiyun"
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunSRC_URI[sha256sum] = "559c3e1b893abaa1dd473ce3a9a5f7dd3f60ceb6cd14caaef76ddf0f7721ad1c"
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun# This needs to be before ptest inherit, otherwise all ptest files end packaged
24*4882a593Smuzhiyun# in libopkg package if OPKGLIBDIR == libdir, because default
25*4882a593Smuzhiyun# PTEST_PATH ?= "${libdir}/${BPN}/ptest"
26*4882a593SmuzhiyunPACKAGES =+ "libopkg"
27*4882a593Smuzhiyun
28*4882a593Smuzhiyuninherit autotools pkgconfig ptest
29*4882a593Smuzhiyun
30*4882a593Smuzhiyuntarget_localstatedir := "${localstatedir}"
31*4882a593SmuzhiyunOPKGLIBDIR ??= "${target_localstatedir}/lib"
32*4882a593Smuzhiyun
33*4882a593SmuzhiyunPACKAGECONFIG ??= "libsolv"
34*4882a593Smuzhiyun
35*4882a593SmuzhiyunPACKAGECONFIG[gpg] = "--enable-gpg,--disable-gpg,\
36*4882a593Smuzhiyun    gnupg gpgme libgpg-error,\
37*4882a593Smuzhiyun    ${@ "gnupg" if ("native" in d.getVar("PN")) else "gnupg-gpg"}\
38*4882a593Smuzhiyun    "
39*4882a593SmuzhiyunPACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl"
40*4882a593SmuzhiyunPACKAGECONFIG[ssl-curl] = "--enable-ssl-curl,--disable-ssl-curl,curl openssl"
41*4882a593SmuzhiyunPACKAGECONFIG[sha256] = "--enable-sha256,--disable-sha256"
42*4882a593SmuzhiyunPACKAGECONFIG[libsolv] = "--with-libsolv,--without-libsolv,libsolv"
43*4882a593Smuzhiyun
44*4882a593SmuzhiyunEXTRA_OECONF:class-native = "--localstatedir=/${@os.path.relpath('${localstatedir}', '${STAGING_DIR_NATIVE}')} --sysconfdir=/${@os.path.relpath('${sysconfdir}', '${STAGING_DIR_NATIVE}')}"
45*4882a593Smuzhiyun
46*4882a593Smuzhiyundo_install:append () {
47*4882a593Smuzhiyun	install -d ${D}${sysconfdir}/opkg
48*4882a593Smuzhiyun	install -m 0644 ${WORKDIR}/opkg.conf ${D}${sysconfdir}/opkg/opkg.conf
49*4882a593Smuzhiyun	echo "option lists_dir   ${OPKGLIBDIR}/opkg/lists"  >>${D}${sysconfdir}/opkg/opkg.conf
50*4882a593Smuzhiyun	echo "option info_dir    ${OPKGLIBDIR}/opkg/info"   >>${D}${sysconfdir}/opkg/opkg.conf
51*4882a593Smuzhiyun	echo "option status_file ${OPKGLIBDIR}/opkg/status" >>${D}${sysconfdir}/opkg/opkg.conf
52*4882a593Smuzhiyun
53*4882a593Smuzhiyun	# We need to create the lock directory
54*4882a593Smuzhiyun	install -d ${D}${OPKGLIBDIR}/opkg
55*4882a593Smuzhiyun}
56*4882a593Smuzhiyun
57*4882a593Smuzhiyundo_install_ptest () {
58*4882a593Smuzhiyun	sed -i -e '/@echo $^/d' ${D}${PTEST_PATH}/tests/Makefile
59*4882a593Smuzhiyun	sed -i -e '/@PYTHONPATH=. $(PYTHON) $^/a\\t@if [ "$$?" != "0" ];then echo "FAIL:"$^;else echo "PASS:"$^;fi' ${D}${PTEST_PATH}/tests/Makefile
60*4882a593Smuzhiyun}
61*4882a593Smuzhiyun
62*4882a593SmuzhiyunRDEPENDS:${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-arch-config libarchive"
63*4882a593SmuzhiyunRDEPENDS:${PN}:class-native = ""
64*4882a593SmuzhiyunRDEPENDS:${PN}:class-nativesdk = ""
65*4882a593SmuzhiyunRDEPENDS:${PN}-ptest += "make binutils python3-core python3-compression"
66*4882a593SmuzhiyunRREPLACES:${PN} = "opkg-nogpg opkg-collateral"
67*4882a593SmuzhiyunRCONFLICTS:${PN} = "opkg-collateral"
68*4882a593SmuzhiyunRPROVIDES:${PN} = "opkg-collateral"
69*4882a593Smuzhiyun
70*4882a593SmuzhiyunFILES:libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/"
71*4882a593Smuzhiyun
72*4882a593SmuzhiyunBBCLASSEXTEND = "native nativesdk"
73*4882a593Smuzhiyun
74*4882a593SmuzhiyunCONFFILES:${PN} = "${sysconfdir}/opkg/opkg.conf"
75