aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild/APKBUILD
blob: 8435ef4ff907759729e71457c8212e739a574826 (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
72
73
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=abuild
pkgver=3.0.0_rc2
_ver=${pkgver%_git*}
pkgrel=4
pkgdesc="Script to build Alpine Packages"
url="http://git.alpinelinux.org/cgit/abuild/"
arch="all"
license="GPL2"
depends="fakeroot sudo pax-utils libressl apk-tools>=2.0.7-r1 libc-utils
	attr tar pkgconf patch lzip"
if [ "$CBUILD" = "$CHOST" ]; then
	depends="$depends curl"
fi
makedepends_build="pkgconfig"
makedepends_host="libressl-dev zlib-dev"
makedepends="$makedepends_host $makedepends_build"
install="$pkgname.pre-install $pkgname.pre-upgrade"
subpackages="apkbuild-cpan:cpan:noarch apkbuild-gem-resolver:gems:noarch"
options="suid"
pkggroups="abuild"
source="http://dev.alpinelinux.org/archive/abuild/abuild-$_ver.tar.xz
	0001-abuild-use-new-PKG_CONFIG_MAXIMUM_TRAVERSE_DEPTH-env.patch
	0001-abuild-wrap-check-with-fakeroot.patch
	0001-abuild-set-e-fix-for-update_config_-sub-guess.patch
	0001-abuild-Add-support-for-lzip-source-packages.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
	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"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/apkbuild-cpan "$subpkgdir"/usr/bin/
}

gems() {
	pkgdesc="APKBUILD dependency resolver for RubyGems"
	depends="ruby ruby-augeas"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/apkbuild-gem-resolver "$subpkgdir"/usr/bin/
}

sha512sums="bb6fa7af3144db99839c24db63e17179d73f659a76c86d530923158b37fad3fcd73ea992f9d5f4ac3c48c13ccebb62ffbe461b3871dcb4b7b1ca6efd934e4be2  abuild-3.0.0_rc2.tar.xz
65e0605a23a5f8df6024533b054ce6e098bfc1431220d8487e9d5f521aede7c0c8fc47f5f119d868da48d8f69e6fbc3fe101f71e3415a66797829623bb5a7a48  0001-abuild-use-new-PKG_CONFIG_MAXIMUM_TRAVERSE_DEPTH-env.patch
0e5b64ad175efc4a06197a5e131878e5532539c78ffd8d5aa28a99c9684aa6eec8bc95fdca1c99b916a58c61ddf8d0b7602b1bc9aee276f7a40d82f970c0ad7c  0001-abuild-wrap-check-with-fakeroot.patch
dda641f0ce2bddc8f3d7cf4a3538afe699bda56a5172bd56104de7252796da20025ed36f9401220d8e2fd072297efad94da4be4ed8831e9f9d14ad75c9c8859d  0001-abuild-set-e-fix-for-update_config_-sub-guess.patch
084171ed1e276c02f58dfade28c013d0160fb8a7b87ee03684ffb16c2bb1c64f8b9d98adc947c7b0211ba7fb2d8ef2c590abd9fed80676db52b7829da495d291  0001-abuild-Add-support-for-lzip-source-packages.patch"