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-collateral.bb24
-rw-r--r--meta/recipes-devtools/opkg/opkg-collateral/dest1
-rw-r--r--meta/recipes-devtools/opkg/opkg-collateral/opkg.conf.comments26
-rw-r--r--meta/recipes-devtools/opkg/opkg-collateral/src0
-rw-r--r--meta/recipes-devtools/opkg/opkg-config-base_1.0.bb30
-rw-r--r--meta/recipes-devtools/opkg/opkg.inc107
-rw-r--r--meta/recipes-devtools/opkg/opkg/add-exclude.patch112
-rw-r--r--meta/recipes-devtools/opkg/opkg/no-install-recommends.patch78
-rw-r--r--meta/recipes-devtools/opkg/opkg/opkg-configure.service17
-rw-r--r--meta/recipes-devtools/opkg/opkg_svn.bb14
10 files changed, 409 insertions, 0 deletions
diff --git a/meta/recipes-devtools/opkg/opkg-collateral.bb b/meta/recipes-devtools/opkg/opkg-collateral.bb
new file mode 100644
index 0000000000..cacd8800e9
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg-collateral.bb
@@ -0,0 +1,24 @@
1DESCRIPTION = "opkg configuration files"
2SECTION = "base"
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
5PR = "r2"
6
7SRC_URI = "file://opkg.conf.comments \
8 file://dest \
9 file://src "
10
11OPKGLIBDIR = "${localstatedir}/lib"
12do_compile () {
13 cat ${WORKDIR}/opkg.conf.comments >${WORKDIR}/opkg.conf
14 cat ${WORKDIR}/src >>${WORKDIR}/opkg.conf
15 cat ${WORKDIR}/dest >>${WORKDIR}/opkg.conf
16 echo "lists_dir ext ${OPKGLIBDIR}/opkg" >>${WORKDIR}/opkg.conf
17}
18
19do_install () {
20 install -d ${D}${sysconfdir}/opkg
21 install -m 0644 ${WORKDIR}/opkg.conf ${D}${sysconfdir}/opkg/opkg.conf
22}
23
24CONFFILES_${PN} = "${sysconfdir}/opkg/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/opkg.conf.comments b/meta/recipes-devtools/opkg/opkg-collateral/opkg.conf.comments
new file mode 100644
index 0000000000..e1fdada9b5
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg-collateral/opkg.conf.comments
@@ -0,0 +1,26 @@
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# Enable GPGME signature
22# option check_signature 1
23
24# Offline mode (for use in constructing flash images offline)
25#option offline_root target
26
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..f40e981126
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg-config-base_1.0.bb
@@ -0,0 +1,30 @@
1DESCRIPTION = "Base configuration files for opkg"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4PACKAGE_ARCH = "${MACHINE_ARCH}"
5PR = "r1"
6
7do_compile() {
8 mkdir -p ${S}/${sysconfdir}/opkg/
9
10 archconf=${S}/${sysconfdir}/opkg/arch.conf
11
12 rm -f $archconf
13 ipkgarchs="${ALL_MULTILIB_PACKAGE_ARCHS}"
14 priority=1
15 for arch in $ipkgarchs; do
16 echo "arch $arch $priority" >> $archconf
17 priority=$(expr $priority + 5)
18 done
19}
20
21
22do_install () {
23 install -d ${D}${sysconfdir}/opkg
24 install -m 0644 ${S}/${sysconfdir}/opkg/* ${D}${sysconfdir}/opkg/
25}
26
27FILES_${PN} = "${sysconfdir}/opkg/ "
28
29CONFFILES_${PN} += "${sysconfdir}/opkg/arch.conf"
30
diff --git a/meta/recipes-devtools/opkg/opkg.inc b/meta/recipes-devtools/opkg/opkg.inc
new file mode 100644
index 0000000000..3d568867d4
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg.inc
@@ -0,0 +1,107 @@
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"
10
11PE = "1"
12INC_PR = "r13"
13
14# Werror gives all kinds bounds issuses with gcc 4.3.3
15do_configure_prepend() {
16 sed -i -e s:-Werror::g ${S}/libopkg/Makefile.am
17}
18
19inherit autotools pkgconfig systemd
20
21python () {
22 if 'sysvinit' not in d.getVar("DISTRO_FEATURES", True).split():
23 pn = d.getVar('PN', True)
24 d.setVar('SYSTEMD_SERVICE_%s' % (pn), 'opkg-configure.service')
25}
26
27target_localstatedir := "${localstatedir}"
28OPKGLIBDIR = "${target_localstatedir}/lib"
29
30SHARED_EXTRA_OECONF = "\
31 --with-opkglibdir=${OPKGLIBDIR} \
32 --disable-gpg \
33 --disable-curl \
34 --disable-openssl \
35"
36EXTRA_OECONF_class-target = "${SHARED_EXTRA_OECONF} --disable-ssl-curl --disable-sha256"
37EXTRA_OECONF_class-native = "${SHARED_EXTRA_OECONF}"
38EXTRA_OECONF_class-nativesdk = "${SHARED_EXTRA_OECONF}"
39
40PROVIDES += "virtual/update-alternatives"
41RPROVIDES_update-alternatives-cworth += "update-alternatives"
42RCONFLICTS_update-alternatives-cworth = "update-alternatives-dpkg"
43RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-config-base"
44RDEPENDS_${PN}_class-native = ""
45RDEPENDS_${PN}_class-nativesdk = ""
46RREPLACES_${PN} = "opkg-nogpg"
47
48PACKAGES =+ "libopkg-dev libopkg-staticdev libopkg update-alternatives-cworth"
49
50FILES_update-alternatives-cworth = "${bindir}/update-alternatives"
51FILES_libopkg-dev = "${libdir}/*.la ${libdir}/*.so ${includedir}/libopkg"
52FILES_libopkg-staticdev = "${libdir}/*.a"
53FILES_libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/"
54
55do_install_append() {
56 # We need to create the lock directory
57 install -d ${D}${OPKGLIBDIR}/opkg
58
59 if ${@base_contains('DISTRO_FEATURES','sysvinit','false','true',d)};then
60 install -d ${D}${systemd_unitdir}/system
61 install -m 0644 ${WORKDIR}/opkg-configure.service ${D}${systemd_unitdir}/system/
62 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
63 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
64 -e 's,@BINDIR@,${bindir},g' \
65 -e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
66 ${D}${systemd_unitdir}/system/opkg-configure.service
67 fi
68}
69
70do_install_append_class-native() {
71 if [ "${PREFERRED_PROVIDER_virtual/update-alternatives-native}" != "${PN}" ]; then
72 rm ${D}${bindir}/update-alternatives
73 fi
74}
75
76pkg_postinst_${PN} () {
77#!/bin/sh
78if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)} && \
79 [ "x$D" != "x" ] && [ -f $D${OPKGLIBDIR}/opkg/status ]; then
80 install -d $D${sysconfdir}/rcS.d
81
82 # this happens at S98 where our good 'ole packages script used to run
83 echo "#!/bin/sh
84[ -e ${sysconfdir}/default/postinst ] && . ${sysconfdir}/default/postinst
85if [ \"\$POSTINST_LOGGING\" = \"1\" ]; then
86 opkg-cl configure >\$LOGFILE 2>&1
87else
88 opkg-cl configure
89fi
90rm -f ${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
91" > $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
92 chmod 0755 $D${sysconfdir}/rcS.d/S${POSTINSTALL_INITPOSITION}run-postinsts
93fi
94}
95
96inherit update-alternatives
97
98ALTERNATIVE_PRIORITY = "100"
99ALTERNATIVE_${PN} = "opkg"
100ALTERNATIVE_LINK_NAME[opkg] = "${bindir}/opkg"
101ALTERNATIVE_TARGET[opkg] = "${bindir}/opkg-cl"
102
103BBCLASSEXTEND = "native nativesdk"
104
105# Define a variable to allow distros to run configure earlier.
106# (for example, to enable loading of ethernet kernel modules before networking starts)
107POSTINSTALL_INITPOSITION ?= "98"
diff --git a/meta/recipes-devtools/opkg/opkg/add-exclude.patch b/meta/recipes-devtools/opkg/opkg/add-exclude.patch
new file mode 100644
index 0000000000..8489058b9e
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/add-exclude.patch
@@ -0,0 +1,112 @@
1Add a way to exclude specific packages from the install
2
3When an excluded package is required by another package an error
4will be generated. If the excluded package is only recommended,
5no error will be generated.
6
7The lifespan of the exclude_list covers the execution of the process,
8so there is no need to free the data.
9
10Upstream-Status: Pending
11
12Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
13Signed-off-by: Jonathan Liu <net147@gmail.com>
14
15Index: trunk/libopkg/opkg_conf.c
16===================================================================
17--- trunk.orig/libopkg/opkg_conf.c
18+++ trunk/libopkg/opkg_conf.c
19@@ -442,6 +442,7 @@ opkg_conf_init(void)
20 pkg_dest_list_init(&conf->pkg_dest_list);
21 pkg_dest_list_init(&conf->tmp_dest_list);
22 nv_pair_list_init(&conf->arch_list);
23+ conf->exclude_list = NULL;
24
25 return 0;
26 }
27Index: trunk/libopkg/opkg_conf.h
28===================================================================
29--- trunk.orig/libopkg/opkg_conf.h
30+++ trunk/libopkg/opkg_conf.h
31@@ -49,6 +49,8 @@ struct opkg_conf
32 pkg_dest_list_t pkg_dest_list;
33 pkg_dest_list_t tmp_dest_list;
34 nv_pair_list_t arch_list;
35+ size_t exclude_count;
36+ char ** exclude_list;
37
38 int restrict_to_default_dest;
39 pkg_dest_t *default_dest;
40Index: trunk/libopkg/pkg_depends.c
41===================================================================
42--- trunk.orig/libopkg/pkg_depends.c
43+++ trunk/libopkg/pkg_depends.c
44@@ -212,6 +212,22 @@ pkg_hash_fetch_unsatisfied_dependencies(
45 continue;
46 }
47
48+ /* Check for excluded packages */
49+ if (satisfying_pkg != NULL && conf->exclude_list) {
50+ int i, exclude = 0;
51+ for (i = 0; i < conf->exclude_count; i++) {
52+ if (!strcmp(satisfying_pkg->name, conf->exclude_list[i])) {
53+ opkg_msg(NOTICE, "%s: exclude required package %s"
54+ "at users request\n",
55+ pkg->name, satisfying_pkg->name);
56+ exclude = 1;
57+ break;
58+ }
59+ }
60+ if (exclude)
61+ continue;
62+ }
63+
64 opkg_msg(DEBUG, "satisfying_pkg=%p\n", satisfying_pkg);
65 if (satisfying_pkg != NULL) {
66 satisfier_entry_pkg = satisfying_pkg;
67Index: trunk/src/opkg-cl.c
68===================================================================
69--- trunk.orig/src/opkg-cl.c
70+++ trunk/src/opkg-cl.c
71@@ -45,6 +45,7 @@ enum {
72 ARGS_OPT_PREFER_ARCH_TO_VERSION,
73 ARGS_OPT_ADD_ARCH,
74 ARGS_OPT_ADD_DEST,
75+ ARGS_OPT_ADD_EXCLUDE,
76 ARGS_OPT_NOACTION,
77 ARGS_OPT_DOWNLOAD_ONLY,
78 ARGS_OPT_NODEPS,
79@@ -95,6 +96,7 @@ static struct option long_options[] = {
80 {"offline-root", 1, 0, 'o'},
81 {"add-arch", 1, 0, ARGS_OPT_ADD_ARCH},
82 {"add-dest", 1, 0, ARGS_OPT_ADD_DEST},
83+ {"add-exclude", 1, 0, ARGS_OPT_ADD_EXCLUDE},
84 {"test", 0, 0, ARGS_OPT_NOACTION},
85 {"tmp-dir", 1, 0, 't'},
86 {"tmp_dir", 1, 0, 't'},
87@@ -198,6 +200,17 @@ args_parse(int argc, char *argv[])
88 }
89 free(tuple);
90 break;
91+ case ARGS_OPT_ADD_EXCLUDE:
92+ tuple = xstrdup(optarg);
93+ if (!conf->exclude_list) {
94+ conf->exclude_count = 1;
95+ conf->exclude_list = malloc(sizeof(char *) * conf->exclude_count);
96+ conf->exclude_list[conf->exclude_count - 1] = tuple;
97+ } else {
98+ conf->exclude_count++;
99+ conf->exclude_list = realloc(conf->exclude_list, sizeof(char *) * conf->exclude_count);
100+ conf->exclude_list[conf->exclude_count - 1] = tuple;
101+ }
102 case ARGS_OPT_NOACTION:
103 conf->noaction = 1;
104 break;
105@@ -282,6 +295,7 @@ usage()
106 printf("\t--offline-root <dir> offline installation of packages.\n");
107 printf("\t--add-arch <arch>:<prio> Register architecture with given priority\n");
108 printf("\t--add-dest <name>:<path> Register destination with given path\n");
109+ printf("\t--add-exclude <name> Register package to be excluded from install\n");
110 printf("\t--prefer-arch-to-version\t Use the architecture priority package rather\n");
111 printf("\t than the higher version one if more\n");
112 printf("\t than one candidate is found.\n");
diff --git a/meta/recipes-devtools/opkg/opkg/no-install-recommends.patch b/meta/recipes-devtools/opkg/opkg/no-install-recommends.patch
new file mode 100644
index 0000000000..6d1ccecbf4
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/no-install-recommends.patch
@@ -0,0 +1,78 @@
1Add the ability to not install ANY recommended packages.
2
3Upstream-Status: Pending
4
5Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
6
7Index: trunk/libopkg/opkg_conf.h
8===================================================================
9--- trunk.orig/libopkg/opkg_conf.h
10+++ trunk/libopkg/opkg_conf.h
11@@ -80,6 +80,7 @@ struct opkg_conf
12 int prefer_arch_to_version;
13 int check_signature;
14 int nodeps; /* do not follow dependencies */
15+ int noinstall_recommends;
16 char *offline_root;
17 char *overlay_root;
18 int query_all;
19Index: trunk/libopkg/pkg_depends.c
20===================================================================
21--- trunk.orig/libopkg/pkg_depends.c
22+++ trunk/libopkg/pkg_depends.c
23@@ -19,6 +19,7 @@
24 #include <ctype.h>
25
26 #include "pkg.h"
27+#include "opkg_conf.h"
28 #include "opkg_utils.h"
29 #include "pkg_hash.h"
30 #include "opkg_message.h"
31@@ -204,7 +205,7 @@ pkg_hash_fetch_unsatisfied_dependencies(
32 /* user request overrides package recommendation */
33 if (satisfying_pkg != NULL
34 && (compound_depend->type == RECOMMEND || compound_depend->type == SUGGEST)
35- && (satisfying_pkg->state_want == SW_DEINSTALL || satisfying_pkg->state_want == SW_PURGE)) {
36+ && (satisfying_pkg->state_want == SW_DEINSTALL || satisfying_pkg->state_want == SW_PURGE || conf->noinstall_recommends)) {
37 opkg_msg(NOTICE, "%s: ignoring recommendation for "
38 "%s at user request\n",
39 pkg->name, satisfying_pkg->name);
40Index: trunk/src/opkg-cl.c
41===================================================================
42--- trunk.orig/src/opkg-cl.c
43+++ trunk/src/opkg-cl.c
44@@ -50,6 +50,7 @@ enum {
45 ARGS_OPT_NODEPS,
46 ARGS_OPT_AUTOREMOVE,
47 ARGS_OPT_CACHE,
48+ ARGS_OPT_NOINSTALL_RECOMMENDS,
49 };
50
51 static struct option long_options[] = {
52@@ -89,6 +90,7 @@ static struct option long_options[] = {
53 {"noaction", 0, 0, ARGS_OPT_NOACTION},
54 {"download-only", 0, 0, ARGS_OPT_DOWNLOAD_ONLY},
55 {"nodeps", 0, 0, ARGS_OPT_NODEPS},
56+ {"no-install-recommends", 0, 0, ARGS_OPT_NOINSTALL_RECOMMENDS},
57 {"offline", 1, 0, 'o'},
58 {"offline-root", 1, 0, 'o'},
59 {"add-arch", 1, 0, ARGS_OPT_ADD_ARCH},
60@@ -199,6 +201,9 @@ args_parse(int argc, char *argv[])
61 case ARGS_OPT_NOACTION:
62 conf->noaction = 1;
63 break;
64+ case ARGS_OPT_NOINSTALL_RECOMMENDS:
65+ conf->noinstall_recommends = 1;
66+ break;
67 case ARGS_OPT_DOWNLOAD_ONLY:
68 conf->download_only = 1;
69 break;
70@@ -293,6 +298,8 @@ usage()
71 printf("\t--noaction No action -- test only\n");
72 printf("\t--download-only No action -- download only\n");
73 printf("\t--nodeps Do not follow dependencies\n");
74+ printf("\t--no-install-recommends\n");
75+ printf("\t Do not install any recommended packages\n");
76 printf("\t--force-removal-of-dependent-packages\n");
77 printf("\t Remove package and all dependencies\n");
78 printf("\t--autoremove Remove packages that were installed\n");
diff --git a/meta/recipes-devtools/opkg/opkg/opkg-configure.service b/meta/recipes-devtools/opkg/opkg/opkg-configure.service
new file mode 100644
index 0000000000..b18295b45e
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/opkg-configure.service
@@ -0,0 +1,17 @@
1[Unit]
2Description=Opkg first boot configure
3DefaultDependencies=no
4After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount
5Before=sysinit.target
6
7[Service]
8Type=oneshot
9EnvironmentFile=-@SYSCONFDIR@/default/postinst
10ExecStart=-@BASE_BINDIR@/sh -c " if [ $POSTINST_LOGGING = '1' ]; then @BINDIR@/opkg-cl configure > $LOGFILE 2>&1; else @BINDIR@/opkg-cl configure; fi"
11ExecStartPost=@BASE_BINDIR@/systemctl disable opkg-configure.service
12StandardOutput=syslog
13RemainAfterExit=No
14
15[Install]
16WantedBy=basic.target
17WantedBy=sysinit.target
diff --git a/meta/recipes-devtools/opkg/opkg_svn.bb b/meta/recipes-devtools/opkg/opkg_svn.bb
new file mode 100644
index 0000000000..cd0485fe38
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg_svn.bb
@@ -0,0 +1,14 @@
1require opkg.inc
2
3SRC_URI = "svn://opkg.googlecode.com/svn;module=trunk;protocol=http \
4 file://no-install-recommends.patch \
5 file://add-exclude.patch \
6 file://opkg-configure.service \
7"
8
9S = "${WORKDIR}/trunk"
10
11SRCREV = "653"
12PV = "0.1.8+svnr${SRCPV}"
13
14PR = "${INC_PR}.0"