From 756a86906db7d0b5303b0a7043672a6326f5f50a Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Sun, 19 May 2013 11:48:50 +0000 Subject: main/apk-tools: sign the apk.static See http://www.mail-archive.com/lxc-devel@lists.sourceforge.net/msg03378.html --- main/apk-tools/APKBUILD | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'main/apk-tools') 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 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() { -- cgit v1.2.3