summaryrefslogtreecommitdiff
path: root/user/wireguard-module/APKBUILD
blob: 7fac2165c3d03468040c37c1f465339af0de8b22 (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
# Contributor: Luis Ressel <aranea@aixah.de>
# Maintainer: Luis Ressel <aranea@aixah.de>
_kver="5.4.5-mc0"
pkgver=1.0.20200401
pkgrel=0
_pkgname="wireguard-module"
pkgname="$_pkgname-$_kver"
_pkgreal="wireguard-linux-compat"
pkgdesc="Kernel module for the WireGuard VPN, built for easy-kernel"
url="https://www.wireguard.com/"
arch="all"
options="!check !dbg !strip"  # No test suite.
license="GPL-2.0-only"
depends="easy-kernel-modules-$_kver"
makedepends="easy-kernel-src-$_kver"
provides="$_pkgname=$pkgver"
subpackages="wireguard-patch:_patch:noarch"
source="https://git.zx2c4.com/$_pkgreal/snapshot/$_pkgreal-$pkgver.tar.xz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	make -C src LDFLAGS="" KERNELDIR="/usr/src/linux-$_kver" module
}

package() {
	if [ -f $HOME/kernel_key.pem ]; then
		/usr/src/linux-$_kver/scripts/sign-file sha512 \
			$HOME/kernel_key.pem $HOME/kernel_key.pem \
			"$builddir"/src/wireguard.ko
	fi
	make -C src DEPMOD=true KERNELDIR="/usr/src/linux-$_kver" INSTALL_MOD_PATH="$pkgdir" module-install
}

_patch() {
	depends=""
	pkgdesc="Kernel patch for the WireGuard VPN"

	mkdir -p "$subpkgdir/usr/share/wireguard"
	"$builddir"/kernel-tree-scripts/create-patch.sh > "$subpkgdir/usr/share/wireguard/wireguard-$pkgver.patch"
}

sha512sums="894da609c7102eb1d076a4a7bdaa96c7d5f0d64b4b86fdf01068ac5f4af966652e7ad7f18b1295a7fc4447f53b55a9ec45f1b3f36f0f9df7fb08836dfdff89f0  wireguard-linux-compat-1.0.20200401.tar.xz"