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.inc76
-rw-r--r--meta/recipes-devtools/opkg/opkg/add-exclude.patch113
-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_0.2.1.bb12
10 files changed, 377 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..b121827ac7
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg-collateral.bb
@@ -0,0 +1,24 @@
1SUMMARY = "Constructs the main configuration file for opkg"
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..acbe1296bf
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg-config-base_1.0.bb
@@ -0,0 +1,30 @@
1SUMMARY = "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..9f87df551e
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg.inc
@@ -0,0 +1,76 @@
1SUMMARY = "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-cl.c;beginline=1;endline=20;md5=321f658c3f6b6c832e25c8850b5dffba"
9
10PE = "1"
11
12# Werror gives all kinds bounds issuses with gcc 4.3.3
13do_configure_prepend() {
14 sed -i -e s:-Werror::g ${S}/libopkg/Makefile.am
15}
16
17inherit autotools pkgconfig systemd
18
19python () {
20 if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
21 pn = d.getVar('PN', True)
22 d.setVar('SYSTEMD_SERVICE_%s' % (pn), 'opkg-configure.service')
23}
24
25target_localstatedir := "${localstatedir}"
26OPKGLIBDIR = "${target_localstatedir}/lib"
27
28PACKAGECONFIG ??= ""
29
30PACKAGECONFIG[gpg] = "--enable-gpg,--disable-gpg,gpgme libgpg-error"
31PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl"
32PACKAGECONFIG[ssl-curl] = "--enable-ssl-curl,--disable-ssl-curl,curl openssl"
33PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
34PACKAGECONFIG[sha256] = "--enable-sha256,--disable-sha256"
35PACKAGECONFIG[pathfinder] = "--enable-pathfinder,--disable-pathfinder,pathfinder"
36
37EXTRA_OECONF = "\
38 --with-opkglibdir=${OPKGLIBDIR} \
39"
40
41RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-config-base run-postinsts"
42RDEPENDS_${PN}_class-native = ""
43RDEPENDS_${PN}_class-nativesdk = ""
44RREPLACES_${PN} = "opkg-nogpg"
45
46PACKAGES =+ "libopkg-dev libopkg-staticdev libopkg"
47
48FILES_libopkg-dev = "${libdir}/*.la ${libdir}/*.so ${includedir}/libopkg"
49FILES_libopkg-staticdev = "${libdir}/*.a"
50FILES_libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/"
51FILES_${PN} += "${systemd_unitdir}/system/"
52
53do_install_append() {
54 # We need to create the lock directory
55 install -d ${D}${OPKGLIBDIR}/opkg
56
57 if ${@base_contains('DISTRO_FEATURES','sysvinit','false','true',d)};then
58 install -d ${D}${systemd_unitdir}/system
59 install -m 0644 ${WORKDIR}/opkg-configure.service ${D}${systemd_unitdir}/system/
60 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
61 -e 's,@SYSCONFDIR@,${sysconfdir},g' \
62 -e 's,@BINDIR@,${bindir},g' \
63 -e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
64 ${D}${systemd_unitdir}/system/opkg-configure.service
65 fi
66
67 # The installed binary is 'opkg-cl' but people and scripts often expect
68 # it to just be 'opkg'
69 ln -sf opkg-cl ${D}${bindir}/opkg
70}
71
72do_install_append() {
73 rm ${D}${bindir}/update-alternatives
74}
75
76BBCLASSEXTEND = "native nativesdk"
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..8d328d5b86
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/add-exclude.patch
@@ -0,0 +1,113 @@
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,18 @@ 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+ break;
103 case ARGS_OPT_NOACTION:
104 conf->noaction = 1;
105 break;
106@@ -282,6 +296,7 @@ usage()
107 printf("\t--offline-root <dir> offline installation of packages.\n");
108 printf("\t--add-arch <arch>:<prio> Register architecture with given priority\n");
109 printf("\t--add-dest <name>:<path> Register destination with given path\n");
110+ printf("\t--add-exclude <name> Register package to be excluded from install\n");
111 printf("\t--prefer-arch-to-version\t Use the architecture priority package rather\n");
112 printf("\t than the higher version one if more\n");
113 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_0.2.1.bb b/meta/recipes-devtools/opkg/opkg_0.2.1.bb
new file mode 100644
index 0000000000..09c0ccad4d
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg_0.2.1.bb
@@ -0,0 +1,12 @@
1require opkg.inc
2
3SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \
4 file://no-install-recommends.patch \
5 file://add-exclude.patch \
6 file://opkg-configure.service \
7"
8
9S = "${WORKDIR}/${BPN}-${PV}"
10
11SRC_URI[md5sum] = "1881d170b9dfbd7ecf0aa468cb9779c0"
12SRC_URI[sha256sum] = "43c2d95e4cd3ef5e341e233e63de78698ec7522bca446972963160bb0f1e62db"