aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild/APKBUILD
blob: 5308962506acaf1284be6cdfd2456d212a80a13f (plain) (blame)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=abuild
pkgver=3.8.0_rc4
_ver=${pkgver%_git*}
pkgrel=0
pkgdesc="Script to build Alpine Packages"
url="https://git.alpinelinux.org/cgit/abuild/"
arch="all"
license="GPL-2.0-only"
depends="fakeroot scanelf openssl 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="openssl-dev zlib-dev"
makedepends="$makedepends_host $makedepends_build"
checkdepends="bats"
install="$pkgname.pre-install $pkgname.pre-upgrade"
subpackages="
	apkbuild-cpan:cpan:noarch
	apkbuild-gem-resolver:gems:noarch
	apkbuild-pypi:pypi:noarch
	abuild-rootbld:_rootbld:noarch
	$pkgname-doc
	"
options="suid"
pkggroups="abuild"
source="https://git.alpinelinux.org/abuild/snapshot/abuild-$pkgver.tar.xz
	"
builddir="$srcdir"/abuild-$pkgver

prepare() {
	default_prepare

	sed -i -e "/^CHOST=/s/=.*/=$CHOST/" abuild.conf
}

build() {
	make VERSION="$pkgver-r$pkgrel"
}

check() {
	make check
}

package() {
	make install VERSION="$pkgver-r$pkgrel" 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 perl-module-build perl-module-build-tiny
		perl-lwp-protocol-https"

	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/
}

pypi() {
	pkgdesc="Script to generate python3 APKBUILD from PYPI"
	depends="perl perl-libwww perl-json perl-module-build-tiny perl-lwp-protocol-https
	perl-ipc-system-simple"

	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/apkbuild-pypi "$subpkgdir"/usr/bin/
}

_rootbld() {
	pkgdesc="Build packages in chroot"
	depends="abuild bubblewrap gettext git"
	mkdir -p "$subpkgdir"
}

sha512sums="
687c21c233570b1e06f1298b24d5bcbf5925dfb9e9e00d0fb1626a7e0983dc6c2079cba96408033210b562c1cf08c2cd149379b22f86e0a255e2dde1c6886d48  abuild-3.8.0_rc4.tar.xz
"