summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6ceb667a4076e4400a0103cf5d5bee9b9e67b86f (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
# Maintainer: Christian Hesse <mail@eworm.de>
# Contributor: Jason A. Donenfeld <Jason@zx2c4.com>

pkgbase=wireguard
pkgname=(wireguard-dkms wireguard-tools)
pkgver=0.0.20161223
pkgrel=1
pkgdesc='next generation secure network tunnel'
arch=('x86_64' 'i686')
url='http://www.wireguard.io/'
license=('GPL')
makedepends=('git' 'libmnl')
source=("${pkgbase}-${pkgver}.tar.xz::https://git.zx2c4.com/WireGuard/snapshot/WireGuard-${pkgver}.tar.xz")
sha256sums=('bbd98ff6667e76ac283685db9ee7a6777529f5d311a0bf1fe9a15932aed2b972')

prepare() {
	cd WireGuard-${pkgver}/

	find contrib/examples/ -name '.gitignore' -delete
}

build() {
	cd WireGuard-${pkgver}/

	make -C src/tools/
}

package_wireguard-dkms() {
	depends=('dkms')
	provides=('WIREGUARD-MODULE')

	cd WireGuard-${pkgver}/

	make -C src/ DESTDIR="${pkgdir}/" DKMSDIR="/usr/src/wireguard-${pkgver}/" dkms-install
}

package_wireguard-tools() {
	depends=('libmnl' 'WIREGUARD-MODULE')

	cd WireGuard-${pkgver}/

	make -C src/tools/ DESTDIR="${pkgdir}/" install

	install -d -m0755 "${pkgdir}"/usr/share/${pkgbase}/
	cp -r contrib/examples/ "${pkgdir}"/usr/share/${pkgbase}/
}