summaryrefslogtreecommitdiff
path: root/system/abuild/APKBUILD
blob: 6c16562e142c81e8140dcf9f1040d62c20a5d054 (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
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=abuild
pkgver=3.4.2
pkgrel=3
pkgdesc="Script to build APK packages"
url="https://git.adelielinux.org/adelie/abuild"
arch="all"
options="suid !check"
license="GPL-2.0-only"
pkggroups="abuild"
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"
subpackages="abuild-rootbld:_rootbld:noarch $pkgname-doc"
install="$pkgname.pre-install $pkgname.pre-upgrade"
source="https://distfiles.adelielinux.org/source/abuild-$pkgver.tar.xz
	inode.patch
	keyhole.patch
	libarchive.patch
	noarch.patch
	"

# secfixes:
#   3.3.1-r1:
#     - CVE-2019-12875

prepare() {
	default_prepare
	sed -i -e "/^CHOST=/s/=.*/=$CHOST/" abuild.conf
}

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

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
	# hardcoded to use Alpine repositories and URLs.
	# maybe rewrite some day, pending user demand.
	rm "$pkgdir"/usr/bin/apkbuild-gem-resolver
	# very broken
	rm "$pkgdir"/usr/bin/apkbuild-cpan
}

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

sha512sums="9bdeb31f54879878697b4a5436ec2bc7764e1b9840798e913ba3dd47c344437e362a3067b89440ca8a7940af1efcaa83a24e7c1077187f924bf73fb058f97fbf  abuild-3.4.2.tar.xz
53b0f2c15da767fbdde5a28b6f428943907e8752490ffae580e4a4198fea76fd71fc253a526c81bbbf17311ce3c72a563649a416ea0fda219a35cee50fcd46d1  inode.patch
757d750d4b5c88bf00774b64f2b93a9461e03f284d9423dc58c581e1309f276628de3114fcb510afd7c3cd55ceb721c1278e42756977c97ebe2597207805318d  keyhole.patch
2452a2b2ecf64bb6bfef1e71c35d39f02be1a5930ebd3e4c139156979b6c2249adcd4437c5c49f4af5b478f2a69529807fcbcd31ca01e6be6430165bcad74353  libarchive.patch
5ba235c3f3c3c5cf8c8973ea8cc3fdf97364b5bb69c6e60b8738c3f0cf585868bcf77a0b05ff1a49879eec1ad5c37f28f5fe28f883643a44b3ba6c543616bbe7  noarch.patch"