Skip to content

Commit db08c9a

Browse files
authored
Merge pull request #1235 from nshalman/wireguard
WireGuard packages (wireguard-go and wireguard-tools)
2 parents ea5ac54 + 800489a commit db08c9a

File tree

7 files changed

+212
-0
lines changed

7 files changed

+212
-0
lines changed

build/wireguard-go/build.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/bash
2+
#
3+
# {{{ CDDL HEADER
4+
#
5+
# This file and its contents are supplied under the terms of the
6+
# Common Development and Distribution License ("CDDL"), version 1.0.
7+
# You may only use this file in accordance with the terms of version
8+
# 1.0 of the CDDL.
9+
#
10+
# A full copy of the text of the CDDL should have accompanied this
11+
# source. A copy of the CDDL is also available via the Internet at
12+
# http://www.illumos.org/license/CDDL.
13+
# }}}
14+
15+
# Copyright 2023 OmniOS Community Edition (OmniOSce) Association.
16+
17+
. ../../lib/build.sh
18+
19+
PROG=wireguard-go
20+
PKG=ooce/network/wireguard-go
21+
VER=0.0.20220316
22+
HASH=c8619d9
23+
SUMMARY="Go Implementation of WireGuard"
24+
DESC="This is an implementation of WireGuard in Go."
25+
26+
RUN_DEPENDS_IPS="driver/tuntap"
27+
28+
set_arch 64
29+
set_gover 119
30+
31+
build_and_install() {
32+
pushd $TMPDIR/$BUILDDIR > /dev/null
33+
logcmd $MAKE PREFIX=$PREFIX DESTDIR=$DESTDIR install \
34+
|| logerr "Unable to build wireguard-go"
35+
popd >/dev/null
36+
}
37+
38+
init
39+
# Use nshalman fork until it is fully upstreamed
40+
clone_go_source $PROG nshalman $HASH
41+
prep_build
42+
build_and_install
43+
make_package
44+
clean_up
45+
46+
# Vim hints
47+
# vim:ts=4:sw=4:et:fdm=marker

build/wireguard-go/local.mog

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# This file and its contents are supplied under the terms of the
3+
# Common Development and Distribution License ("CDDL"), version 1.0.
4+
# You may only use this file in accordance with the terms of version
5+
# 1.0 of the CDDL.
6+
#
7+
# A full copy of the text of the CDDL should have accompanied this
8+
# source. A copy of the CDDL is also available via the Internet at
9+
# http://www.illumos.org/license/CDDL.
10+
11+
# Copyright 2023 OmniOS Community Edition (OmniOSce) Association.
12+
13+
license LICENSE license=MIT
14+

build/wireguard-tools/build.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/usr/bin/bash
2+
#
3+
# {{{ CDDL HEADER
4+
#
5+
# This file and its contents are supplied under the terms of the
6+
# Common Development and Distribution License ("CDDL"), version 1.0.
7+
# You may only use this file in accordance with the terms of version
8+
# 1.0 of the CDDL.
9+
#
10+
# A full copy of the text of the CDDL should have accompanied this
11+
# source. A copy of the CDDL is also available via the Internet at
12+
# http://www.illumos.org/license/CDDL.
13+
# }}}
14+
15+
# Copyright 2023 OmniOS Community Edition (OmniOSce) Association.
16+
17+
. ../../lib/build.sh
18+
19+
PROG=wireguard-tools
20+
PKG=ooce/network/wireguard-tools
21+
VER=1.0.20210914
22+
HASH=8588ad1
23+
SUMMARY="Tools for configuring WireGuard"
24+
DESC="This supplies the main userspace tooling for using and configuring "
25+
DESC+="WireGuard tunnels, including the wg(8) and wg-quick(8) utilities."
26+
27+
RUN_DEPENDS_IPS="ooce/network/wireguard-go"
28+
29+
XFORM_ARGS+="
30+
-DPREFIX=${PREFIX#/}
31+
-DPROG=$PROG
32+
-DSERVICE=ooce/network/wg-quick
33+
"
34+
35+
build_and_install() {
36+
pushd $TMPDIR/$BUILDDIR/$PROG/src
37+
logcmd $MAKE \
38+
SYSCONFDIR=/etc$PREFIX \
39+
PREFIX=$PREFIX \
40+
DESTDIR=$DESTDIR \
41+
WITH_WGQUICK=yes \
42+
install \
43+
|| logerr "unable to build wireguard-tools"
44+
popd >/dev/null
45+
}
46+
47+
init
48+
prep_build
49+
# Use nshalman fork until it is fully upstreamed
50+
clone_github_source $PROG $GITHUB/nshalman/$PROG $HASH
51+
build_and_install
52+
xform files/wg-quick.xml > $TMPDIR/network-wg-quick.xml
53+
install_smf ooce network-wg-quick.xml
54+
make_package
55+
clean_up
56+
57+
# Vim hints
58+
# vim:ts=4:sw=4:et:fdm=marker
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?xml version="1.0"?>
2+
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
3+
<service_bundle type="manifest"
4+
name="export">
5+
6+
<service name="$(SERVICE)"
7+
type="service"
8+
version="0">
9+
10+
<dependency name="network"
11+
grouping="require_all"
12+
restart_on="error"
13+
type="service">
14+
<service_fmri value="svc:/milestone/network:default" />
15+
</dependency>
16+
17+
<dependency name="filesystem"
18+
grouping="require_all"
19+
restart_on="error"
20+
type="service">
21+
<service_fmri value="svc:/system/filesystem/local" />
22+
</dependency>
23+
24+
<exec_method name="start"
25+
type="method"
26+
exec="/$(PREFIX)/bin/wg-quick up %i"
27+
timeout_seconds="180">
28+
<method_context>
29+
<method_credential group="root"
30+
user="root" />
31+
<method_environment>
32+
<envvar name="WG_QUICK_USERSPACE_IMPLEMENTATION"
33+
value="/$(PREFIX)/bin/wireguard-go" />
34+
</method_environment>
35+
</method_context>
36+
</exec_method>
37+
38+
<exec_method name="stop"
39+
type="method"
40+
exec="/$(PREFIX)/bin/wg-quick down %i"
41+
timeout_seconds="180">
42+
<method_context>
43+
<method_credential group="root"
44+
user="root" />
45+
<method_environment>
46+
<envvar name="WG_QUICK_USERSPACE_IMPLEMENTATION"
47+
value="/$(PREFIX)/bin/wireguard-go" />
48+
</method_environment>
49+
</method_context>
50+
</exec_method>
51+
52+
<property_group name="application"
53+
type="application" />
54+
55+
<property_group name="startd"
56+
type="framework">
57+
<propval name="duration"
58+
type="astring"
59+
value="contract" />
60+
<propval name="ignore_error"
61+
type="astring"
62+
value="core,signal" />
63+
</property_group>
64+
65+
<stability value="Evolving" />
66+
67+
<template>
68+
<common_name>
69+
<loctext xml:lang="C">WireGuard via wg-quick(8)</loctext>
70+
</common_name>
71+
</template>
72+
73+
</service>
74+
75+
</service_bundle>

build/wireguard-tools/local.mog

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
# This file and its contents are supplied under the terms of the
3+
# Common Development and Distribution License ("CDDL"), version 1.0.
4+
# You may only use this file in accordance with the terms of version
5+
# 1.0 of the CDDL.
6+
#
7+
# A full copy of the text of the CDDL should have accompanied this
8+
# source. A copy of the CDDL is also available via the Internet at
9+
# http://www.illumos.org/license/CDDL.
10+
11+
# Copyright 2023 OmniOS Community Edition (OmniOSce) Association.
12+
13+
license wireguard-tools/COPYING license=GPLv2
14+

doc/baseline

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ extra.omnios ooce/network/socat r
195195
extra.omnios ooce/network/tailscale
196196
extra.omnios ooce/network/tcpdump
197197
extra.omnios ooce/network/unbound
198+
extra.omnios ooce/network/wireguard-go
199+
extra.omnios ooce/network/wireguard-tools
198200
extra.omnios ooce/network/znc
199201
extra.omnios ooce/omnios-build-tools
200202
extra.omnios ooce/ooceapps

doc/packages.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@
160160
| ooce/network/tailscale | 1.36.0 | https://www.tailscale.com/ | [nshalman](https://github.com/nshalman)
161161
| ooce/network/tcpdump | 4.99.1 | https://www.tcpdump.org/release/ | [omniosorg](https://github.com/omniosorg)
162162
| ooce/network/unbound | 1.17.1 | https://nlnetlabs.nl/downloads/unbound/ | [omniosorg](https://github.com/omniosorg)
163+
| ooce/network/wireguard-go | 0.0.20220316 | https://www.wireguard.com/ | [nshalman](https://github.com/nshalman)
164+
| ooce/network/wireguard-tools | 1.0.20210914 | https://www.wireguard.com/ | [nshalman](https://github.com/nshalman)
163165
| ooce/network/znc | 1.8.2 | https://github.com/znc/znc/tags | [omniosorg](https://github.com/omniosorg)
164166
| ooce/ooceapps | github-latest | https://github.com/omniosorg/ooceapps/releases | [omniosorg](https://github.com/omniosorg)
165167
| ooce/print/cups | 2.4.2 | https://github.com/OpenPrinting/cups/releases | [omniosorg](https://github.com/omniosorg)

0 commit comments

Comments
 (0)