aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpi <pi@FreeBSD.org>2015-09-02 00:30:28 +0800
committerpi <pi@FreeBSD.org>2015-09-02 00:30:28 +0800
commit2816be6a601f6088e705081372eab9f6a82036c4 (patch)
tree5a433a2644d90fc8aa03cac651453fed8f0bfa40
parent6104b95ace2fc987d5fb2802654c113cc76a469a (diff)
downloadfreebsd-ports-gnome-2816be6a601f6088e705081372eab9f6a82036c4.tar.gz
freebsd-ports-gnome-2816be6a601f6088e705081372eab9f6a82036c4.tar.zst
freebsd-ports-gnome-2816be6a601f6088e705081372eab9f6a82036c4.zip
New port: security/softether
SoftEther VPN ("SoftEther" means "Software Ethernet") is a powerful, multi-OS and easy-to-use multi-protocol VPN software. It supports SSL-VPN (HTTPS), as well as OpenVPN, IPsec, L2TP, MS-SSTP, L2TPv3 and EtherIP tunneling protocols and has a clone function to support OpenVPN clients. WWW: http://www.softether.org PR: 188437 Submitted by: net@arrishq.net Reviewed by: marino
-rw-r--r--security/Makefile1
-rw-r--r--security/softether/Makefile89
-rw-r--r--security/softether/distinfo2
-rw-r--r--security/softether/files/patch-src__Cedar__Cedar.h75
-rw-r--r--security/softether/files/patch-src__Cedar__Client.h20
-rw-r--r--security/softether/files/patch-src__Cedar__Nat.h11
-rw-r--r--security/softether/files/patch-src__Cedar__Server.c21
-rw-r--r--security/softether/files/patch-src__Mayaqua__Cfg.c11
-rw-r--r--security/softether/files/patch-src__Mayaqua__Cfg.h11
-rw-r--r--security/softether/files/patch-src__Mayaqua__Kernel.c11
-rw-r--r--security/softether/files/patch-src__Mayaqua__Table.h11
-rw-r--r--security/softether/files/patch-src__Mayaqua__Unix.c29
-rw-r--r--security/softether/files/softether_bridge.in36
-rw-r--r--security/softether/files/softether_client.in36
-rw-r--r--security/softether/files/softether_server.in36
-rw-r--r--security/softether/files/vpncmd.in6
-rw-r--r--security/softether/pkg-descr7
-rw-r--r--security/softether/pkg-message19
-rw-r--r--security/softether/pkg-plist7
19 files changed, 439 insertions, 0 deletions
diff --git a/security/Makefile b/security/Makefile
index 5e052b0f1f2f..5a5d7512b1d8 100644
--- a/security/Makefile
+++ b/security/Makefile
@@ -993,6 +993,7 @@
SUBDIR += snortreport
SUBDIR += snortsam
SUBDIR += snortsnarf
+ SUBDIR += softether
SUBDIR += softhsm
SUBDIR += softhsm2
SUBDIR += spass
diff --git a/security/softether/Makefile b/security/softether/Makefile
new file mode 100644
index 000000000000..5af109354fe0
--- /dev/null
+++ b/security/softether/Makefile
@@ -0,0 +1,89 @@
+# $FreeBSD$
+
+PORTNAME= softether
+PORTVERSION= 4.18.9570
+CATEGORIES= security
+MASTER_SITES= http://www.softether-download.com/files/softether/v4.18-9570-rtm-2015.07.26-tree/Source_Code/
+DISTNAME= ${PORTNAME}-src-v4.18-9570-rtm
+
+MAINTAINER= net@arrishq.net
+COMMENT= Softether VPN solution
+
+LICENSE= GPLv2
+
+CPPFLAGS+= -I${LOCALBASE}/include
+LDFLAGS+= -L${LOCALBASE}/lib
+
+PORTDOCS= AUTHORS.TXT ChangeLog LICENSE README THIRD_PARTY.TXT WARNING.TXT
+DOS2UNIX_FILES= AUTHORS.TXT ChangeLog LICENSE README THIRD_PARTY.TXT \
+ WARNING.TXT \
+ src/Cedar/Cedar.h \
+ src/Cedar/Cedar.h \
+ src/Cedar/Client.h \
+ src/Cedar/Nat.h \
+ src/Cedar/Server.c \
+ src/Mayaqua/Cfg.c \
+ src/Mayaqua/Cfg.h \
+ src/Mayaqua/Kernel.c \
+ src/Mayaqua/Table.h \
+ src/Mayaqua/Unix.c
+
+OPTIONS_DEFINE= DOCS
+
+ONLY_FOR_ARCHS= i386 amd64
+
+USE_OPENSSL= yes
+USES= dos2unix gmake iconv ncurses readline
+USE_RC_SUBR= softether_bridge softether_client softether_server
+SUB_FILES= vpncmd
+
+# a pity the source directory has such a naming scheme, but well
+WRKSRC= ${WRKDIR}/v4.18-9570
+
+ALL_TARGET= build
+
+.include <bsd.port.options.mk>
+
+# requires OpenSSL from ports
+.if ${OSVERSION} < 1000000
+WITH_OPENSSL_PORT= yes
+MAKE_JOBS_UNSAFE= yes
+.endif
+
+.if ${OSVERSION} >= 1000000
+BUILD_DEPENDS= libiconv>=1.14:${PORTSDIR}/converters/libiconv
+.endif
+
+# skip configure at all and copy the corresponding Makefile in place
+post-extract:
+.if ${ARCH} != "amd64"
+ @${CP} ${WRKSRC}/src/makefiles/freebsd_32bit.mak ${WRKSRC}/Makefile
+.else
+ @${CP} ${WRKSRC}/src/makefiles/freebsd_64bit.mak ${WRKSRC}/Makefile
+.endif
+
+# pull in user specific CFLAGS and LDFLAGS
+ @${REINPLACE_CMD} -e "s|OPTIONS_COMPILE_RELEASE=|OPTIONS_COMPILE_RELEASE=${CFLAGS} |g" ${WRKSRC}/Makefile
+ @${REINPLACE_CMD} -e "s|OPTIONS_LINK_RELEASE=|OPTIONS_LINK_RELEASE=${LDFLAGS} |g" ${WRKSRC}/Makefile
+
+# manually install to ${PREFIX}/libexec/softether, then the final install will copy scripts
+# into ${PREFIX}/sbin
+do-install:
+ ${MKDIR} ${STAGEDIR}/${PREFIX}/libexec/softether
+ ${INSTALL_SCRIPT} ${WRKSRC}/bin/vpnbridge/vpnbridge ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/vpnbridge
+ ${INSTALL_SCRIPT} ${WRKSRC}/bin/vpnclient/vpnclient ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/vpnclient
+ ${INSTALL_SCRIPT} ${WRKSRC}/bin/vpncmd/vpncmd ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/vpncmd
+ ${INSTALL_SCRIPT} ${WRKSRC}/bin/vpnserver/vpnserver ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/vpnserver
+ ${INSTALL_DATA} ${WRKSRC}/bin/vpnserver/hamcore.se2 ${STAGEDIR}/${PREFIX}/libexec/${PORTNAME}/hamcore.se2
+ ${INSTALL_SCRIPT} ${WRKDIR}/vpncmd ${STAGEDIR}/${PREFIX}/sbin/vpncmd
+
+post-install:
+.for i in vpnbridge vpnclient vpncmd vpnserver
+ @${STRIP_CMD} ${STAGEDIR}${PREFIX}/libexec/${PORTNAME}/${i}
+.endfor
+ @${MKDIR} ${STAGEDIR}${DOCSDIR}
+.for doc in ${PORTDOCS}
+ ${INSTALL_DATA} ${WRKSRC}/${doc} ${STAGEDIR}${DOCSDIR}
+.endfor
+
+.include <bsd.port.mk>
diff --git a/security/softether/distinfo b/security/softether/distinfo
new file mode 100644
index 000000000000..77ebd3c479c0
--- /dev/null
+++ b/security/softether/distinfo
@@ -0,0 +1,2 @@
+SHA256 (softether-src-v4.18-9570-rtm.tar.gz) = 585d61e524d3cad90806cbeb52ebe54b5144359e6c44676e8e7fb5683ffd4574
+SIZE (softether-src-v4.18-9570-rtm.tar.gz) = 35180998
diff --git a/security/softether/files/patch-src__Cedar__Cedar.h b/security/softether/files/patch-src__Cedar__Cedar.h
new file mode 100644
index 000000000000..5ba671c6d9de
--- /dev/null
+++ b/security/softether/files/patch-src__Cedar__Cedar.h
@@ -0,0 +1,75 @@
+--- src/Cedar/Cedar.h.orig 2014-06-08 06:19:15 UTC
++++ src/Cedar/Cedar.h
+@@ -477,22 +477,22 @@
+ #define LOG_ENGINE_BUFFER_CACHE_SIZE_MAX (10 * 1024 * 1024) // Write cache size
+
+ // Constant such as a file name
+-#define SERVER_LOG_DIR_NAME "@server_log"
++#define SERVER_LOG_DIR_NAME "/var/db/softether/server_log"
+ #define BRIDGE_LOG_DIR_NAME SERVER_LOG_DIR_NAME
+ #define SERVER_LOG_PERFIX "vpn"
+
+-#define HUB_SECURITY_LOG_DIR_NAME "@security_log"
+-#define HUB_SECURITY_LOG_FILE_NAME "@security_log/%s"
++#define HUB_SECURITY_LOG_DIR_NAME "/var/db/softether/security_log"
++#define HUB_SECURITY_LOG_FILE_NAME "/var/db/softether/security_log/%s"
+ #define HUB_SECURITY_LOG_PREFIX "sec"
+-#define HUB_PACKET_LOG_DIR_NAME "@packet_log"
+-#define HUB_PACKET_LOG_FILE_NAME "@packet_log/%s"
++#define HUB_PACKET_LOG_DIR_NAME "/var/db/softether/packet_log"
++#define HUB_PACKET_LOG_FILE_NAME "/var/db/softether/packet_log/%s"
+ #define HUB_PACKET_LOG_PREFIX "pkt"
+
+-#define NAT_LOG_DIR_NAME "@secure_nat_log"
+-#define NAT_LOG_FILE_NAME "@secure_nat_log/%s"
++#define NAT_LOG_DIR_NAME "/var/db/softether/secure_nat_log"
++#define NAT_LOG_FILE_NAME "/var/db/softether/secure_nat_log/%s"
+ #define NAT_LOG_PREFIX "snat"
+
+-#define CLIENT_LOG_DIR_NAME "@client_log"
++#define CLIENT_LOG_DIR_NAME "/var/db/softether/client_log"
+ #define CLIENT_LOG_PREFIX "client"
+
+ // Packet log settings
+@@ -527,8 +527,8 @@
+ #define DISK_FREE_CHECK_INTERVAL (5 * 60 * 1000)
+
+ // Simple log
+-#define TINY_LOG_DIRNAME "@tiny_log"
+-#define TINY_LOG_FILENAME "@tiny_log/%04u%02u%02u_%02u%02u%02u.log"
++#define TINY_LOG_DIRNAME "/var/db/softether/tiny_log"
++#define TINY_LOG_FILENAME "/var/db/softether/tiny_log/%04u%02u%02u_%02u%02u%02u.log"
+
+
+ //////////////////////////////////////////////////////////////////////
+@@ -541,7 +541,7 @@
+ //#define CE_SNAPSHOT_INTERVAL ((UINT64)(3000))
+ #define CE_SNAPSHOT_POLLING_INTERVAL (1 * 1000)
+ #define CE_SNAPSHOT_POLLING_INTERVAL_LICENSE (30 * 1000)
+-#define CE_SNAPSHOT_DIR_NAME "@carrier_log"
++#define CE_SNAPSHOT_DIR_NAME "/var/db/softether/carrier_log"
+ #define CE_SNAPSHOT_PREFIX "carrier"
+
+
+@@ -558,7 +558,7 @@
+ // Expiration date of random size cache
+ #define RAND_SIZE_CACHE_EXPIRE (24 * 60 * 60 * 1000)
+ // Management allowed IP address list file name
+-#define ADMINIP_TXT "@adminip.txt"
++#define ADMINIP_TXT "/var/db/softether/adminip.txt"
+
+ #define NON_SSL_MIN_COUNT 60
+ #define NON_SSL_ENTRY_EXPIRES (10 * 60 * 1000)
+@@ -609,9 +609,9 @@
+ //////////////////////////////////////////////////////////////////////
+
+ #define EL_ADMIN_PORT 22888
+-#define EL_CONFIG_FILENAME "@etherlogger.config"
+-#define EL_PACKET_LOG_DIR_NAME "@etherlogger_log"
+-#define EL_PACKET_LOG_FILE_NAME "@etherlogger_log/%s"
++#define EL_CONFIG_FILENAME "/var/db/softether/etherlogger.config"
++#define EL_PACKET_LOG_DIR_NAME "/var/db/softether/etherlogger_log"
++#define EL_PACKET_LOG_FILE_NAME "/var/db/softether/etherlogger_log/%s"
+ #define EL_PACKET_LOG_PREFIX "pkt"
+ #define EL_LICENSE_CHECK_SPAN (10 * 1000)
+
diff --git a/security/softether/files/patch-src__Cedar__Client.h b/security/softether/files/patch-src__Cedar__Client.h
new file mode 100644
index 000000000000..736ff29a577d
--- /dev/null
+++ b/security/softether/files/patch-src__Cedar__Client.h
@@ -0,0 +1,20 @@
+--- src/Cedar/Client.h.orig 2014-06-08 06:19:15 UTC
++++ src/Cedar/Client.h
+@@ -125,7 +125,7 @@
+
+
+ // Constants
+-#define CLIENT_CONFIG_FILE_NAME "@vpn_client.config"
++#define CLIENT_CONFIG_FILE_NAME "/var/db/softether/vpn_client.config"
+ #define CLIENT_DEFAULT_KEEPALIVE_HOST "keepalive.softether.org"
+ #define CLIENT_DEFAULT_KEEPALIVE_PORT 80
+ #define CLIENT_DEFAULT_KEEPALIVE_INTERVAL KEEP_INTERVAL_DEFAULT
+@@ -145,7 +145,7 @@
+ #define CLIENT_WIN32_EXE_FILENAME_X64 "vpnclient_x64.exe"
+ #define CLIENT_WIN32_EXE_FILENAME_IA64 "vpnclient_ia64.exe"
+
+-#define CLIENT_CUSTOM_INI_FILENAME "@custom.ini"
++#define CLIENT_CUSTOM_INI_FILENAME "/var/db/softether/custom.ini"
+
+ #define CLIENT_GLOBAL_PULSE_NAME "clientglobalpulse"
+
diff --git a/security/softether/files/patch-src__Cedar__Nat.h b/security/softether/files/patch-src__Cedar__Nat.h
new file mode 100644
index 000000000000..3945524ea8df
--- /dev/null
+++ b/security/softether/files/patch-src__Cedar__Nat.h
@@ -0,0 +1,11 @@
+--- src/Cedar/Nat.h.orig 2014-06-08 06:19:15 UTC
++++ src/Cedar/Nat.h
+@@ -115,7 +115,7 @@
+ #define NAT_H
+
+ // Constants
+-#define NAT_CONFIG_FILE_NAME "@vpn_router.config" // NAT configuration file
++#define NAT_CONFIG_FILE_NAME "/var/db/softether/vpn_router.config" // NAT configuration file
+ #define DEFAULT_NAT_ADMIN_PORT 2828 // Default port number for management
+ #define NAT_ADMIN_PORT_LISTEN_INTERVAL 1000 // Interval for trying to open a port for management
+ #define NAT_FILE_SAVE_INTERVAL (30 * 1000) // Interval to save
diff --git a/security/softether/files/patch-src__Cedar__Server.c b/security/softether/files/patch-src__Cedar__Server.c
new file mode 100644
index 000000000000..dbbea7cb32b5
--- /dev/null
+++ b/security/softether/files/patch-src__Cedar__Server.c
@@ -0,0 +1,21 @@
+--- src/Cedar/Server.c.orig 2014-06-08 06:19:15 UTC
++++ src/Cedar/Server.c
+@@ -115,12 +115,12 @@
+
+ static SERVER *server = NULL;
+ static LOCK *server_lock = NULL;
+-char *SERVER_CONFIG_FILE_NAME = "@vpn_server.config";
+-char *SERVER_CONFIG_FILE_NAME_IN_CLIENT = "@vpn_gate_svc.config";
+-char *SERVER_CONFIG_FILE_NAME_IN_CLIENT_RELAY = "@vpn_gate_relay.config";
+-char *BRIDGE_CONFIG_FILE_NAME = "@vpn_bridge.config";
+-char *SERVER_CONFIG_TEMPLATE_NAME = "@vpn_server_template.config";
+-char *BRIDGE_CONFIG_TEMPLATE_NAME = "@vpn_server_template.config";
++char *SERVER_CONFIG_FILE_NAME = "/var/db/softether/vpn_server.config";
++char *SERVER_CONFIG_FILE_NAME_IN_CLIENT = "/var/db/softether/vpn_gate_svc.config";
++char *SERVER_CONFIG_FILE_NAME_IN_CLIENT_RELAY = "/var/db/softether/vpn_gate_relay.config";
++char *BRIDGE_CONFIG_FILE_NAME = "/var/db/softether/vpn_bridge.config";
++char *SERVER_CONFIG_TEMPLATE_NAME = "/var/db/softether/vpn_server_template.config";
++char *BRIDGE_CONFIG_TEMPLATE_NAME = "/var/db/softether/vpn_server_template.config";
+
+ static bool server_reset_setting = false;
+
diff --git a/security/softether/files/patch-src__Mayaqua__Cfg.c b/security/softether/files/patch-src__Mayaqua__Cfg.c
new file mode 100644
index 000000000000..49b7fedb9395
--- /dev/null
+++ b/security/softether/files/patch-src__Mayaqua__Cfg.c
@@ -0,0 +1,11 @@
+--- src/Mayaqua/Cfg.c.orig 2014-06-08 06:19:14 UTC
++++ src/Mayaqua/Cfg.c
+@@ -124,7 +124,7 @@
+ }
+
+ // Determine the directory name
+- UniFormat(dirname, sizeof(dirname), L"@backup.%s", original[0] == L'@' ? original + 1 : original);
++ UniFormat(dirname, sizeof(dirname), L"/var/db/softether/backup.%s", original[0] == L'@' ? original + 1 : original);
+
+ // Determine the file name
+ LocalTime(&st);
diff --git a/security/softether/files/patch-src__Mayaqua__Cfg.h b/security/softether/files/patch-src__Mayaqua__Cfg.h
new file mode 100644
index 000000000000..71182d3fe40a
--- /dev/null
+++ b/security/softether/files/patch-src__Mayaqua__Cfg.h
@@ -0,0 +1,11 @@
+--- src/Mayaqua/Cfg.h.orig 2014-06-08 06:19:14 UTC
++++ src/Mayaqua/Cfg.h
+@@ -102,7 +102,7 @@
+ // Macro
+ //#define CHECK_CFG_NAME_EXISTS // Check duplication of the existing name
+
+-#define SAVE_BINARY_FILE_NAME_SWITCH L"@save_binary"
++#define SAVE_BINARY_FILE_NAME_SWITCH L"/var/db/softether/save_binary"
+
+ // Constants
+ #define TAG_DECLARE "declare"
diff --git a/security/softether/files/patch-src__Mayaqua__Kernel.c b/security/softether/files/patch-src__Mayaqua__Kernel.c
new file mode 100644
index 000000000000..da209445625d
--- /dev/null
+++ b/security/softether/files/patch-src__Mayaqua__Kernel.c
@@ -0,0 +1,11 @@
+--- src/Mayaqua/Kernel.c.orig 2014-06-08 06:19:14 UTC
++++ src/Mayaqua/Kernel.c
+@@ -2160,7 +2160,7 @@
+ msg = "Unknown Error";
+ }
+
+- f = fopen("abort_error_log.txt", "w");
++ f = fopen("/var/db/softether/abort_error_log.txt", "w");
+ if (f != NULL)
+ {
+ fwrite(msg, 1, strlen(msg), f);
diff --git a/security/softether/files/patch-src__Mayaqua__Table.h b/security/softether/files/patch-src__Mayaqua__Table.h
new file mode 100644
index 000000000000..2360bd802952
--- /dev/null
+++ b/security/softether/files/patch-src__Mayaqua__Table.h
@@ -0,0 +1,11 @@
+--- src/Mayaqua/Table.h.orig 2014-06-08 06:19:14 UTC
++++ src/Mayaqua/Table.h
+@@ -102,7 +102,7 @@
+ #define UNICODE_CACHE_FILE L".unicode_cache_%s.dat"
+
+ #define LANGLIST_FILENAME "|languages.txt"
+-#define LANG_CONFIG_FILENAME L"@lang.config"
++#define LANG_CONFIG_FILENAME L"/var/db/softether/lang.config"
+ #define LANG_CONFIG_TEMPLETE "|lang.config"
+
+ // Language constant
diff --git a/security/softether/files/patch-src__Mayaqua__Unix.c b/security/softether/files/patch-src__Mayaqua__Unix.c
new file mode 100644
index 000000000000..a9063b873234
--- /dev/null
+++ b/security/softether/files/patch-src__Mayaqua__Unix.c
@@ -0,0 +1,29 @@
+--- src/Mayaqua/Unix.c.orig 2014-06-08 06:19:14 UTC
++++ src/Mayaqua/Unix.c
+@@ -916,7 +916,7 @@
+ GetExeDir(dir, sizeof(dir));
+
+ // File name generation
+- Format(name, sizeof(name), "%s/.%s", dir, tmp);
++ Format(name, sizeof(name), "/var/db/softether/.%s", tmp);
+
+ fd = open(name, O_WRONLY);
+ if (fd == -1)
+@@ -2254,7 +2254,7 @@
+ Hash(hash, exe_name, StrLen(exe_name), false);
+ BinToStr(tmp1, sizeof(tmp1), hash, sizeof(hash));
+
+- Format(name, size, "%s/.pid_%s", dir, tmp1);
++ Format(name, size, "/var/db/softether/.pid_%s", tmp1);
+ }
+
+ // Delete the PID file
+@@ -2299,7 +2299,7 @@
+ Hash(hash, exe_name, StrLen(exe_name), false);
+ BinToStr(tmp1, sizeof(tmp1), hash, sizeof(hash));
+
+- Format(name, size, "%s/.ctl_%s", dir, tmp1);
++ Format(name, size, "/var/db/softether/.ctl_%s", tmp1);
+ }
+
+ // Write the CTL file
diff --git a/security/softether/files/softether_bridge.in b/security/softether/files/softether_bridge.in
new file mode 100644
index 000000000000..e8f40eff045b
--- /dev/null
+++ b/security/softether/files/softether_bridge.in
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# PROVIDE: softether_bridge
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable softether_bridge:
+# softether_bridge_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable
+#
+. /etc/rc.subr
+
+name=softether_bridge
+rcvar=softether_bridge_enable
+load_rc_config ${name}
+
+: ${softether_bridge_enable:=NO}
+
+command="%%PREFIX%%/libexec/softether/vpnbridge"
+
+datadir="/var/db/softether"
+
+start_precmd="${name}_precmd"
+start_cmd="${command} start"
+stop_cmd="${command} stop"
+
+softether_bridge_precmd()
+{
+ if [ ! -d "${datadir}" ]; then
+ mkdir -p ${datadir}
+ fi
+}
+
+run_rc_command "$1"
diff --git a/security/softether/files/softether_client.in b/security/softether/files/softether_client.in
new file mode 100644
index 000000000000..8ca7d517d0b5
--- /dev/null
+++ b/security/softether/files/softether_client.in
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# PROVIDE: softether_client
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable softether_client:
+# softether_client_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable
+#
+. /etc/rc.subr
+
+name=softether_client
+rcvar=softether_client_enable
+load_rc_config ${name}
+
+: ${softether_client_enable:=NO}
+
+command="%%PREFIX%%/libexec/softether/vpnclient"
+
+datadir="/var/db/softether"
+
+start_precmd="${name}_precmd"
+start_cmd="${command} start"
+stop_cmd="${command} stop"
+
+softether_client_precmd()
+{
+ if [ ! -d "${datadir}" ]; then
+ mkdir -p ${datadir}
+ fi
+}
+
+run_rc_command "$1"
diff --git a/security/softether/files/softether_server.in b/security/softether/files/softether_server.in
new file mode 100644
index 000000000000..be25c341a94b
--- /dev/null
+++ b/security/softether/files/softether_server.in
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+# PROVIDE: softether_server
+# REQUIRE: NETWORKING SERVERS
+# BEFORE: DAEMON
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf to enable softether_server:
+# softether_server_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable
+#
+. /etc/rc.subr
+
+name=softether_server
+rcvar=softether_server_enable
+load_rc_config ${name}
+
+: ${softether_server_enable:=NO}
+
+command="%%PREFIX%%/libexec/softether/vpnserver"
+
+datadir="/var/db/softether"
+
+start_precmd="${name}_precmd"
+start_cmd="${command} start"
+stop_cmd="${command} stop"
+
+softether_server_precmd()
+{
+ if [ ! -d "${datadir}" ]; then
+ mkdir -p ${datadir}
+ fi
+}
+
+run_rc_command "$1"
diff --git a/security/softether/files/vpncmd.in b/security/softether/files/vpncmd.in
new file mode 100644
index 000000000000..28216eaec721
--- /dev/null
+++ b/security/softether/files/vpncmd.in
@@ -0,0 +1,6 @@
+#!/bin/sh
+#
+# wrapper script for vpncmd, the configuration binary for
+# SoftEther vpn
+#
+%%PREFIX%%/libexec/softether/vpncmd ${1+"$@"}
diff --git a/security/softether/pkg-descr b/security/softether/pkg-descr
new file mode 100644
index 000000000000..ab3e81dee438
--- /dev/null
+++ b/security/softether/pkg-descr
@@ -0,0 +1,7 @@
+SoftEther VPN ("SoftEther" means "Software Ethernet") is a powerful,
+multi-OS and easy-to-use multi-protocol VPN software. It supports
+SSL-VPN (HTTPS), as well as OpenVPN, IPsec, L2TP, MS-SSTP, L2TPv3
+and EtherIP tunneling protocols and has a clone function to support
+OpenVPN clients.
+
+WWW: http://www.softether.org
diff --git a/security/softether/pkg-message b/security/softether/pkg-message
new file mode 100644
index 000000000000..476884de1f97
--- /dev/null
+++ b/security/softether/pkg-message
@@ -0,0 +1,19 @@
+**************************************************************************
+
+To run softether vpn server from startup, add
+softether_server_enable="YES" in your rc.conf.
+
+To run softether vpn bridge from startup, add
+softether_bridge_enable="YES" in your rc.conf.
+
+To run softether vpn client from startup, add
+softether_client_enable="YES" in your rc.conf.
+
+Initial and further configuration of all softether services can be
+done either by using a Windows client to connect to the running
+services or by vpncmd from command line.
+
+When removing SoftEther VPN without the desire to reinstall, please
+ensure to remove the directory /var/db/softether as well.
+
+**************************************************************************
diff --git a/security/softether/pkg-plist b/security/softether/pkg-plist
new file mode 100644
index 000000000000..df3b413f8bf1
--- /dev/null
+++ b/security/softether/pkg-plist
@@ -0,0 +1,7 @@
+libexec/softether/hamcore.se2
+libexec/softether/vpnbridge
+libexec/softether/vpnclient
+libexec/softether/vpncmd
+libexec/softether/vpnserver
+sbin/vpncmd
+@dir libexec/softether