# Maintainer: Natanael Copa pkgdesc="Script to build Alpine Packages" pkgname=abuild pkgver=2.12.1 pkgrel=9 url=http://git.alpinelinux.org/cgit/abuild/ depends="fakeroot file sudo pax-utils openssl apk-tools>=2.0.7-r1 uclibc-utils abuildhelper curl" makedepends="openssl-dev pkgconfig" install="$pkgname.pre-install $pkgname.pre-upgrade" subpackages="apkbuild-cpan:cpan" pkggroups="abuild" arch="all" license=GPL-2 source="http://git.alpinelinux.org/cgit/abuild/snapshot/abuild-$pkgver.tar.bz2 abuild-git.patch" prepare() { cd "$srcdir/$pkgname-$pkgver" for i in $source; do case $i in *.patch) msg "Applying $i" patch -p1 -i "$srcdir"/$i || return 1 ;; esac done sed -i -e "s/^CARCH=.*/CARCH=$CARCH/" \ -e "s/^CBUILD=.*/CBUILD=$CBUILD/" abuild.conf } build() { cd "$srcdir/$pkgname-$pkgver" make } package() { cd "$srcdir/$pkgname-$pkgver" make install DESTDIR="$pkgdir" install -m 644 abuild.conf "$pkgdir"/etc/abuild.conf install -d -m 775 -g abuild "$pkgdir"/var/cache/distfiles } cpan() { pkgdesc="Script to generate perl APKBUILD from CPAN" depends="perl perl-libwww perl-json" arch="noarch" mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/apkbuild-cpan "$subpkgdir"/usr/bin/ } md5sums="92348750a3354c3ec7b811716543b8e5 abuild-2.12.1.tar.bz2 90018b9a6e428de018cdd7ff868ebf85 abuild-git.patch"