aboutsummaryrefslogtreecommitdiffstats
path: root/main/aria2/APKBUILD
blob: 378124fb515935fb57021c4a13ccc49e3cc3b6cb (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
74
75
76
77
78
79
80
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Jeff Bilyk <jbilyk@gmail.com>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=aria2
pkgver=1.34.0
pkgrel=1
pkgdesc="Download utility for HTTP(S), (S)FTP, Bittorrent, and Metalink"
url="https://aria2.github.io/"
arch="all"
license="GPL-2.0-or-later"
depends="ca-certificates"
makedepends="gnutls-dev expat-dev sqlite-dev c-ares-dev"
checkdepends="cppunit-dev"
pkgusers="aria2"
pkggroups="aria2"
install="$pkgname-daemon.pre-install"
subpackages="$pkgname-doc $pkgname-daemon::noarch $pkgname-bash-completion:bashcomp:noarch"
source="https://github.com/aria2/$pkgname/releases/download/release-$pkgver/$pkgname-$pkgver.tar.xz
	$pkgname.conf
	$pkgname.initd
	$pkgname.confd
	$pkgname.logrotate
	"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--disable-nls \
		--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt
	make
}

check() {
	cd "$builddir"
	make check
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

bashcomp() {
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	install -Dm644 "$builddir"/doc/bash_completion/aria2c \
		"$subpkgdir"/usr/share/bash-completion/completions/_aria2c
}

daemon() {
	pkgdesc="Support for running Aria2 as a daemon using OpenRC"
	depends="$pkgname=$pkgver-r$pkgrel openrc"

	mkdir -p "$subpkgdir"
	cd "$subpkgdir"

	install -m 755 -D "$srcdir"/$pkgname.initd etc/init.d/$pkgname
	install -m 644 -D "$srcdir"/$pkgname.confd etc/conf.d/$pkgname
	install -m 644 -D "$srcdir"/$pkgname.logrotate etc/logrotate.d/$pkgname
	install -m 644 -D "$srcdir"/$pkgname.conf etc/$pkgname.conf

	install -m 750 -o aria2 -g aria2 -d var/lib/$pkgname
	install -m 700 -o aria2 -g aria2 -d var/cache/$pkgname
}

sha512sums="80bc43e242c06acc95030021cb347b4ec230729f3d7e512ca1932941b34ef95c312a34007a226869e5d720839a400e66cdb072ccab5d42228d8cf3d828723dcc  aria2-1.34.0.tar.xz
dd716f27eae2628bd528fd2842de7881e8f8f00d587b179e832f1639241db5bd8f4e74a5b791ca4de984923654b38a28813a89ad49a864f64534903a46878a60  aria2.conf
a191655122d8d4379dd7aef773c6273387d8417b88f4f8f96d4a2121e71d9d005c84f15382b46b90501ecb3675f2505b22fb9494a0e5c4d96792bf8b29c2c01a  aria2.initd
ee49208c36be85fdf820eda0b47549732f720624a6f94702c16e1711823d74a23728944f60c85c11d09db6dbde3515adb32bb5ddf44786645b9a36883a5b6404  aria2.confd
2ed9ff7a5fd1801643e4fb3cdd8cb21f0ead60420c87636bb581fe00828a98a5290a0888e49f6a6becb9f39c3c145b1399aa3a9ae452eb10ac2064c0e7bca1f8  aria2.logrotate"