summaryrefslogtreecommitdiff
path: root/system/abuild/APKBUILD
blob: 98e34f201ffeca4c4d198dac483f34dc9257532b (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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=abuild
pkgver=3.2.0_rc1
pkgrel=1
pkgdesc="Script to build APK packages"
url="https://code.foxkit.us/adelie/aports"
arch="all"
license="GPL-2.0"
depends="fakeroot sudo pax-utils openssl apk-tools>=2.0.7-r1 libc-utils
	attr libarchive-tools 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://distfiles.adelielinux.org/source/abuild-$pkgver+adelie.tar.xz
	0001-abuild-continue-faking-POSIX-support-for-now.patch
	"
builddir="$srcdir/$pkgname-$pkgver+adelie"

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"

	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="8d9e66ec6a4e814f9be0a10b53c4b183afa97c9969d9bb86fdec0b9096756d6343cec4840fb61a5812eb4879e61c106adbdd286e63d9cfc4f8b66b6cad79557b  abuild-3.2.0_rc1+adelie.tar.xz
b7aa7ff9858eee2ff20eeed3b8da60d40e608b4da2676acb9c8b16ca6639283e5d70884888efd505fcd239bb462f726203e4773a4f706b16d07742b2a8631b6c  0001-abuild-continue-faking-POSIX-support-for-now.patch"