clean fix

This commit is contained in:
Vladislav Minakov 2025-02-16 19:07:39 +03:00
parent 10c75be383
commit dec70d0528
2 changed files with 12 additions and 2 deletions

View File

@ -1,7 +1,7 @@
pkgbase = amneziawg-dkms
pkgdesc = AmneziaWG is a contemporary version of the popular VPN protocol, WireGuard.
pkgver = 1.0.20241112
pkgrel = 2
pkgrel = 3
url = https://github.com/amnezia-vpn/amneziawg-linux-kernel-module
arch = x86_64
license = GPLv2

View File

@ -5,7 +5,7 @@ pkgdesc="AmneziaWG is a contemporary version of the popular VPN protocol, WireGu
url="https://github.com/amnezia-vpn/amneziawg-linux-kernel-module"
arch=("x86_64")
pkgver=1.0.20241112
pkgrel=2
pkgrel=3
license=('GPLv2')
provides=("AMNEZIAWG-MODULE=${pkgver}")
source=("$pkgname-$pkgver.tar.gz::https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/archive/refs/tags/v${pkgver}.tar.gz")
@ -21,6 +21,16 @@ kernel_major="${1%%[^0-9]*}"
wget "https://cdn.kernel.org/pub/linux/kernel/v${kernel_major}.x/linux-${kernel}.tar.xz" -O- | tar -xvJf - --wildcards linux-${kernel}/drivers/net/wireguard "linux-${kernel}/K*" linux-${kernel}/include/uapi/linux/
ln -sf linux-${kernel} kernel;
EOF
cat > "${srcdir}/amneziawg-linux-kernel-module-${pkgver}/kernel-tree-scripts/cleanup-sources.sh" <<'EOF'
#!/bin/bash
AWG_TEMP_DIR="$(cat /var/lib/amnezia/amneziawg/.tempdir 2>/dev/null)"
PREFIX=${AWG_TEMP_DIR:-/tmp}
WORKDIR="${PREFIX}/amneziawg"
[ -e kernel ] && rm -rf kernel
if [[ -d "${WORKDIR}" ]]; then
rm -rf "${WORKDIR}";
fi
EOF
cd ${srcdir}/amneziawg-linux-kernel-module-${pkgver}/src
sed -i 's/MODERN_KERNEL_SOURCES_NOT_FOUND_ERROR/KERNEL_SRC_ABSENT_ERR/g' Makefile
make DESTDIR=${pkgdir} dkms-install