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