summaryrefslogtreecommitdiffstats
path: root/main/abuild/APKBUILD
blob: e20662f9972981662c6d6979982690b0e35280c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=abuild
pkgver=2.18.0
_ver=${pkgver%_git*}
pkgrel=1
pkgdesc="Script to build Alpine Packages"
url="http://git.alpinelinux.org/cgit/abuild/"
arch="all"
license="GPL2"
depends="fakeroot sudo pax-utils openssl apk-tools>=2.0.7-r1 libc-utils"
if [ "$CBUILD" = "$CHOST" ]; then
	depends="$depends curl"
fi
makedepends_build="pkgconfig"
makedepends_host="openssl-dev"
makedepends="$makedepends_host $makedepends_build"
install="$pkgname.pre-install $pkgname.pre-upgrade"
subpackages="apkbuild-cpan:cpan"
pkggroups="abuild"
source="http://dev.alpinelinux.org/archive/abuild/abuild-$pkgver.tar.xz"

_builddir="$srcdir/$pkgname-$_ver"
prepare() {
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch)
			msg "Applying $i"
			patch -p1 -i "$srcdir"/$i || return 1
			;;
		esac
	done
	sed -i -e "/^CHOST=/s/=.*/=$CHOST/" abuild.conf
}

build() {
	cd "$_builddir"
	make || return 1
}

package() {
	cd "$_builddir"
	make install DESTDIR="$pkgdir" || return 1
	install -m 644 abuild.conf "$pkgdir"/etc/abuild.conf || return 1
	install -d -m 775 -g abuild "$pkgdir"/var/cache/distfiles || return 1
}

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="425230999db864411b051399e3a4d0fa  abuild-2.18.0.tar.xz"
sha256sums="0b5e08f91d4ba8c38a6a7b080fc7b0f025c0fc992071844bb2944a5960e5d9c3  abuild-2.18.0.tar.xz"
sha512sums="15abd6d7b098255dbfe43ac2daa7ee3579dc050f21ac01f778da7559ffc07f4f0bc38027717018f606eaa749b696899417ea32ac7fe0362184cf2d0f67491807  abuild-2.18.0.tar.xz"