# Maintainer: Natanael Copa pkgname=apk-tools pkgver=2.6.8 pkgrel=2 pkgdesc="Alpine Package Keeper - package manager for alpine" subpackages="$pkgname-static" depends= makedepends_build="" makedepends_host="zlib-dev libressl libressl-dev libfetch-dev" 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-add-s390x-headers.patch 0001-tar-return-correct-error-for-short-read-of-tar-archi.patch " url="http://git.alpinelinux.org/cgit/apk-tools/" arch="all" license=GPL2 _builddir="$srcdir/$pkgname-$pkgver" prepare() { cd "$_builddir" sed -i -e 's:-Werror::' Make.rules for i in $source; do case $i in *.patch) msg "$i"; patch -p1 -i "$srcdir"/$i || return 1 esac done 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 } 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/ } md5sums="cc3efedf3047c256f13549ba58df3291 apk-tools-2.6.8.tar.xz f77a0ce3b4a67cbefed14c3a3ebf253f 0001-add-s390x-headers.patch b15f4cb8d0e9507a5a3fb84bb39f3deb 0001-tar-return-correct-error-for-short-read-of-tar-archi.patch" sha256sums="83f5cf9f0e75c19004a67150819eae2d4c859236b6c9c04d34d5b6968925f0d3 apk-tools-2.6.8.tar.xz db8519fd21f7b302e1b339d037b5b02cbcefcf197891b45af5362d17d8d66bd5 0001-add-s390x-headers.patch 5754067cba52370e8522ea52e9491f0c73063ca06a5f12cad8c5b1d4e08a39d5 0001-tar-return-correct-error-for-short-read-of-tar-archi.patch" sha512sums="03fb42616335de9edaf3e44fd64a8d1c5dd8b0f25b7f3b176940b751a6547b8be153549f0cee9a5d65491025f6747799b6f5ba22b15d850593d499c07b5cc4c6 apk-tools-2.6.8.tar.xz 7ab0a174c86613631d85cf6e51925b4a5a7ce42b6b02db2166bc5629517edf42d6abc1f9404621161e647b1d61f01641bc4ef91060e98e20b7a4bd4a9758fab5 0001-add-s390x-headers.patch 3f84b930ffc37f1aba9b1b6da31a494ab694ef4d2dd458b470bdebef6cd4155a7840832d12f2f5dd486a31d1c16ea054977638c511d60569565f66a0c9c0a9a0 0001-tar-return-correct-error-for-short-read-of-tar-archi.patch"