summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2e99c5c6883d63f1c8c66e715fb11bb14764d2ad (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
# Maintainer:  Jonathon Fernyhough <jonathon at_manjaro_dot org>
# Contributor: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: Romain Bouchaud-Leduc <r0m1.bl@camaris.org>

pkgname=trickle-git
pkgver=r21.596bb13
pkgrel=1
pkgdesc="Lightweight userspace bandwidth shaper"
arch=('i686' 'x86_64')
url="https://github.com/mariusae/trickle"
license=('BSD')
depends=('libevent' 'libtirpc')
provides=("${pkgname/-git/}")
conflicts=("${pkgname/-git/}")
source=("git+https://github.com/mariusae/trickle.git"
        'remove-libtrickle.patch')
sha256sums=('SKIP'
            '7e148c9526dbd6667c94ce3ee4f1a1fd550e61ab185735939c4d5312cf13b7a1')

pkgver() {
	cd "${srcdir}/${pkgname/-git/}"
	# https://wiki.archlinux.org/index.php/VCS_package_guidelines#The_pkgver.28.29_function
	( set -o pipefail
	git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
		printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
	)
}

prepare() {
	cd "${srcdir}/${pkgname/-git/}"

	# https://github.com/mariusae/trickle/issues/16
	patch -Np1 -i "${srcdir}/remove-libtrickle.patch"
}

build() {
	cd "${srcdir}/${pkgname/-git/}"

	CPPFLAGS+=" -I/usr/include/tirpc/"
	LDFLAGS+=" -ltirpc"

	autoreconf -if
	./configure --prefix=/usr \
		--mandir=/usr/share/man
	sed -i "s|.*in_addr_t.*||g" config.h
	make -j1
}

package() {
	cd "${srcdir}/${pkgname/-git/}"

	make DESTDIR="${pkgdir}" install
	install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}