aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild/APKBUILD
blob: 4c8996e68cf3e6cf4ceb2b5f49e8f774e7876c11 (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=2.28.0
_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 pkgconf patch"
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 apkbuild-gem-resolver:gems"
options="suid"
pkggroups="abuild"
source="http://dev.alpinelinux.org/archive/abuild/abuild-$_ver.tar.xz
	0001-abuild-add-update_config_guess.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"
	arch="noarch"
	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"
	arch="noarch"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/apkbuild-gem-resolver "$subpkgdir"/usr/bin/
}

md5sums="1747be170c43a3d7779ffa8b2a7c5835  abuild-2.28.0.tar.xz
e0bffe0a137737a465ad10ab5a71d699  0001-abuild-add-update_config_guess.patch"
sha256sums="228baa88e9b96f8d542f1927ae92ab0f3a14f5745a45dc90be982209830bc3a1  abuild-2.28.0.tar.xz
2e30eec729e1add16d4c191796848a9bb0cbaf0758fc75538be39234a1b2f82d  0001-abuild-add-update_config_guess.patch"
sha512sums="3f3dbfd06db9e595f6b0289089f015e946cc629a866d088598dd6369dff9a5c134d01226a9639993a7b8317b14f12aed2e964f4cdcd2ce73f3f4b31d4efb04c5  abuild-2.28.0.tar.xz
67029da17acbafda28734ac340910d105c34ca0a20082798b8094327cd03d1da16a8e6cfb806aad4189eb5c8d2c6d81bd251321d752f355d22af7c0c3bfbb19a  0001-abuild-add-update_config_guess.patch"