summaryrefslogtreecommitdiff
path: root/system/apk-tools
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-06-14 02:22:19 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-06-14 02:22:56 -0500
commitb1eb50599e4db7eb4501af75cbbfa22007081ea5 (patch)
treec94a34c882cc17adedd781e8c5f34349b2a62416 /system/apk-tools
parentb9e85bbdcf38547ef2ca4e5c2a6e6293bbcd2752 (diff)
downloadpackages-b1eb50599e4db7eb4501af75cbbfa22007081ea5.tar.gz
packages-b1eb50599e4db7eb4501af75cbbfa22007081ea5.tar.bz2
packages-b1eb50599e4db7eb4501af75cbbfa22007081ea5.tar.xz
packages-b1eb50599e4db7eb4501af75cbbfa22007081ea5.zip
The New Plan
all pkgs needed to bootstrap -> system others -> user
Diffstat (limited to 'system/apk-tools')
-rw-r--r--system/apk-tools/0001-solver-allow-names-with-only-one-provider-to-be-auto.patch57
-rw-r--r--system/apk-tools/APKBUILD89
-rw-r--r--system/apk-tools/openssl-compat.patch11
3 files changed, 157 insertions, 0 deletions
diff --git a/system/apk-tools/0001-solver-allow-names-with-only-one-provider-to-be-auto.patch b/system/apk-tools/0001-solver-allow-names-with-only-one-provider-to-be-auto.patch
new file mode 100644
index 000000000..107676e93
--- /dev/null
+++ b/system/apk-tools/0001-solver-allow-names-with-only-one-provider-to-be-auto.patch
@@ -0,0 +1,57 @@
+From 0dcbd933c8d3d305395a99b7b1690a187ce5ec8c Mon Sep 17 00:00:00 2001
+From: William Pitcock <nenolod@dereferenced.org>
+Date: Wed, 21 Feb 2018 15:35:53 +0000
+Subject: [PATCH] solver: allow names with only one provider to be autoselected
+ regardless of priority
+
+---
+ src/solver.c | 5 +++--
+ test/provides.repo | 9 ++++++++-
+ 2 files changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/src/solver.c b/src/solver.c
+index 91e5958..d27a7a3 100644
+--- a/src/solver.c
++++ b/src/solver.c
+@@ -671,11 +671,12 @@ static void select_package(struct apk_solver_state *ss, struct apk_name *name)
+ (!p->pkg->ss.iif_triggered ||
+ !p->pkg->ss.tag_ok))
+ continue;
+- /* Virtual packages without provider_priority cannot be autoselected */
++ /* Virtual packages without provider_priority cannot be autoselected,
++ * unless there is only one provider */
+ if (p->version == &apk_null_blob &&
+ p->pkg->name->auto_select_virtual == 0 &&
+ p->pkg->name->ss.requirers == 0 &&
+- p->pkg->provider_priority == 0)
++ (p->pkg->provider_priority == 0 && name->providers->num > 1))
+ continue;
+ if (compare_providers(ss, p, &chosen) > 0)
+ chosen = *p;
+diff --git a/test/provides.repo b/test/provides.repo
+index 58bd416..358151e 100644
+--- a/test/provides.repo
++++ b/test/provides.repo
+@@ -82,7 +82,7 @@ P:conflicted-provider-b
+ V:0.1
+ S:1
+ I:1
+-p:conflicted-provider
++p:conflicted-provider conflicted-provider-2
+
+ C:Q1EyN5AdpAOBJWKMR89ppC66ccccj=
+ P:conflicted-dep
+@@ -104,3 +104,10 @@ V:0.1
+ S:1
+ I:1
+ p:self-provide
++
++C:Q1EyN5AdpAOBJWKMR89ppC66eeeej=
++P:conflicted-dep-2
++V:0.1
++S:1
++I:1
++D:conflicted-provider-2
+--
+2.16.1
+
diff --git a/system/apk-tools/APKBUILD b/system/apk-tools/APKBUILD
new file mode 100644
index 000000000..225d4c2f9
--- /dev/null
+++ b/system/apk-tools/APKBUILD
@@ -0,0 +1,89 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=apk-tools
+pkgver=2.9.1
+pkgrel=1
+pkgdesc="Alpine Package Keeper - package manager for alpine"
+subpackages="$pkgname-static"
+depends=
+makedepends_build=""
+makedepends_host="zlib-dev libressl libressl-dev linux-headers"
+makedepends="$makedepends_build $makedepends_host"
+if [ "$CBUILD" = "$CHOST" ]; then
+ subpackages="$subpackages lua5.2-apk:luaapk"
+ makedepends="$makedepends lua5.2-dev"
+fi
+source="http://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.xz
+ 0001-solver-allow-names-with-only-one-provider-to-be-auto.patch
+ openssl-compat.patch
+ "
+
+url="https://git.alpinelinux.org/cgit/apk-tools/"
+arch="all"
+license=GPL2
+
+builddir="$srcdir/$pkgname-$pkgver"
+prepare() {
+ default_prepare || return 1
+ cd "$builddir"
+ sed -i -e 's:-Werror::' Make.rules
+ echo "FULL_VERSION=$pkgver-r$pkgrel" > config.mk || return 1
+ if [ "$CBUILD" = "$CHOST" ]; then
+ echo "LUAAPK=YesPlease" >> config.mk
+ else
+ echo "LUAAPK=" >> config.mk
+ fi
+ echo "export LUAAPK" >> config.mk
+}
+
+build() {
+ cd "$builddir"
+ make || return 1
+ make static || return 1
+}
+
+check() {
+ cd "$builddir"
+ make check
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" install
+ install -d "$pkgdir"/var/lib/apk \
+ "$pkgdir"/var/cache/misc \
+ "$pkgdir"/etc/apk/keys \
+ "$pkgdir"/etc/apk/protected_paths.d \
+ || return 1
+ # the shipped README is empty
+ rm -r "$pkgdir"/usr/share/
+}
+
+static() {
+ pkgdesc="Alpine Package Keeper - static binary"
+ install -Dm755 "$srcdir"/$pkgname-$pkgver/src/apk.static \
+ "$subpkgdir"/sbin/apk.static
+
+ # lets sign the static binary so it can be vefified from distros
+ # that does not have apk-tools
+ local abuild_conf=${ABUILD_CONF:-"/etc/abuild.conf"}
+ local abuild_home=${ABUILD_USERDIR:-"$HOME/.abuild"}
+ local abuild_userconf=${ABUILD_USERCONF:-"$abuild_home/abuild.conf"}
+ [ -f "$abuild_userconf" ] && . "$abuild_userconf"
+ local privkey="$PACKAGER_PRIVKEY"
+ local pubkey=${PACKAGER_PUBKEY:-"${privkey}.pub"}
+ local keyname=${pubkey##*/}
+ ${CROSS_COMPILE}strip "$subpkgdir"/sbin/apk.static
+ openssl dgst -sha1 -sign "$privkey" \
+ -out "$subpkgdir"/sbin/apk.static.SIGN.RSA.$keyname \
+ "$subpkgdir"/sbin/apk.static || return 1
+}
+
+luaapk() {
+ pkgdesc="Lua module for apk-tools"
+ mkdir -p "$subpkgdir"/usr/
+ mv "$pkgdir"/usr/lib "$subpkgdir"/usr/lib/
+}
+
+sha512sums="4ffb8d1716bbb94421b1cc4277beb47d369c429f4c3bf597d08949abb7586d30c4504edf2f775bea3b93614a280c12391b956ca8f914fb0ec27799a4a005a145 apk-tools-2.9.1.tar.xz
+5ca2d2f2646032ed8f9f86357e986b054045a80ddb944be6a540566ff7092f38591ec8dfc7ac06b9daededa95e86c0e892ead55f9e8907eb318aed76644f7f97 0001-solver-allow-names-with-only-one-provider-to-be-auto.patch
+5640b746cd3c6d966d5f778ffe2307902503b1fc966bedb35b50dedee34ec3d5fe2c7f200dfd3893d6640150ff6dd4efd2df9aa110b4a7fd162b84904dacb493 openssl-compat.patch"
diff --git a/system/apk-tools/openssl-compat.patch b/system/apk-tools/openssl-compat.patch
new file mode 100644
index 000000000..cdafefd05
--- /dev/null
+++ b/system/apk-tools/openssl-compat.patch
@@ -0,0 +1,11 @@
+--- apk-tools-2.8.1/libfetch/common.c.old 2017-10-27 08:12:05.000000000 -0500
++++ apk-tools-2.8.1/libfetch/common.c 2017-11-11 22:37:18.661697875 -0600
+@@ -504,7 +504,7 @@
+
+ SSL_load_error_strings();
+
+- conn->ssl_meth = TLS_client_method();
++ conn->ssl_meth = SSLv23_client_method();
+ conn->ssl_ctx = SSL_CTX_new(conn->ssl_meth);
+ SSL_CTX_set_mode(conn->ssl_ctx, SSL_MODE_AUTO_RETRY);
+