diff options
author | Adrian Perez de Castro | 2014-05-08 18:48:25 +0300 |
---|---|---|
committer | Adrian Perez de Castro | 2015-07-14 11:58:54 +0300 |
commit | 27bdcfcc30c26768b772d4b70c365e9cd0266dc4 (patch) | |
tree | 4b867efe616d2f23a59e35174ca874baa807fb2b | |
download | aur-27bdcfcc30c26768b772d4b70c365e9cd0266dc4.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | Makefile | 68 | ||||
-rw-r--r-- | PKGBUILD | 46 | ||||
-rw-r--r-- | fix-paths.patch | 29 | ||||
-rw-r--r-- | sigmavpn.conf | 13 |
5 files changed, 176 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..e5731f4ba8c2 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,20 @@ +pkgbase = sigmavpn + pkgdesc = Light-weight, secure and modular VPN solution + pkgver = 0.2 + pkgrel = 1 + url = http://frozenriver.net/SigmaVPN + arch = x86_64 + arch = i686 + arch = arm + license = BSD + source = http://sigmavpn.googlecode.com/files/sigmavpn-0.2.tar.gz + source = fix-paths.patch + source = Makefile + source = sigmavpn.conf + sha1sums = 711c43967208ec1f4d1c6fc9ef36e19830405bc5 + sha1sums = 59a308938341d1e13373b49ce482bb642fbc06fc + sha1sums = fb0fc62c58049feee34247efe99d619d9f6459b6 + sha1sums = a5dd10b1599079f45bba4398fb295696c76cd9f2 + +pkgname = sigmavpn + diff --git a/Makefile b/Makefile new file mode 100644 index 000000000000..d55b84a1c8bc --- /dev/null +++ b/Makefile @@ -0,0 +1,68 @@ +# +# Makefile +# Adrian Perez, 2014-05-08 17:42 +# + +LDFLAGS = $(EXTRA_LDFLAGS) -ldl -lpthread +CFLAGS = $(EXTRA_CFLAGS) -fPIC + +define link-shared +$(CC) -shared -o $@ $^ $(LDFLAGS) +endef + +define link-bin +$(CC) -o $@ $^ $(LDFLAGS) +endef + +all: sigmavpn proto_raw.o intf_udp.o intf_dummy.o intf_tuntap.o + +sigmavpn: main.o modules.o types.o dep/ini.o + $(link-bin) +proto_raw.o: proto/proto_raw.o + $(link-shared) +intf_dummy.o: intf/intf_dummy.o + $(link-shared) +intf_tuntap.o: intf/intf_tuntap.o + $(link-shared) +intf_udp.o: intf/intf_udp.o + $(link-shared) + + +ifeq ($(USE_SODIUM),1) +SODIUM_CFLAGS := $(shell pkg-config libsodium --cflags) +SODIUM_LIBS := $(shell pkg-config libsodium --libs) + +fake-include-dir: include +include: + ln -sf /usr/include/sodium $@ +.PHONY: fake-include-dir + +all: fake-include-dir | naclkeypair proto_nacl0.o proto_nacltai.o + +naclkeypair: CFLAGS += $(SODIUM_CFLAGS) +naclkeypair: LDFLAGS += $(SODIUM_LIBS) +naclkeypair: naclkeypair.o types.o + $(link-bin) + +proto_nacl0.o: CFLAGS += $(SODIUM_CFLAGS) +proto_nacl0.o: LDFLAGS += $(SODIUM_LIBS) +proto_nacl0.o: proto/proto_nacl0.o types.o + $(link-shared) + +proto_nacltai.o: CFLAGS += $(SODIUM_CFLAGS) +proto_nacltai.o: LDFLAGS += $(SODIUM_LIBS) +proto_nacltai.o: proto/proto_nacltai.o types.o + $(link-shared) +endif + +clean: + $(RM) sigmavpn main.o modules.o types.o dep/ini.o + $(RM) proto_raw.o proto/proto_raw.o + $(RM) proto_nacl0.o proto/proto_nacl0.o + $(RM) proto_nacltai.o proto/proto_nacltai.o + $(RM) intf_udp.o intf/intf_udp.o + $(RM) intf_dummy.o intf/intf_dummy.o + $(RM) intf_tuntap.o intf/intf_tuntap.o + +# vim:ft=make +# diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..296a7daadb54 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,46 @@ +pkgname='sigmavpn' +pkgver='0.2' +pkgrel='1' +pkgdesc='Light-weight, secure and modular VPN solution' +url='http://frozenriver.net/SigmaVPN' +license=('BSD') +source=( + "http://sigmavpn.googlecode.com/files/${pkgname}-${pkgver}.tar.gz" + fix-paths.patch + Makefile + sigmavpn.conf +) +sha1sums=('711c43967208ec1f4d1c6fc9ef36e19830405bc5' + '59a308938341d1e13373b49ce482bb642fbc06fc' + 'fb0fc62c58049feee34247efe99d619d9f6459b6' + 'a5dd10b1599079f45bba4398fb295696c76cd9f2') +arch=('x86_64' 'i686' 'arm') + +prepare () { + cd "${pkgname}-${pkgver}" + patch -p0 < "${srcdir}/fix-paths.patch" + cp -v "${srcdir}/Makefile" . +} + +build () { + cd "${pkgname}-${pkgver}" + eval "$(sed -e '/^CFLAGS=/p' -e d /etc/makepkg.conf)" + eval "$(sed -e '/^LDFLAGS=/p' -e d /etc/makepkg.conf)" + make USE_SODIUM=1 EXTRA_CFLAGS="${CFLAGS}" EXTRA_LDFLAGS="${LDFLAGS}" +} + +package () { + cd "${pkgname}-${pkgver}" + install -m 755 -d "${pkgdir}/usr/bin" + install -m 755 -t "${pkgdir}/usr/bin" \ + sigmavpn naclkeypair + install -m 755 -d "${pkgdir}/usr/lib/sigmavpn" + install -m 755 -t "${pkgdir}/usr/lib/sigmavpn" \ + intf_*.o proto_*.o + install -m 755 -d "${pkgdir}/usr/share/man/man1" + install -m 644 -t "${pkgdir}/usr/share/man/man1" \ + sigmavpn.1 + install -m 755 -d "${pkgdir}/etc" + install -m 755 -t "${pkgdir}/etc" \ + "${srcdir}/sigmavpn.conf" +} diff --git a/fix-paths.patch b/fix-paths.patch new file mode 100644 index 000000000000..0c5c5a4f8824 --- /dev/null +++ b/fix-paths.patch @@ -0,0 +1,29 @@ +--- main.c.orig 2014-05-08 18:34:30.502301834 +0300 ++++ main.c 2014-05-08 18:34:38.992301468 +0300 +@@ -167,8 +167,8 @@ + printf("SigmaVPN.\nCopyright (c) 2011 Neil Alexander T. All rights reserved.\n"); + + conf = malloc(sizeof(sigma_conf)); +- strncpy(conf->modulepath, "/usr/local/lib/sigmavpn/", 128); +- strncpy(conf->configfile, "/usr/local/etc/sigmavpn.conf", 128); ++ strncpy(conf->modulepath, "/usr/lib/sigmavpn/", 128); ++ strncpy(conf->configfile, "/etc/sigmavpn.conf", 128); + + int arg; + +--- sigmavpn.1.orig 2014-05-08 18:35:23.948966193 +0300 ++++ sigmavpn.1 2014-05-08 18:35:34.902299052 +0300 +@@ -19,11 +19,11 @@ + .Bl -tag -width -indent + .It Fl c + Path to the configuration file. If not specified, the default +-.Ar /usr/local/etc/sigmavpn.conf ++.Ar /etc/sigmavpn.conf + is assumed. + .It Fl m + Path to the module directory. If not specified, the default +-.Ar /usr/local/lib/sigmavpn/ ++.Ar /usr/lib/sigmavpn/ + is assumed. + .El + .Pp diff --git a/sigmavpn.conf b/sigmavpn.conf new file mode 100644 index 000000000000..c98171c17fdd --- /dev/null +++ b/sigmavpn.conf @@ -0,0 +1,13 @@ +# Check this HOWTO to know how to configure SigmaVPN: +# http://code.google.com/p/sigmavpn/wiki/SecureTunnelHowto +[peername] +proto = nacltai +proto_publickey = +proto_privatekey = +local = tuntap +local_interface = +peer = udp +peer_remoteaddr = +peer_remoteport = +peer_localaddr = +peer_localport = |