# Maintainer: Natanael Copa pkgname=apk-tools pkgver=2.4.3 pkgrel=2 pkgdesc="Alpine Package Keeper - package manager for alpine" subpackages="$pkgname-static" depends= makedepends_build="" makedepends_host="zlib-dev openssl-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-db-allow-replacing-files-of-origin-package-is-same.patch 0001-finally-fix-building-PIE-binaries.patch " url="http://git.alpinelinux.org/cgit/apk-tools/" arch="all" license=GPL-2 _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="40e287741880f8a24ddaca5fe9f545b7 apk-tools-2.4.3.tar.xz cd234f5f9c5963a519332a99d9b73547 0001-db-allow-replacing-files-of-origin-package-is-same.patch 3294eec1ff1d75a4e87f910636eaf7e2 0001-finally-fix-building-PIE-binaries.patch" sha256sums="3198d3cdb718116665e609b5d3842a05f528f37fcbb6c52a2e9d46bfd2646288 apk-tools-2.4.3.tar.xz 8810c75716c32e875a46143d371c15e954d81e2fe95a9097bfd849c5aebcca57 0001-db-allow-replacing-files-of-origin-package-is-same.patch 1eaaa65b790013add87c3f6b458a842a42852f1c4207687adccc2f25caa11347 0001-finally-fix-building-PIE-binaries.patch" sha512sums="327ca4bd19b35c521edddb4b1f56ac3f68e212c9b5be5a18219416048489a536bf948f6e4a0443456d42026aed71fd6255d2c73ff178e0726b392a5553e6680e apk-tools-2.4.3.tar.xz 03d8e95ed2f53126bc40494a5335b4b550edb532b1d1e90cd757b4b8a10efcf84fb030b913ba924ba42cc1ef38becef4c55b05383eb71c194c587b6212b49a52 0001-db-allow-replacing-files-of-origin-package-is-same.patch 3cca632d4ec459ca6d5647c4b7712ffabbcda668987f7b305f3c21e3c1e852a4d943ccc957cefaefafebb5e35e5a56c97717a047207c741721899453ad875a8d 0001-finally-fix-building-PIE-binaries.patch"