aboutsummaryrefslogtreecommitdiffstats
path: root/devel
diff options
context:
space:
mode:
authorjbeich <jbeich@FreeBSD.org>2016-11-02 01:46:52 +0800
committerjbeich <jbeich@FreeBSD.org>2016-11-02 01:46:52 +0800
commit915157f1b376a0cf68d9722cc2b375348b69cc55 (patch)
treec6ae5218b682877ce361842a3ee89b6ffbb86b95 /devel
parent1560d21d1ce3c46d90b0ef0c910c5fc091994af1 (diff)
downloadfreebsd-ports-gnome-915157f1b376a0cf68d9722cc2b375348b69cc55.tar.gz
freebsd-ports-gnome-915157f1b376a0cf68d9722cc2b375348b69cc55.tar.zst
freebsd-ports-gnome-915157f1b376a0cf68d9722cc2b375348b69cc55.zip
devel/libtuntap: add new port
PR: 213956 Submitted by: Mahdi Mokhtari <mokhi64@gmail.com> libtuntap is a library for configuring TUN or TAP devices in a portable manner. TUN and TAP are virtual networking devices which allow userland applications to receive packets sent to it. The userland applications can also send their own packets to the devices and they will be forwarded to the kernel. https://github.com/LaKabane/libtuntap
Diffstat (limited to 'devel')
-rw-r--r--devel/Makefile1
-rw-r--r--devel/libtuntap/Makefile32
-rw-r--r--devel/libtuntap/distinfo3
-rw-r--r--devel/libtuntap/files/patch-CMakeLists.txt14
-rw-r--r--devel/libtuntap/files/patch-bindings_cpp_tuntap++.cc20
-rw-r--r--devel/libtuntap/pkg-descr9
-rw-r--r--devel/libtuntap/pkg-plist8
7 files changed, 87 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index 7b8e9c9fffe7..e6bfc414cbdd 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -1404,6 +1404,7 @@
SUBDIR += libtifiles2
SUBDIR += libtool
SUBDIR += libtpl
+ SUBDIR += libtuntap
SUBDIR += libublio
SUBDIR += libukcprog
SUBDIR += libunicode
diff --git a/devel/libtuntap/Makefile b/devel/libtuntap/Makefile
new file mode 100644
index 000000000000..e2f2276bb3ba
--- /dev/null
+++ b/devel/libtuntap/Makefile
@@ -0,0 +1,32 @@
+# Created by: Mahdi Mokhtari <mokhi64@gmail.com>
+# $FreeBSD$
+
+PORTNAME= libtuntap
+DISTVERSION= 0.3-23
+DISTVERSIONSUFFIX= -ga8bcade
+CATEGORIES= devel net
+
+MAINTAINER= mokhi64@gmail.com
+COMMENT= Configuring TUN or TAP devices API in a portable manner
+
+LICENSE= MIT
+
+USES= cmake
+USE_LDCONFIG= yes
+
+USE_GITHUB= yes
+GH_ACCOUNT= LaKabane
+
+OPTIONS_DEFINE= CXX_WRPR TEST
+OPTIONS_SUB= yes
+
+CXX_WRPR_DESC= Build C++ wrapper library
+TEST_DESC= Build regression tests
+
+CXX_WRPR_USES= compiler:c++11-lang
+CXX_WRPR_CMAKE_BOOL= ENABLE_CXX
+CXX_WRPR_VARS= USE_CXXSTD=c++11
+TEST_CMAKE_BOOL= ENABLE_REGRESS
+TEST_TEST_TARGET= test
+
+.include <bsd.port.mk>
diff --git a/devel/libtuntap/distinfo b/devel/libtuntap/distinfo
new file mode 100644
index 000000000000..dd4fbc154c22
--- /dev/null
+++ b/devel/libtuntap/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1477977157
+SHA256 (LaKabane-libtuntap-0.3-23-ga8bcade_GH0.tar.gz) = 3f2db000fa77a91ef056d996c763f7e1fc18c3529847308025629ea047d56a1d
+SIZE (LaKabane-libtuntap-0.3-23-ga8bcade_GH0.tar.gz) = 22262
diff --git a/devel/libtuntap/files/patch-CMakeLists.txt b/devel/libtuntap/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..bdbacee90046
--- /dev/null
+++ b/devel/libtuntap/files/patch-CMakeLists.txt
@@ -0,0 +1,14 @@
+--- CMakeLists.txt.orig 2016-10-29 14:49:34 UTC
++++ CMakeLists.txt
+@@ -124,6 +124,11 @@ if(UNIX)
+ install(TARGETS tuntap DESTINATION lib)
+ install(TARGETS tuntap-static DESTINATION lib)
+ install(FILES tuntap.h DESTINATION include)
++ if(ENABLE_CXX)
++ install(TARGETS tuntap++ DESTINATION lib)
++ install(TARGETS tuntap++-static DESTINATION lib)
++ install(FILES bindings/cpp/tuntap++.hh DESTINATION include)
++ endif(ENABLE_CXX)
+ endif(UNIX)
+
+ include(CMakeLists.txt.local OPTIONAL)
diff --git a/devel/libtuntap/files/patch-bindings_cpp_tuntap++.cc b/devel/libtuntap/files/patch-bindings_cpp_tuntap++.cc
new file mode 100644
index 000000000000..faa62d93986b
--- /dev/null
+++ b/devel/libtuntap/files/patch-bindings_cpp_tuntap++.cc
@@ -0,0 +1,20 @@
+--- bindings/cpp/tuntap++.cc.orig 2016-10-29 14:49:34 UTC
++++ bindings/cpp/tuntap++.cc
+@@ -7,7 +7,7 @@
+ namespace tuntap {
+
+ tun::tun()
+- : _dev{tuntap_init()}
++ : _dev(tuntap_init())
+ {
+ tuntap_start(_dev, TUNTAP_MODE_TUNNEL, TUNTAP_ID_ANY);
+ }
+@@ -84,7 +84,7 @@ tun::nonblocking(bool b)
+ }
+
+ tap::tap()
+- : _dev{tuntap_init()}
++ : _dev(tuntap_init())
+ {
+ tuntap_start(_dev, TUNTAP_MODE_ETHERNET, TUNTAP_ID_ANY);
+ }
diff --git a/devel/libtuntap/pkg-descr b/devel/libtuntap/pkg-descr
new file mode 100644
index 000000000000..5c697cc8f61e
--- /dev/null
+++ b/devel/libtuntap/pkg-descr
@@ -0,0 +1,9 @@
+libtuntap is a library for configuring TUN or TAP devices in a portable manner.
+
+TUN and TAP are virtual networking devices which allow
+userland applications to receive packets sent to it.
+
+The userland applications can also send their own packets to the devices
+and they will be forwarded to the kernel.
+
+WWW: https://github.com/LaKabane/libtuntap
diff --git a/devel/libtuntap/pkg-plist b/devel/libtuntap/pkg-plist
new file mode 100644
index 000000000000..1618c1ae8b9e
--- /dev/null
+++ b/devel/libtuntap/pkg-plist
@@ -0,0 +1,8 @@
+include/tuntap.h
+%%CXX_WRPR%%include/tuntap++.hh
+lib/libtuntap.a
+lib/libtuntap.so
+lib/libtuntap.so.2.1
+%%CXX_WRPR%%lib/libtuntap++.a
+%%CXX_WRPR%%lib/libtuntap++.so
+%%CXX_WRPR%%lib/libtuntap++.so.2.1