aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild/APKBUILD
blob: 8d598de3c8008e0e1d00ce1b75ceb3c444d53752 (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
61
62
63
64
65
66
67
68
69
70
71
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=abuild
pkgver=2.21.0_git20150408
_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
	attr tar"
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"
options="suid"
pkggroups="abuild"
source="http://dev.alpinelinux.org/archive/abuild/abuild-$_ver.tar.xz
	git.patch
	0001-abuild-preserve-all-xattrs.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 "/^CHOST=/s/=.*/=$CHOST/" abuild.conf
}

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

package() {
	cd "$_builddir"
	make install DESTDIR="$pkgdir" || return 1
	# buildrepo is provided by lua-aports now
	rm "$pkgdir"/usr/bin/buildrepo || 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="126cbde6e4fdf537571a03a97d01d348  abuild-2.21.0.tar.xz
453ee698af510fc0cf10a33020e37e73  git.patch
79ad3d35bab42098add7fa8bcb7d759b  0001-abuild-preserve-all-xattrs.patch"
sha256sums="08689cbf8818c81d9e52e3397529adcb0e279a21d33dfe4f0678d0ef778767f3  abuild-2.21.0.tar.xz
7e7f9a837c2c6a2bddb2db80f86b2cad212cbb0cc8f2a8b63534dd5a3bc52318  git.patch
4b7102a82a4f12ee3344c027352868a0bc1d9c1af4ac8f66c11a2986cd4d6d11  0001-abuild-preserve-all-xattrs.patch"
sha512sums="b304dbb82563ec8ae23376c17ee27b3d49e9c1b74bd14b7a912ca88239ed3c7b2fabeb6209a6d4485c6dbab8491abb8b42f801f5fd9310691da60e630061646b  abuild-2.21.0.tar.xz
6ab114cd383d29244124e5cf440ef17f292e01a683d21c153f808d7757e38e1b575384d5d4b2a3314c17a5656c64361703c3f746577266ae4403edcf353cc5e8  git.patch
c995d2874d9a54c68efa51a8b7e7185748f2369b62011f3998d906aa8118c0944594a258062cb46bfb75b89d78cae13b59cf84de2cf6630f4d2bdb8c0282972b  0001-abuild-preserve-all-xattrs.patch"