diff options
Diffstat (limited to 'meta/recipes-devtools/opkg')
17 files changed, 380 insertions, 0 deletions
diff --git a/meta/recipes-devtools/opkg/opkg-0.1.8/add_vercmp.patch b/meta/recipes-devtools/opkg/opkg-0.1.8/add_vercmp.patch new file mode 100644 index 0000000000..540be83950 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg-0.1.8/add_vercmp.patch @@ -0,0 +1,34 @@ +Index: trunk/libopkg/opkg.c +=================================================================== +--- trunk.orig/libopkg/opkg.c 2010-01-26 20:32:19.000000000 +0000 ++++ trunk/libopkg/opkg.c 2010-01-26 20:40:34.000000000 +0000 +@@ -876,3 +876,18 @@ + + return ret; + } ++ ++int ++opkg_compare_versions (const char *ver1, const char *ver2) ++{ ++ pkg_t *pkg1, *pkg2; ++ ++ pkg1 = pkg_new(); ++ pkg2 = pkg_new(); ++ ++ parse_version(pkg1, ver1); ++ parse_version(pkg2, ver2); ++ ++ return pkg_compare_versions(pkg1, pkg2); ++} ++ +Index: trunk/libopkg/opkg.h +=================================================================== +--- trunk.orig/libopkg/opkg.h 2010-01-26 20:32:19.000000000 +0000 ++++ trunk/libopkg/opkg.h 2010-01-26 20:35:19.000000000 +0000 +@@ -58,4 +58,6 @@ + + int opkg_repository_accessibility_check(void); + ++int opkg_compare_versions (const char *ver1, const char *ver2); ++ + #endif /* OPKG_H */ diff --git a/meta/recipes-devtools/opkg/opkg-0.1.8/headerfix.patch b/meta/recipes-devtools/opkg/opkg-0.1.8/headerfix.patch new file mode 100644 index 0000000000..d0711ecd0e --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg-0.1.8/headerfix.patch @@ -0,0 +1,17 @@ +Without this, the FILE reference in this header can cause compile issues. + +RP - 29/1/10 + +Index: trunk/libopkg/pkg_dest.h +=================================================================== +--- trunk.orig/libopkg/pkg_dest.h 2010-01-29 09:37:22.000000000 +0000 ++++ trunk/libopkg/pkg_dest.h 2010-01-29 09:37:33.000000000 +0000 +@@ -18,6 +18,8 @@ + #ifndef PKG_DEST_H + #define PKG_DEST_H + ++#include <stdio.h> ++ + typedef struct pkg_dest pkg_dest_t; + struct pkg_dest + { diff --git a/meta/recipes-devtools/opkg/opkg-0.1.8/opkg_unarchive.patch b/meta/recipes-devtools/opkg/opkg-0.1.8/opkg_unarchive.patch new file mode 100644 index 0000000000..4b12448155 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg-0.1.8/opkg_unarchive.patch @@ -0,0 +1,17 @@ +Rebase for the latest version +Dongxiao Xu <dongxiao.xu@intel.com> + +diff -ruN opkg-0.1.8-orig/libbb/unarchive.c opkg-0.1.8/libbb/unarchive.c +--- opkg-0.1.8-orig/libbb/unarchive.c 2010-07-20 09:39:02.266424893 +0800 ++++ opkg-0.1.8/libbb/unarchive.c 2010-07-20 09:39:50.474435569 +0800 +@@ -523,6 +523,10 @@ + } + } + ++ if (strlen(tar_entry->name) > 100) { ++ tar_entry->name[100] = 0; ++ } ++ + // tar_entry->name = xstrdup(tar.formated.name); + + /* diff --git a/meta/recipes-devtools/opkg/opkg-collateral.bb b/meta/recipes-devtools/opkg/opkg-collateral.bb new file mode 100644 index 0000000000..79c741d7be --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg-collateral.bb @@ -0,0 +1,22 @@ +DESCRIPTION = "opkg configuration files" +SECTION = "base" +LICENSE = "MIT" + +SRC_URI = "file://opkg.conf.comments \ + file://lists \ + file://dest \ + file://src " + +do_compile () { + cat ${WORKDIR}/opkg.conf.comments >${WORKDIR}/opkg.conf + cat ${WORKDIR}/src >>${WORKDIR}/opkg.conf + cat ${WORKDIR}/dest >>${WORKDIR}/opkg.conf + cat ${WORKDIR}/lists >>${WORKDIR}/opkg.conf +} + +do_install () { + install -d ${D}${sysconfdir}/ + install -m 0644 ${WORKDIR}/opkg.conf ${D}${sysconfdir}/opkg.conf +} + +CONFFILES_${PN} = "${sysconfdir}/opkg.conf" diff --git a/meta/recipes-devtools/opkg/opkg-collateral/dest b/meta/recipes-devtools/opkg/opkg-collateral/dest new file mode 100644 index 0000000000..088ca403da --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg-collateral/dest @@ -0,0 +1 @@ +dest root / diff --git a/meta/recipes-devtools/opkg/opkg-collateral/lists b/meta/recipes-devtools/opkg/opkg-collateral/lists new file mode 100644 index 0000000000..3c524f8c77 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg-collateral/lists @@ -0,0 +1,2 @@ +lists_dir ext /var/lib/ipkg + diff --git a/meta/recipes-devtools/opkg/opkg-collateral/opkg.conf.comments b/meta/recipes-devtools/opkg/opkg-collateral/opkg.conf.comments new file mode 100644 index 0000000000..51623f4d53 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg-collateral/opkg.conf.comments @@ -0,0 +1,23 @@ +# Must have one or more source entries of the form: +# +# src <src-name> <source-url> +# +# and one or more destination entries of the form: +# +# dest <dest-name> <target-path> +# +# where <src-name> and <dest-names> are identifiers that +# should match [a-zA-Z0-9._-]+, <source-url> should be a +# URL that points to a directory containing a Familiar +# Packages file, and <target-path> should be a directory +# that exists on the target system. + +# Proxy Support +#option http_proxy http://proxy.tld:3128 +#option ftp_proxy http://proxy.tld:3128 +#option proxy_username <username> +#option proxy_password <password> + +# Offline mode (for use in constructing flash images offline) +#option offline_root target + diff --git a/meta/recipes-devtools/opkg/opkg-collateral/src b/meta/recipes-devtools/opkg/opkg-collateral/src new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg-collateral/src diff --git a/meta/recipes-devtools/opkg/opkg-config-base_1.0.bb b/meta/recipes-devtools/opkg/opkg-config-base_1.0.bb new file mode 100644 index 0000000000..9e27e9343f --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg-config-base_1.0.bb @@ -0,0 +1,29 @@ +DESCRIPTION = "Base configuration files for opkg" +LICENSE = "MIT" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +do_compile() { + mkdir -p ${S}/${sysconfdir}/opkg/ + + archconf=${S}/${sysconfdir}/opkg/arch.conf + + rm -f $archconf + ipkgarchs="${PACKAGE_ARCHS}" + priority=1 + for arch in $ipkgarchs; do + echo "arch $arch $priority" >> $archconf + priority=$(expr $priority + 5) + done +} + + +do_install () { + install -d ${D}${sysconfdir}/opkg + install -m 0644 ${S}/${sysconfdir}/opkg/* ${D}${sysconfdir}/opkg/ +} + +FILES_${PN} = "${sysconfdir}/opkg/ " + +CONFFILES_${PN} += "${sysconfdir}/opkg/arch.conf" + diff --git a/meta/recipes-devtools/opkg/opkg-nogpg_0.1.8.bb b/meta/recipes-devtools/opkg/opkg-nogpg_0.1.8.bb new file mode 100644 index 0000000000..259a60ebc9 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg-nogpg_0.1.8.bb @@ -0,0 +1,8 @@ +require opkg_${PV}.bb + +DEPENDS = "curl" +PROVIDES += "opkg" + +EXTRA_OECONF += "--disable-gpg" + +DEFAULT_PREFERENCE = "-1" diff --git a/meta/recipes-devtools/opkg/opkg-nogpg_svn.bb b/meta/recipes-devtools/opkg/opkg-nogpg_svn.bb new file mode 100644 index 0000000000..aa16b551fe --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg-nogpg_svn.bb @@ -0,0 +1,10 @@ +require opkg_svn.bb + +DEPENDS = "curl" +PROVIDES += "opkg" + +SRCREV = "${SRCREV_pn-opkg}" + +EXTRA_OECONF += "--disable-gpg" + +DEFAULT_PREFERENCE = "-1" diff --git a/meta/recipes-devtools/opkg/opkg.inc b/meta/recipes-devtools/opkg/opkg.inc new file mode 100644 index 0000000000..add1563c47 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg.inc @@ -0,0 +1,33 @@ +DESCRIPTION = "Open Package Manager" +DESCRIPTION_libopkg = "Open Package Manager Library" +DESCRIPTION_update-alternatives-cworth = "Update alternatives" +SECTION = "base" +HOMEPAGE = "http://code.google.com/p/opkg/" +BUGTRACKER = "http://code.google.com/p/opkg/issues/list" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ + file://src/opkg-cl.c;beginline=1;endline=20;md5=321f658c3f6b6c832e25c8850b5dffba" +DEPENDS = "curl gpgme openssl" +DEPENDS_virtclass-native = "curl-native" +DEPENDS_virtclass-nativesdk = "curl-nativesdk" + +PE = "1" + +FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/opkg" + +# Werror gives all kinds bounds issuses with gcc 4.3.3 +do_configure_prepend() { + sed -i -e s:-Werror::g ${S}/libopkg/Makefile.am +} + +inherit autotools pkgconfig + +target_localstatedir := "${localstatedir}" +EXTRA_OECONF = "--with-opkglibdir=${localstatedir}/lib" +EXTRA_OECONF_virtclass-native = "--with-opkglibdir=${target_localstatedir}/lib --disable-gpg --disable-curl --disable-openssl" +EXTRA_OECONF_virtclass-nativesdk = "--with-opkglibdir=${target_localstatedir}/lib --disable-gpg --disable-curl --disable-openssl" + +#PROVIDES_append_virtclass-native = "virtual/update-alternatives-native" +#RPROVIDES_${PN} += "update-alternatives-native" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-devtools/opkg/opkg/add_vercmp.patch b/meta/recipes-devtools/opkg/opkg/add_vercmp.patch new file mode 100644 index 0000000000..540be83950 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/add_vercmp.patch @@ -0,0 +1,34 @@ +Index: trunk/libopkg/opkg.c +=================================================================== +--- trunk.orig/libopkg/opkg.c 2010-01-26 20:32:19.000000000 +0000 ++++ trunk/libopkg/opkg.c 2010-01-26 20:40:34.000000000 +0000 +@@ -876,3 +876,18 @@ + + return ret; + } ++ ++int ++opkg_compare_versions (const char *ver1, const char *ver2) ++{ ++ pkg_t *pkg1, *pkg2; ++ ++ pkg1 = pkg_new(); ++ pkg2 = pkg_new(); ++ ++ parse_version(pkg1, ver1); ++ parse_version(pkg2, ver2); ++ ++ return pkg_compare_versions(pkg1, pkg2); ++} ++ +Index: trunk/libopkg/opkg.h +=================================================================== +--- trunk.orig/libopkg/opkg.h 2010-01-26 20:32:19.000000000 +0000 ++++ trunk/libopkg/opkg.h 2010-01-26 20:35:19.000000000 +0000 +@@ -58,4 +58,6 @@ + + int opkg_repository_accessibility_check(void); + ++int opkg_compare_versions (const char *ver1, const char *ver2); ++ + #endif /* OPKG_H */ diff --git a/meta/recipes-devtools/opkg/opkg/headerfix.patch b/meta/recipes-devtools/opkg/opkg/headerfix.patch new file mode 100644 index 0000000000..d0711ecd0e --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/headerfix.patch @@ -0,0 +1,17 @@ +Without this, the FILE reference in this header can cause compile issues. + +RP - 29/1/10 + +Index: trunk/libopkg/pkg_dest.h +=================================================================== +--- trunk.orig/libopkg/pkg_dest.h 2010-01-29 09:37:22.000000000 +0000 ++++ trunk/libopkg/pkg_dest.h 2010-01-29 09:37:33.000000000 +0000 +@@ -18,6 +18,8 @@ + #ifndef PKG_DEST_H + #define PKG_DEST_H + ++#include <stdio.h> ++ + typedef struct pkg_dest pkg_dest_t; + struct pkg_dest + { diff --git a/meta/recipes-devtools/opkg/opkg/logfix.patch b/meta/recipes-devtools/opkg/opkg/logfix.patch new file mode 100644 index 0000000000..da06f00bd0 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg/logfix.patch @@ -0,0 +1,23 @@ +Patch to remove "duplicate" bits of logs from opkg output, which +massively simplifies do_rootfs logs. The reason is we get unflushed +data passed to the children and duplicated. + +RP - 26/1/10 + +Index: trunk/libbb/gz_open.c +=================================================================== +--- trunk.orig/libbb/gz_open.c 2010-01-26 23:12:10.000000000 +0000 ++++ trunk/libbb/gz_open.c 2010-01-26 23:12:17.000000000 +0000 +@@ -38,6 +38,12 @@ + perror_msg("pipe"); + return(NULL); + } ++ ++ /* If we don't flush, we end up with two copies of anything pending, ++ one from the parent, one from the child */ ++ fflush(stdout); ++ fflush(stderr); ++ + if ((*pid = fork()) == -1) { + perror_msg("fork"); + return(NULL); diff --git a/meta/recipes-devtools/opkg/opkg_0.1.8.bb b/meta/recipes-devtools/opkg/opkg_0.1.8.bb new file mode 100644 index 0000000000..4eb3ff9a11 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg_0.1.8.bb @@ -0,0 +1,53 @@ +require opkg.inc + +PROVIDES += "virtual/update-alternatives" +RPROVIDES_update-alternatives-cworth += "update-alternatives" +RCONFLICTS_update-alternatives-cworth = "update-alternatives-dpkg" +RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-config-base" +RDEPENDS_${PN}_virtclass-native = "" +RDEPENDS_${PN}_virtclass-nativesdk = "" +PACKAGE_ARCH_update-alternatives-cworth = "all" + +SRC_URI = "http://opkg.googlecode.com/files/opkg-${PV}.tar.gz \ + file://add_vercmp.patch \ + file://headerfix.patch \ +" + +PR = "r3" + +PACKAGES =+ "libopkg-dev libopkg update-alternatives-cworth" + +FILES_update-alternatives-cworth = "${bindir}/update-alternatives" +FILES_libopkg-dev = "${libdir}/*.a ${libdir}/*.la ${libdir}/*.so" +FILES_libopkg = "${libdir}/*.so.* ${localstatedir}/lib/opkg/" + +# We need to create the lock directory +do_install_append() { + install -d ${D}${localstatedir}/lib/opkg +} + +# Define a variable to allow distros to run configure earlier. +# (for example, to enable loading of ethernet kernel modules before networking starts) +OPKG_INIT_POSITION = "98" +OPKG_INIT_POSITION_slugos = "41" + +pkg_postinst_${PN} () { +#!/bin/sh +if [ "x$D" != "x" ]; then + install -d ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d + # this happens at S98 where our good 'ole packages script used to run + echo "#!/bin/sh +opkg-cl configure +rm -f /${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure +" > $D${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure + chmod 0755 $D${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure +fi + +update-alternatives --install ${bindir}/opkg opkg ${bindir}/opkg-cl 100 +} + +pkg_postrm_${PN} () { +#!/bin/sh +update-alternatives --remove opkg ${bindir}/opkg-cl +} + diff --git a/meta/recipes-devtools/opkg/opkg_svn.bb b/meta/recipes-devtools/opkg/opkg_svn.bb new file mode 100644 index 0000000000..518c767354 --- /dev/null +++ b/meta/recipes-devtools/opkg/opkg_svn.bb @@ -0,0 +1,57 @@ +require opkg.inc + +PROVIDES += "virtual/update-alternatives" +RPROVIDES_update-alternatives-cworth += "update-alternatives" +RCONFLICTS_update-alternatives-cworth = "update-alternatives-dpkg" +RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-config-base" +RDEPENDS_${PN}_virtclass-native = "" +RDEPENDS_${PN}_virtclass-nativesdk = "" +PACKAGE_ARCH_update-alternatives-cworth = "all" + +SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;proto=http \ + file://opkg_unarchive.patch \ + file://add_vercmp.patch \ + file://headerfix.patch \ + file://logfix.patch" + +S = "${WORKDIR}/trunk" + +PV = "0.0+svnr${SRCREV}" +PR = "r15" + +PACKAGES =+ "libopkg-dev libopkg update-alternatives-cworth" + +FILES_update-alternatives-cworth = "${bindir}/update-alternatives" +FILES_libopkg-dev = "${libdir}/*.a ${libdir}/*.la ${libdir}/*.so" +FILES_libopkg = "${libdir}/*.so.* ${localstatedir}/lib/opkg/" + +# We need to create the lock directory +do_install_append() { + install -d ${D}${localstatedir}/lib/opkg +} + +# Define a variable to allow distros to run configure earlier. +# (for example, to enable loading of ethernet kernel modules before networking starts) +OPKG_INIT_POSITION = "98" +OPKG_INIT_POSITION_slugos = "41" + +pkg_postinst_${PN} () { +#!/bin/sh +if [ "x$D" != "x" ]; then + install -d ${IMAGE_ROOTFS}/${sysconfdir}/rcS.d + # this happens at S98 where our good 'ole packages script used to run + echo "#!/bin/sh +opkg-cl configure +rm -f /${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure +" > $D${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure + chmod 0755 $D${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure +fi + +update-alternatives --install ${bindir}/opkg opkg ${bindir}/opkg-cl 100 +} + +pkg_postrm_${PN} () { +#!/bin/sh +update-alternatives --remove opkg ${bindir}/opkg-cl +} + |