Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions net-vpn/wireguard-tools/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DIST wireguard-tools-1.0.20210914-3ba6527.tar.gz 128305 BLAKE2B 062bbc762d8197ff5624bf460ac7325ba780d465d8dd2a0f3bff3f99ab645e20f0f51f63176a0c719c7087643a55a7f3752bc44f7dabbe6c8fde3c2e3e478626 SHA512 d679fbdc1e30c143cd3fe961d2a549673fcf37f4e657f094ca6c272563a19288325a7106d07fa26990773ac16e00e17cf94a6abc32352dc458426b8ff57753a8
DIST wireguard-tools-1.0.20250521.tar.gz 128962 BLAKE2B bc3b766fa8cbb49d11558b0f6a47f7e53e61806111cfd90edd34e87f45190c622b660685fb87797071f19d9352e5969759cb6bc31e79586cf415269524766580 SHA512 6c36a875e5e7d8b1106de7b2ae2e46f929e27e99f0f9271b1be6fcc862ec512b6c6dd4c0786a32118b62c9c8e7d2ba0d274f107e07de60f7a9e7db428a0c87c8
46 changes: 46 additions & 0 deletions net-vpn/wireguard-tools/files/wg-quick.initd
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/sbin/openrc-run
# Distributed under the terms of the GNU General Public License v2

name="WireGuard"
description="WireGuard via wg-quick(8)"
extra_started_commands="reload"

depend() {
need net
use dns
}

CONF="${SVCNAME#*.}"

checkconfig() {
if [ "$CONF" = "$SVCNAME" ]; then
eerror "You cannot call this init script directly. You must create a symbolic link to it with the configuration name:"
eerror " ln -s /etc/init.d/wg-quick /etc/init.d/wg-quick.vpn0"
eerror "And then call it instead:"
eerror " /etc/init.d/wg-quick.vpn0 start"
return 1
fi
return 0
}

start() {
checkconfig || return 1
ebegin "Starting $description for $CONF"
wg-quick up "$CONF"
eend $? "Failed to start $description for $CONF"
}

stop() {
checkconfig || return 1
ebegin "Stopping $description for $CONF"
wg-quick down "$CONF"
eend $? "Failed to stop $description for $CONF"
}

reload() {
checkconfig || return 1
ebegin "Reloading $description for $CONF"
wg syncconf "$CONF" <(wg-quick strip "$CONF")
eend $? "Failed to reload $description for $CONF"
}

54 changes: 54 additions & 0 deletions net-vpn/wireguard-tools/wireguard-tools-1.0.20250521-r1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Distributed under the terms of the GNU General Public License v2
# Autogen by MARK Devkit

EAPI=7
inherit bash-completion-r1 systemd toolchain-funcs

DESCRIPTION="Required tools for WireGuard, such as wg(8) and wg-quick(8)"
HOMEPAGE="https://www.wireguard.com/"
SRC_URI="https://api.github.com/repos/WireGuard/wireguard-tools/tarball/refs/tags/v1.0.20250521 -> wireguard-tools-1.0.20250521.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="*"
IUSE="systemd"
BDEPEND="virtual/pkgconfig
"

post_src_unpack() {
mv WireGuard-wireguard-tools-* ${S}
}


src_compile() {
emake RUNSTATEDIR="${EPREFIX}/run" \
-C src CC="$(tc-getCC)" LD="$(tc-getLD)"
}
src_install() {
local emakeargs=(
WITH_BASHCOMPLETION=yes
WITH_WGQUICK=yes
DESTDIR="${D}"
BASHCOMPDIR="$(get_bashcompdir)"
SYSTEMDUNITDIR="$(systemd_get_systemunitdir)"
PREFIX="${EPREFIX}/usr"
)
if use systemd ; then
emakeargs+=(
WITH_SYSTEMDUNITS=yes
)
else
emakeargs+=(
WITH_SYSTEMDUNITS=no
)
fi
dodoc README.md
dodoc -r contrib
emake "${emakeargs[@]}" -C src install
if ! use systemd ; then
newinitd "${FILESDIR}"/wg-quick.initd wg-quick
fi
}



# vim: filetype=ebuild
Loading