Subject: [alpine-aports] [PATCH] testing/fastd: new aport

From: Johannes Matheis <[email-masked]>
Date: Sun, 8 Feb 2015 13:25:10 +0000

Fast and Secure Tunneling Daemon
https://projects.universe-factory.net/projects/fastd
---
 testing/fastd/APKBUILD    | 62 +++++++++++++++++++++++++++++++++++++++++++++++
 testing/fastd/fastd.conf  | 34 ++++++++++++++++++++++++++
 testing/fastd/fastd.initd | 19 +++++++++++++++
 3 files changed, 115 insertions(+)
 create mode 100644 testing/fastd/APKBUILD
 create mode 100644 testing/fastd/fastd.conf
 create mode 100755 testing/fastd/fastd.initd

diff --git a/testing/fastd/APKBUILD b/testing/fastd/APKBUILD
new file mode 100644
index 0000000..0d4ef5e
--- /dev/null
+++ b/testing/fastd/APKBUILD
@@ -0,0 +1,62 @@
+# Contributor: Johannes Matheis <[email-masked]>
+# Maintainer: Johannes Matheis <[email-masked]>
+pkgname=fastd
+pkgver=17
+pkgrel=0
+pkgdesc="Fast and Secure Tunneling Daemon"
+url="https://projects.universe-factory.net/projects/fastd"
+arch="all"
+license="BSD"
+depends=""
+depends_dev="libsodium-dev cmake libcap-dev doxygen libuecc-dev bison json-c-dev"
+makedepends="$depends_dev"
+install=""
+subpackages="$pkgname-doc"
+source="http://git.universe-factory.net/${pkgname}/snapshot/${pkgname}-${pkgver}.tar
+	fastd.conf
+	fastd.initd"
+
+_builddir="$srcdir/${pkgname}-${pkgver}"
+prepare() {
+	local i
+	cd "$_builddir"
+	for i in $source; do
+		case $i in
+		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+		esac
+	done
+}
+
+build() {
+	cd "$_builddir"
+	mkdir build
+	cd build
+	cmake \
+		-D CMAKE_AR=/usr/bin/ar \
+		-D CMAKE_RANLIB=/usr/bin/ranlib \
+		-D CMAKE_NM=/usr/bin/nm \
+		-D CMAKE_INSTALL_PREFIX=/usr \
+		-D ENABLE_SYSTEMD=OFF \
+		..
+	make
+}
+
+package() {
+	cd "$_builddir/build"
+	make install DESTDIR="${pkgdir}"
+	install -Dm644  "$srcdir/${pkgname}-${pkgver}/COPYRIGHT" "${pkgdir}/usr/share/licenses/${pkgname}/COPYRIGHT"
+	install -Dm644 "$srcdir/${pkgname}-${pkgver}/doc/fastd.1" "${pkgdir}/usr/share/man/man1/fastd.1"
+	install -D -m600 ${srcdir}/fastd.conf "${pkgdir}"/etc/fastd/fastd.conf
+	install -D -m755 ${srcdir}/fastd.initd "${pkgdir}"/etc/init.d/fastd
+	install -d -m700 "${pkgdir}"/etc/fastd/peers/
+}
+
+md5sums="40c9efd2c7eaba42b9b93add4a462b17  fastd-17.tar
+383a11cb8d804e6d91c2c66eb07b4246  fastd.conf
+f9516c8219b304ddb3ab5dc205e82937  fastd.initd"
+sha256sums="20390fc2110929ebf37feebe1bcce68d7920a5efd42c369bd2d886c6781966dc  fastd-17.tar
+6c7821e9c6b85ee2baf2d5e2e7b1eb28d3ceebe876e3cb6686b3c1cb6649db68  fastd.conf
+dfc473baee3b7e1e509131010dc3d0a1b62bc7c684cc54daca1a91255e4a0dd2  fastd.initd"
+sha512sums="152e9b6a2df39375061aedee2e2ac586916ae634cd57ee8902f152d86a27db5d6353f411e038139721073caf35696c349aed2c09165578d81fe47daebead18e8  fastd-17.tar
+3e6c3a77f93a1e670e8f018833c499e8ec57b8240a6f472da03254ad9a7e6fed2c3459fa47b06c97e42afcfe6f0adfaaec39bce6b6a286a1ce7ef3585853b118  fastd.conf
+c0fff880384aa35e9d1d84ce98b2a103f1e974dfa54a29a65d7f0ff7d6e4b88d7afa51f0c1025b68078885d310f3a7a1d941149ec49025675d23310597c55906  fastd.initd"
diff --git a/testing/fastd/fastd.conf b/testing/fastd/fastd.conf
new file mode 100644
index 0000000..9553d4c
--- /dev/null
+++ b/testing/fastd/fastd.conf
@@ -0,0 +1,34 @@
+# To run multiple fastd instances, copy this file to /etc/fastd/example.conf,
+# create a symlink /etc/init.d/fastd.example -> fastd
+# and initialize the tunnel by issuing: rc-service fastd.example start
+
+# See also: http://fastd.readthedocs.org/en/v17/manual/config.html
+
+# Log warnings and errors to stderr
+log level warn;
+
+# Log everything to syslog
+#log to syslog level debug;
+
+# Set the interface name
+interface "mesh-vpn";
+
+# Support salsa2012+umac and null methods, prefer salsa2012+umac
+method "salsa2012+umac";
+
+# Sets the handshake protocol; at the moment only ec25519-fhmqvc is supported.
+protocol "ec25519-fhmqvc";
+
+# Bind to a fixed port, IPv4 only
+bind 0.0.0.0:10000;
+
+# Secret key generated by `fastd --generate-key`
+secret "";
+
+# Set the interface MTU for TAP mode with xsalsa20/aes128 over IPv4 with a base MTU of 1492 (PPPoE)
+# (see MTU selection documentation)
+mtu 1428;
+
+# Include peers from the directory 'peers'
+include peers from "peers";
+
diff --git a/testing/fastd/fastd.initd b/testing/fastd/fastd.initd
new file mode 100755
index 0000000..a978546
--- /dev/null
+++ b/testing/fastd/fastd.initd
@@ -0,0 +1,19 @@
+#!/sbin/runscript
+
+VPN=${SVCNAME#*.}
+if [ ${SVCNAME} != "fastd" ]; then
+  pidfile="/var/run/fastd.${VPN}.pid"
+else
+  pidfile="/var/run/fastd.pid"
+fi
+
+command=/usr/bin/fastd
+command_args="--daemon --pid-file ${pidfile} --config /etc/fastd/${VPN}.conf"
+if [ ${SVCNAME} == "fastd" ]; then
+  name="fastd"
+else
+  name="fastd ${VPN}"
+fi
+description="fastd VPN daemon"
+
+
-- 
2.2.1

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---