summaryrefslogblamecommitdiff
path: root/system/apk-tools/APKBUILD
blob: 78478e51e85c9b3954336e90ec6957dcbf431e3f (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=2
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
	deep.patch
	list.patch
	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
059f0368b096c53357db567bf720f049cf19a88dbf10dc2496a739dfe332a6487b87f07056d7cf6f0c8a385782821547d4aba8c393591c4070838f1c98819dda  deep.patch
53d446734d32341cbd9ca00aedcd65d4d99220da354a9339837a6c79609a321f61ae917fb3cd9d4bffebcfc171d06c0f0d315e29a2d16285545c4fa085a75639  list.patch
746d00ce2af554a25db7ecea2b0a4d8f7399d2560efb6bf59ea144012d0163d3e0bad84c799bd706e8be6c0a543d4e35728d6beb269fddbbea626384009129cb  pmmx.patch"