aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild/APKBUILD
blob: 7cda98a9c39627d139e391f48dbf07317affa0f2 (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=abuild
pkgver=3.4.0_rc1
_ver=${pkgver%_git*}
pkgrel=2
pkgdesc="Script to build Alpine Packages"
url="https://git.alpinelinux.org/cgit/abuild/"
arch="all"
license="GPL-2.0"
depends="fakeroot sudo pax-utils 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"
install="$pkgname.pre-install $pkgname.pre-upgrade"
subpackages="apkbuild-cpan:cpan:noarch apkbuild-gem-resolver:gems:noarch
             abuild-rootbld:_rootbld:noarch $pkgname-doc"
options="suid !check"
pkggroups="abuild"
source="https://dev.alpinelinux.org/archive/abuild/abuild-$_ver.tar.xz
	0001-Revert-abuild-unset-depends-for-subpackages.patch
	"

builddir="$srcdir/$pkgname-$_ver"

prepare() {
	default_prepare

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

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

package() {
	cd "$builddir"

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

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

sha512sums="97b6c12d3bc44794eae966d950ad0a2f915651fce76ea39c1c97700d04061be910a5bd66e9cff63bd1aaf6991ecb4a6eb9eb8477c4d12b2501666402d50b0c4b  abuild-3.4.0_rc1.tar.xz
86bda138a5ab4ecd6fad8a0e8b3722d2bdbcbf2661682ce05b0fc16386ca3bddd2076c63079fb168b2d0e09d6037c38bcca4c4568fdc1fa590b4f66d979145bf  0001-Revert-abuild-unset-depends-for-subpackages.patch"