aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild/APKBUILD
blob: 8df61aba20cd973573e091c1ddf7e21e88c35f1f (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=abuild
pkgver=3.0.0_rc1
_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 libressl apk-tools>=2.0.7-r1 libc-utils
	attr tar pkgconf patch"
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-functions-fix-abuild-A.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="48f33e791805d9ec0f1fcfc28d9d2e58c84dc168b1a64e52733eefdc9daf2450c0cea20f9cdf3a61755d7344cc24f801ef0e9954b30881a713885d935a59dc36  abuild-3.0.0_rc1.tar.xz
eaec95123f4c67fce84ccd190d1de47f27406acd1f600495100bf553b48eb9bf2a91b833a2c0d37c15306014e6972ea5a25134c35fd29be7a8f8574168cbb5a9  0001-functions-fix-abuild-A.patch"