Skip to content

Commit

Permalink
wireguard-tools: Import version 1.0.20210914.
Browse files Browse the repository at this point in the history
Based on omniosorg/omnios-extra#1235, will need
to live in pkgsrc-extra until nshalman fork is merged upstream.
  • Loading branch information
jperkin committed Jan 9, 2023
1 parent 8615489 commit 4423c14
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 0 deletions.
4 changes: 4 additions & 0 deletions wireguard-tools/DESCR
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
wireguard-tools - tools for configuring WireGuard

This supplies the main userspace tooling for using and configuring WireGuard
tunnels, including the wg(8) and wg-quick(8) utilities.
22 changes: 22 additions & 0 deletions wireguard-tools/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# $NetBSD$

DISTNAME= wireguard-tools-1.0.20210914
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_GITHUB:=nshalman/}
GITHUB_TAG= 8588ad10c513e50f2b051a4c48ffe33af562a9d5

MAINTAINER= [email protected]
HOMEPAGE= https://github.com/nshalman/wireguard-tools
COMMENT= Tools for configuring WireGuard
LICENSE= gnu-gpl-v2

USE_TOOLS+= bash:run gmake

BUILD_DIRS= src
MAKE_FLAGS+= WITH_WGQUICK=yes
MAKE_FLAGS+= MANDIR=${PREFIX}/${PKGMANDIR}

REPLACE_BASH+= src/wg-quick/darwin.bash
REPLACE_BASH+= src/wg-quick/sunos.bash

.include "../../mk/bsd.pkg.mk"
7 changes: 7 additions & 0 deletions wireguard-tools/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@comment $NetBSD$
bin/wg
bin/wg-quick
man/man8/wg-quick.8
man/man8/wg.8
share/bash-completion/completions/wg
share/bash-completion/completions/wg-quick
6 changes: 6 additions & 0 deletions wireguard-tools/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$NetBSD$

BLAKE2s (wireguard-tools-1.0.20210914-8588ad10c513e50f2b051a4c48ffe33af562a9d5.tar.gz) = e03de4167fa1b341f9a9df95b1aaba8c63c5a4083566ef2cc9400b89a9f1ef35
SHA512 (wireguard-tools-1.0.20210914-8588ad10c513e50f2b051a4c48ffe33af562a9d5.tar.gz) = 6281665c48cd4609ebe3512ed0104f5a9ede1e4c6d1fef741be6fbfe35345729940d54770bb422937775f8cb55bf991e0dd123d19fce19ec3f0127a4c4d02898
Size (wireguard-tools-1.0.20210914-8588ad10c513e50f2b051a4c48ffe33af562a9d5.tar.gz) = 130139 bytes
SHA1 (patch-src_Makefile) = 083d6bf0e2517798110faa05fddc0cb718c45a3d
39 changes: 39 additions & 0 deletions wireguard-tools/files/smf/manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="@SMF_NAME@">
<service name="@SMF_PREFIX@/@SMF_NAME@" type="service" version="1">
<dependency name="network" grouping="require_all" restart_on="error" type="service">
<service_fmri value="svc:/milestone/network:default" />
</dependency>
<dependency name="filesystem" grouping="require_all" restart_on="error" type="service">
<service_fmri value="svc:/system/filesystem/local" />
</dependency>
<exec_method name="start" type="method" exec="@PREFIX@/bin/wg-quick up %i" timeout_seconds="180">
<method_context>
<method_credential group="root" user="root" />
<method_environment>
<envvar name="WG_QUICK_USERSPACE_IMPLEMENTATION" value="@PREFIX@/bin/wireguard-go" />
</method_environment>
</method_context>
</exec_method>
<exec_method name="stop" type="method" exec="@PREFIX@/bin/wg-quick down %i" timeout_seconds="180">
<method_context>
<method_credential group="root" user="root" />
<method_environment>
<envvar name="WG_QUICK_USERSPACE_IMPLEMENTATION" value="@PREFIX@/bin/wireguard-go" />
</method_environment>
</method_context>
</exec_method>
<property_group name="application" type="application" />
<property_group name="startd" type="framework">
<propval name="duration" type="astring" value="contract" />
<propval name="ignore_error" type="astring" value="core,signal" />
</property_group>
<stability value="Evolving" />
<template>
<common_name>
<loctext xml:lang="C">WireGuard via wg-quick(8)</loctext>
</common_name>
</template>
</service>
</service_bundle>
32 changes: 32 additions & 0 deletions wireguard-tools/patches/patch-src_Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
$NetBSD$

install -v is not portable.

--- src/Makefile.orig 2022-12-28 17:23:02.000000000 +0000
+++ src/Makefile
@@ -94,18 +94,18 @@ clean:
$(RM) wg *.o *.d $(wildcard wincompat/*.o wincompat/*.lib wincompat/*.dll)

install: wg
- @install -v -d "$(DESTDIR)$(BINDIR)" && install -v -m 0755 wg "$(DESTDIR)$(BINDIR)/wg"
- @install -v -d "$(DESTDIR)$(MANDIR)/man8" && install -v -m 0644 man/wg.8 "$(DESTDIR)$(MANDIR)/man8/wg.8"
+ @install -d "$(DESTDIR)$(BINDIR)" && install -m 0755 wg "$(DESTDIR)$(BINDIR)/wg"
+ @install -d "$(DESTDIR)$(MANDIR)/man8" && install -m 0644 man/wg.8 "$(DESTDIR)$(MANDIR)/man8/wg.8"
@[ "$(WITH_BASHCOMPLETION)" = "yes" ] || exit 0; \
- install -v -d "$(DESTDIR)$(BASHCOMPDIR)" && install -v -m 0644 completion/wg.bash-completion "$(DESTDIR)$(BASHCOMPDIR)/wg"
+ install -d "$(DESTDIR)$(BASHCOMPDIR)" && install -m 0644 completion/wg.bash-completion "$(DESTDIR)$(BASHCOMPDIR)/wg"
@[ "$(WITH_WGQUICK)" = "yes" ] || exit 0; \
- install -v -m 0755 wg-quick/$(PLATFORM).bash "$(DESTDIR)$(BINDIR)/wg-quick" && install -v -m 0700 -d "$(DESTDIR)$(SYSCONFDIR)/wireguard"
+ install -m 0755 wg-quick/$(PLATFORM).bash "$(DESTDIR)$(BINDIR)/wg-quick" && install -m 0700 -d "$(DESTDIR)$(SYSCONFDIR)/wireguard"
@[ "$(WITH_WGQUICK)" = "yes" ] || exit 0; \
- install -v -m 0644 man/wg-quick.8 "$(DESTDIR)$(MANDIR)/man8/wg-quick.8"
+ install -m 0644 man/wg-quick.8 "$(DESTDIR)$(MANDIR)/man8/wg-quick.8"
@[ "$(WITH_WGQUICK)" = "yes" -a "$(WITH_BASHCOMPLETION)" = "yes" ] || exit 0; \
- install -v -m 0644 completion/wg-quick.bash-completion "$(DESTDIR)$(BASHCOMPDIR)/wg-quick"
+ install -m 0644 completion/wg-quick.bash-completion "$(DESTDIR)$(BASHCOMPDIR)/wg-quick"
@[ "$(WITH_WGQUICK)" = "yes" -a "$(WITH_SYSTEMDUNITS)" = "yes" ] || exit 0; \
- install -v -d "$(DESTDIR)$(SYSTEMDUNITDIR)" && install -v -m 0644 systemd/* "$(DESTDIR)$(SYSTEMDUNITDIR)/"
+ install -d "$(DESTDIR)$(SYSTEMDUNITDIR)" && install -m 0644 systemd/* "$(DESTDIR)$(SYSTEMDUNITDIR)/"

check: clean
scan-build --html-title=wireguard-tools -maxloop 100 --view --keep-going $(MAKE) wg

0 comments on commit 4423c14

Please sign in to comment.