aboutsummaryrefslogtreecommitdiffstats
path: root/main/apk-tools/APKBUILD
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-05-19 11:48:50 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-06-04 07:37:25 +0000
commitffb869160858a1c5e5f65b6bfe83a9be393187ce (patch)
tree0cac4a90497f1023a74ff262656a9c8b9393a5a9 /main/apk-tools/APKBUILD
parent5461ef9adb8cfbbca3db9367b6922a3f37552bc5 (diff)
downloadaports-ffb869160858a1c5e5f65b6bfe83a9be393187ce.tar.bz2
aports-ffb869160858a1c5e5f65b6bfe83a9be393187ce.tar.xz
main/apk-tools: sign the apk.static
See http://www.mail-archive.com/lxc-devel@lists.sourceforge.net/msg03378.html (cherry picked from commit 756a86906db7d0b5303b0a7043672a6326f5f50a)
Diffstat (limited to 'main/apk-tools/APKBUILD')
-rw-r--r--main/apk-tools/APKBUILD15
1 files changed, 14 insertions, 1 deletions
diff --git a/main/apk-tools/APKBUILD b/main/apk-tools/APKBUILD
index f6f8ec0b7c..2f748023de 100644
--- a/main/apk-tools/APKBUILD
+++ b/main/apk-tools/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=apk-tools
pkgver=2.3.4
-pkgrel=0
+pkgrel=1
pkgdesc="Alpine Package Keeper - package manager for alpine"
subpackages="$pkgname-static lua-apk:luaapk"
depends=
@@ -50,6 +50,19 @@ 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##*/}
+ openssl dgst -sha1 -sign "$privkey" \
+ -out "$subpkgdir"/sbin/apk.static.SIGN.RSA.$keyname \
+ "$subpkgdir"/sbin/apk.static || return 1
}
luaapk() {