summaryrefslogtreecommitdiffstats
path: root/main/abuild/APKBUILD
blob: d4819ba527a81b5f7189bf485f59273b173c01fa (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
59
60
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgdesc="Script to build Alpine Packages"
pkgname=abuild
pkgver=2.14.1
_ver=${pkgver%_git*}
pkgrel=1
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
	0001-buildrepo-parse-APKBUILDs-in-subshell.patch
	"

_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="ec7c8e453d4331ac20c164c263234f02  abuild-2.14.1.tar.bz2
d44821805530e9e57a4e27f8fe7f2970  0001-buildrepo-parse-APKBUILDs-in-subshell.patch"
sha256sums="e9ee3df70118f4f5eb6aca00570c8fb8fb5cf79ed08eb653929116384af77c35  abuild-2.14.1.tar.bz2
d30ff115fe3595c1dbc8efaeb13233527148ac72c966521f04b9c166a5cceee3  0001-buildrepo-parse-APKBUILDs-in-subshell.patch"
sha512sums="3eb14b4d4a104c459a7689d862e9efc29b0a5585101af25604248ad6453c7538c56bfe59f4250e3c56357db37dbf7c04115338c55a4ac0231bb3a61545a83cdf  abuild-2.14.1.tar.bz2
775f1ae3128b4083b33c162e572ce2ef438385f5a40145e719331feb60e10e6ad4d0d2c9a9c7f639a7bd53bb01d93b6e23de030b2a22916f275fcaa1fd34e043  0001-buildrepo-parse-APKBUILDs-in-subshell.patch"