# Maintainer: Natanael Copa pkgname=apk-tools pkgver=2.10.0 pkgrel=3 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-list-fix-segmentation-fault-with-virtual-packages.patch 0001-prevent-automatic-repository-index-update-for-apk-de.patch 0001-prevent-automatic-repository-index-update-with-no-ne.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="96b840fa5fb7342bb5f6ad5c25e837f705299256e168130d6ef5c1940569df3e7dfa50d36128c0f9a76e662c80b342dd92a8270acd82b4eb91093020b599fcc6 apk-tools-2.10.0.tar.xz 1e83e68b67dd66a0a8ccdbb6ca34ccb7748eff82d032d0d9101b7155a0ff768dc2a849e99387cb9970f0fd9ff5606d08fca9f3bd1a5a561b8b0995d97c69e971 0001-list-fix-segmentation-fault-with-virtual-packages.patch 8fb88998baa470b4ea498a3f75f19d981e7f41055e472fabf24a2c6ae478aa34f686c43b615b3c492ee4805369a1cbff3ee0a2e81b31257b080845b3d492872d 0001-prevent-automatic-repository-index-update-for-apk-de.patch 17071687e532b00c9f276bb7e42369ec04231b15d223fd3eb803a51eb5cd4f2611d9c7525d905482a42e9b9fc293274887a411a2bf7520eee0607de2bf7a1268 0001-prevent-automatic-repository-index-update-with-no-ne.patch"