summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 447705d141c301bd16c5ba64dc43d15264b82e11 (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
# Maintainer: Adrián Pérez de Castro <aperez@igalia.com>
pkgname='tappet-git'
pkgver=0.r93
pkgrel=2
pkgdesc='Simple encrypted UDP tunnel using TweetNaCl'
license=('custom:MIT')
url='https://github.com/amenonsen/tappet'
source=("${pkgname}::git+${url}.git")
sha512sums=('SKIP')
arch=('i686' 'x86_64' 'arm')
depends=('iproute2' 'libsodium')
options=('strip')
provides=('tappet')
conflicts=('tappet')

pkgver () {
	cd "${srcdir}/${pkgname}"
	local v=$(git describe --long --tags | sed -r 's/([^-]*-g)/r\1/;s/-/./g')
	[[ -z ${v} ]] && v=0
	printf "%s.r%s" "${v}" "$(git rev-list --count HEAD)"
}

build () {
	cd "${srcdir}/${pkgname}"
	eval "$(sed -e '/^CFLAGS=/p' -e d /etc/makepkg.conf)"
	make OPTIM="${CFLAGS}" LDLIBS='-lrt -lsodium' \
		NACLLIB='' NACL='' NACLINC=/usr/include/sodium
}

package () {
	cd "${srcdir}/${pkgname}"
	install -Dm644 README \
		"${pkgdir}/usr/share/doc/${pkgname}/README"
	install -Dm644 LICENSE \
		"${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
	for program in tappet tappet-keygen ; do
		install -Dm755 "${program}" \
			"${pkgdir}/usr/bin/${program}"
	done
}