summaryrefslogblamecommitdiff
path: root/system/apk-tools/APKBUILD
blob: c6b0b479a83432c68ea2e329c0f239e228edbdbb (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                                                                        
                 
             

                                                 



                                                 
                    
                                                             
                                                  
                             
                                                                            
                  

         
           
                       

                                          

                                                        




                                         

                   












                                          
                                                   




















                                                                            
                                            

 

                                                                                                                                                                     
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Adelie Platform Group <adelie-devel@lists.adelielinux.org>
pkgname=apk-tools
pkgver=2.10.3
pkgrel=0
pkgdesc="Alpine Package Keeper - package manager"
url="https://git.alpinelinux.org/cgit/apk-tools/"
arch="all"
license="GPL-2.0-only"
depends="ca-certificates"
makedepends_build=""
makedepends_host="zlib-dev openssl openssl-dev linux-headers"
makedepends="$makedepends_build $makedepends_host"
subpackages="$pkgname-static"
source="https://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.xz
	pmmx.patch
	"

prepare() {
	default_prepare
	cd "$builddir"
	sed -i -e 's:-Werror::' Make.rules
	echo "FULL_VERSION=$pkgver-r$pkgrel" > config.mk
	echo "LUAAPK=" >> config.mk
	echo "export LUAAPK" >> config.mk
}

build() {
	cd "$builddir"
	make
	make static
}

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
	# 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
}

sha512sums="1b190cfd04c69369bd4f2b708d4df0f8cf2937e1580c95138fd2c2257e7604d015deaca10a9fe0da6742981caadb6b067c15e417a1951866f781b8a5c71c98ee  apk-tools-2.10.3.tar.xz
746d00ce2af554a25db7ecea2b0a4d8f7399d2560efb6bf59ea144012d0163d3e0bad84c799bd706e8be6c0a543d4e35728d6beb269fddbbea626384009129cb  pmmx.patch"