diff options
Diffstat (limited to 'poky/meta/recipes-devtools/opkg')
6 files changed, 237 insertions, 0 deletions
diff --git a/poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb b/poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb new file mode 100644 index 000000000..0c2dbc9e3 --- /dev/null +++ b/poky/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb @@ -0,0 +1,35 @@ +SUMMARY = "Architecture-dependent configuration for opkg" +HOMEPAGE = "http://code.google.com/p/opkg/" +LICENSE = "MIT" +PACKAGE_ARCH = "${MACHINE_ARCH}" +PR = "r1" + +S = "${WORKDIR}" + +do_compile() { + mkdir -p ${S}/${sysconfdir}/opkg/ + + archconf=${S}/${sysconfdir}/opkg/arch.conf + + rm -f $archconf + ipkgarchs="${ALL_MULTILIB_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" + +RREPLACES_${PN} = "opkg-config-base" +RCONFLICTS_${PN} = "opkg-config-base" +RPROVIDES_${PN} = "opkg-config-base" diff --git a/poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb b/poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb new file mode 100644 index 000000000..18d6abdde --- /dev/null +++ b/poky/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb @@ -0,0 +1,48 @@ +SUMMARY = "Keyrings for verifying opkg packages and feeds" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +# Distro-specific keys can be added to this package in two ways: +# +# 1) In a .bbappend, add .gpg and/or .asc files to SRC_URI and install them to +# ${D}${datadir}/opkg/keyrings/ in a do_install_append function. These +# files should not be named 'key-$name.gpg' to ensure they don't conflict +# with keys exported as per (2). +# +# 2) In a .bbappend, distro config or local.conf, override the variable +# OPKG_KEYRING_KEYS to contain a space-separated list of key names. For +# each name, 'gpg --export $name' will be ran to export the public key to a +# file named 'key-$name.gpg'. The public key must therefore be in the gpg +# keyrings on the build machine. + +OPKG_KEYRING_KEYS ?= "" + +do_compile() { + for name in ${OPKG_KEYRING_KEYS}; do + gpg --export ${name} > ${B}/key-${name}.gpg + done +} + +do_install () { + install -d ${D}${datadir}/opkg/keyrings/ + for name in ${OPKG_KEYRING_KEYS}; do + install -m 0644 ${B}/key-${name}.gpg ${D}${datadir}/opkg/keyrings/ + done +} + +FILES_${PN} = "${datadir}/opkg/keyrings" + +# We need 'opkg-key' to run the postinst script +RDEPENDS_${PN} = "opkg" + +pkg_postinst_${PN} () { +#! /bin/sh +set -e + +if [ x"$D" = "x" ]; then + # On target + opkg-key populate +else + exit 1 +fi +} diff --git a/poky/meta/recipes-devtools/opkg/opkg/0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch b/poky/meta/recipes-devtools/opkg/opkg/0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch new file mode 100644 index 000000000..e94a4123d --- /dev/null +++ b/poky/meta/recipes-devtools/opkg/opkg/0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch @@ -0,0 +1,34 @@ +From a4628a6171f393add9a2b287483ca39bb72b4dd6 Mon Sep 17 00:00:00 2001 +From: Jonathan Liu <net147@gmail.com> +Date: Mon, 21 Sep 2015 20:23:23 +1000 +Subject: [PATCH] opkg_conf: create opkg.lock in /run instead of /var/run + +This avoids a "Could not unlink" warning when extracting a /var/run +symbolic link pointing to /run from a package as it is unable to +unlink the /var/run directory when it contains opkg.lock. + +This also fixes an issue where /var/run is created as a directory +instead of a symbolic link to /run. + +Upstream-Status: Inappropriate [OE-Specific] +Signed-off-by: Jonathan Liu <net147@gmail.com> +--- + libopkg/opkg_conf.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libopkg/opkg_conf.h b/libopkg/opkg_conf.h +index 7bca948..5a1bc44 100644 +--- a/libopkg/opkg_conf.h ++++ b/libopkg/opkg_conf.h +@@ -40,7 +40,7 @@ extern "C" { + #define OPKG_CONF_DEFAULT_STATUS_FILE VARDIR "/lib/opkg/status" + #define OPKG_CONF_DEFAULT_CACHE_DIR VARDIR "/cache/opkg" + #define OPKG_CONF_DEFAULT_CONF_FILE_DIR SYSCONFDIR "/opkg" +-#define OPKG_CONF_DEFAULT_LOCK_FILE VARDIR "/run/opkg.lock" ++#define OPKG_CONF_DEFAULT_LOCK_FILE "/run/opkg.lock" + + /* In case the config file defines no dest */ + #define OPKG_CONF_DEFAULT_DEST_NAME "root" +-- +2.5.0 + diff --git a/poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service b/poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service new file mode 100644 index 000000000..432c3ddc2 --- /dev/null +++ b/poky/meta/recipes-devtools/opkg/opkg/opkg-configure.service @@ -0,0 +1,17 @@ +[Unit] +Description=Opkg first boot configure +DefaultDependencies=no +After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount +Before=sysinit.target + +[Service] +Type=oneshot +EnvironmentFile=-@SYSCONFDIR@/default/postinst +ExecStart=-@BASE_BINDIR@/sh -c " if [ $POSTINST_LOGGING = '1' ]; then @BINDIR@/opkg configure > $LOGFILE 2>&1; else @BINDIR@/opkg configure; fi" +ExecStartPost=@BASE_BINDIR@/systemctl --no-reload disable opkg-configure.service +StandardOutput=syslog +RemainAfterExit=No + +[Install] +WantedBy=basic.target +WantedBy=sysinit.target diff --git a/poky/meta/recipes-devtools/opkg/opkg/opkg.conf b/poky/meta/recipes-devtools/opkg/opkg/opkg.conf new file mode 100644 index 000000000..c2e9e92f9 --- /dev/null +++ b/poky/meta/recipes-devtools/opkg/opkg/opkg.conf @@ -0,0 +1,28 @@ +# 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> + +# Enable GPGME signature +# option check_signature 1 + +# Offline mode (for use in constructing flash images offline) +#option offline_root target + +# Default destination for installed packages +dest root / diff --git a/poky/meta/recipes-devtools/opkg/opkg_0.3.6.bb b/poky/meta/recipes-devtools/opkg/opkg_0.3.6.bb new file mode 100644 index 000000000..70f20af73 --- /dev/null +++ b/poky/meta/recipes-devtools/opkg/opkg_0.3.6.bb @@ -0,0 +1,75 @@ +SUMMARY = "Open Package Manager" +SUMMARY_libopkg = "Open Package Manager library" +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.c;beginline=2;endline=21;md5=90435a519c6ea69ef22e4a88bcc52fa0" + +DEPENDS = "libarchive" + +PE = "1" + +SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \ + file://opkg-configure.service \ + file://opkg.conf \ + file://0001-opkg_conf-create-opkg.lock-in-run-instead-of-var-run.patch \ +" + +SRC_URI[md5sum] = "79e04307f6f54db431c251772d7d987c" +SRC_URI[sha256sum] = "f607f0e61be8cf8a3bbd0d2dccd9ec9e9b6c21dd4307b671c600d6eeaf84d30b" + +inherit autotools pkgconfig systemd + +SYSTEMD_SERVICE_${PN} = "opkg-configure.service" + +target_localstatedir := "${localstatedir}" +OPKGLIBDIR = "${target_localstatedir}/lib" + +PACKAGECONFIG ??= "libsolv" + +PACKAGECONFIG[gpg] = "--enable-gpg,--disable-gpg,gpgme libgpg-error,gnupg" +PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl" +PACKAGECONFIG[ssl-curl] = "--enable-ssl-curl,--disable-ssl-curl,curl openssl" +PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl" +PACKAGECONFIG[sha256] = "--enable-sha256,--disable-sha256" +PACKAGECONFIG[pathfinder] = "--enable-pathfinder,--disable-pathfinder,pathfinder" +PACKAGECONFIG[libsolv] = "--with-libsolv,--without-libsolv,libsolv" + +EXTRA_OECONF_class-native = "--localstatedir=/${@os.path.relpath('${localstatedir}', '${STAGING_DIR_NATIVE}')} --sysconfdir=/${@os.path.relpath('${sysconfdir}', '${STAGING_DIR_NATIVE}')}" + +do_install_append () { + install -d ${D}${sysconfdir}/opkg + install -m 0644 ${WORKDIR}/opkg.conf ${D}${sysconfdir}/opkg/opkg.conf + echo "option lists_dir ${OPKGLIBDIR}/opkg/lists" >>${D}${sysconfdir}/opkg/opkg.conf + + # We need to create the lock directory + install -d ${D}${OPKGLIBDIR}/opkg + + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/opkg-configure.service ${D}${systemd_unitdir}/system/ + sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ + -e 's,@SYSCONFDIR@,${sysconfdir},g' \ + -e 's,@BINDIR@,${bindir},g' \ + -e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \ + ${D}${systemd_unitdir}/system/opkg-configure.service + fi +} + +RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-arch-config libarchive" +RDEPENDS_${PN}_class-native = "" +RDEPENDS_${PN}_class-nativesdk = "" +RREPLACES_${PN} = "opkg-nogpg opkg-collateral" +RCONFLICTS_${PN} = "opkg-collateral" +RPROVIDES_${PN} = "opkg-collateral" + +PACKAGES =+ "libopkg" + +FILES_libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/" +FILES_${PN} += "${systemd_unitdir}/system/" + +BBCLASSEXTEND = "native nativesdk" + +CONFFILES_${PN} = "${sysconfdir}/opkg/opkg.conf" |