summaryrefslogtreecommitdiffstats
path: root/main/abuild/APKBUILD
blob: 526894c135c0a3d8dfcacf39140a40b917d32a1b (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgdesc="Script to build Alpine Packages"
pkgname=abuild
pkgver=2.14.0
_ver=${pkgver%_git*}
pkgrel=0
url=http://git.alpinelinux.org/cgit/abuild/
depends="fakeroot file sudo pax-utils openssl apk-tools>=2.0.7-r1
	abuildhelper curl libc-utils"
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-$_ver.tar.bz2
	"

_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 "s/^CARCH=.*/CARCH=$CARCH/" \
		-e "s/^CBUILD=.*/CBUILD=$CBUILD/" abuild.conf
}

build() {
	cd "$_builddir"
	make
}

package() {
	cd "$_builddir"
	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="f81ecadd8db566a3e563726ca0ac8a5f  abuild-2.14.0.tar.bz2"
sha256sums="8c4b86071d102d039a1948f61ab39d87e7742597d0de24363109e87a9df3e30d  abuild-2.14.0.tar.bz2"
sha512sums="ef1eb0f273787a1a558f22533a0a0aa02350b4c1334d297c4caf07ab56436508b87c74f6f5d6a32bc7c49cd47c0fe773c5bdab76eb1d82739d63d2d1d146961f  abuild-2.14.0.tar.bz2"