summaryrefslogtreecommitdiff
path: root/net-vpn/badvpn
diff options
context:
space:
mode:
Diffstat (limited to 'net-vpn/badvpn')
-rw-r--r--net-vpn/badvpn/Manifest17
-rw-r--r--net-vpn/badvpn/badvpn-1.999.126.ebuild91
-rw-r--r--net-vpn/badvpn/badvpn-1.999.127.ebuild92
-rw-r--r--net-vpn/badvpn/badvpn-1.999.128.ebuild92
-rw-r--r--net-vpn/badvpn/badvpn-1.999.129.ebuild92
-rw-r--r--net-vpn/badvpn/badvpn-1.999.130.ebuild84
-rw-r--r--net-vpn/badvpn/files/badvpn-1.999.127-ncd.init24
-rw-r--r--net-vpn/badvpn/files/badvpn-ncd.conf11
-rw-r--r--net-vpn/badvpn/files/badvpn-ncd.init48
-rw-r--r--net-vpn/badvpn/files/badvpn-ncd.service11
-rw-r--r--net-vpn/badvpn/files/badvpn-server.conf11
-rw-r--r--net-vpn/badvpn/files/badvpn-server.init48
-rw-r--r--net-vpn/badvpn/metadata.xml40
13 files changed, 661 insertions, 0 deletions
diff --git a/net-vpn/badvpn/Manifest b/net-vpn/badvpn/Manifest
new file mode 100644
index 000000000000..4636ca82d04c
--- /dev/null
+++ b/net-vpn/badvpn/Manifest
@@ -0,0 +1,17 @@
+AUX badvpn-1.999.127-ncd.init 592 SHA256 765fb9d39bbe17925bcb83bcf5eb6082c88f14dc72a35dba80bd44d642dc25e1 SHA512 d82803b5042c0f450c20023be601860e751ef5d32d0174cb71c903e4d57ebab14e36cdbe7a268e322cd88e49824071659703f71e0e5fa92f0f70ce8c1412ef05 WHIRLPOOL a3cab59389fede3b4d50646e3075fc57b95fcf191e15b9a6f67b35775e9e4b5d31eed29b8a9ac97c2e7e08f0f746a55b1f2f38c3346e72e0be7b57786b61ed29
+AUX badvpn-ncd.conf 182 SHA256 52e17827c5455c65fed6e1609a2feb35491393be389798760d518b2bf4b0eec3 SHA512 4b113e3630de4b679d3c74cd4154d0353c6ea8791a77b302c867f5007e889502cf4e6bd1c45d6151e1ea6843bc13ac3e6458790eb4e646daf17d0126b996492f WHIRLPOOL 15b3bbfa207870dd4eda28781e387bd4de8981984ebf400e6742ba652ede7edc25e94f256d1d4e5dec615d727dc763d9680374dcc934fc4dc4b0c167f23ca3af
+AUX badvpn-ncd.init 1146 SHA256 8b77297644aa9d5816f37bbbd3c99b01b914ed26f28a63e2b82b6be5fb781a11 SHA512 5bed2372af376241f86037baba383ba7ac28aabe7b05d791345c69fbc23df453a4caca8d9680e3f16c9352c537b369dd04d73234aed4ee711af7d66d1a076ddd WHIRLPOOL d522dd1ed5bcb5df68d9b464e44a421368211ff3aef09cdc5de1edc5571f8467f74e4658f0da3256acf9cffe263fd1912a93d8da14895c0d5434267a3ffeb2fa
+AUX badvpn-ncd.service 266 SHA256 c80a55b0c7a38401521aca7a3eac4724e88cf5fc1857a27d4199c9b02b1c24d2 SHA512 5087d35a4d8c0d17202fe71d2bd2c881292720b550811d99d711623307e32515938464cb885be6c02a784cfc24311aef0b76576fbffeeadcad9b59c3a05e3fc9 WHIRLPOOL 6ff54db1d355047e1a253310a4af02705e326d09f884e5c782e24fba73d8cb1dc9081149c8a5ea50d598572b2e10cf859dd35c339c94051c2beb64b6ed4caeed
+AUX badvpn-server.conf 227 SHA256 888f63e217739f1684574064d5c6f3e88cf562dab17885b15e14905a70cd86f3 SHA512 c5628f1380434884d297846a1c49a31f369a17f97ab9914a741cfde9a21df52926b247c0b9544605c2438f47110c9f548b9161c5975be91e70dacfdf993839c8 WHIRLPOOL adf1d5584e84d5027dd566ee01e0792b7e23ace5b51a808ad3762d3141852f2373bf67c300d78c6f4fcd75add36742b5d84ef03c7d92b6a9c2a76812e51c458d
+AUX badvpn-server.init 1136 SHA256 3cc8d6e3d200c1d4b2043d18b0fdc28702987a8e635efcce368cdfe272ab9234 SHA512 12326aa9ee4966786bb49dcc8184bceefaa0c02bf4ed00ca6437d58b64178762b75ec137846401493ca8a8d0cee313339915df49e44870bc9745176ca9edffd5 WHIRLPOOL ae44f2294740b1a0ce061d25919e664d879ec937b2d7c33dc0418d87c8c1763e032834de28ec206bb410b7569217562d96e2dbd142686236092d01336e4ab982
+DIST badvpn-1.999.126.tar.bz2 936233 SHA256 188440a6d2fa575162f65baf4b8a2645d6fda71ef1a20794ec0be42a3053f2ff SHA512 3d0bbe3c8f91a3cb758b78a0fce4fd111f93fa0578ce06f0a8db5cc575d02f52248b37e7fa097447589257e47084a607a9df7078448ef44ae9fb66eb59e8b9e2 WHIRLPOOL 6767bc359c92d85d91f7b32d15c17bd0f33dcaa36716d8cc3b87eb59a110d7d26d91b38145e9f47cce3950f49470756ade29c6768b956f27108fff143248ac79
+DIST badvpn-1.999.127.tar.bz2 962224 SHA256 d20c79d69a7aa9eac1e0bf9a52fb9c9cdca78be123b6d17d59ff277f282e7943 SHA512 7484a817795392a52b44d3bf68765652739029aae8c16965b433bbfb4ca67ea70048f76376ba445196aac07a8f19f97696917ad24fe2bcb34025adda1f18a9fb WHIRLPOOL a3030691d50add2f76854b3a4c3cd1a66c3d3c53b0780c592e0a7337907c7d253a4ea552c57c26e03abc0adf5c4d2f416b18a3e74bc3a6af9b9182927cd721f5
+DIST badvpn-1.999.128.tar.bz2 1000636 SHA256 d6b28d5d566470dd1b0584b14b7ffab8159e4f604c1facbf9ef3a3ddbc0c9bfc SHA512 7d59e8365c10e7164c6c74b95d5f212ae0c480870bea31a6fb4ed25883f28bb6365e09a9271a9ecedccccd886e5f5e50a6f6df406ee3c40fad40031bbd3f049b WHIRLPOOL 5541a8d91a48f69fb5646451c276d0dd8844e508f9a33d553f08c5aabbe2c6d5bab8bd6073829641facec861d507cfce7c346497bc3f321033dd46c036f719d9
+DIST badvpn-1.999.129.tar.gz 1327123 SHA256 f4fd6fef72203acee10af7d7a6198f6f5fdfc00d9607f0924f6ebae84d570f1d SHA512 7a305198d7b4aaa31e567ff1f1bf23e0a65070d8eae78e7ed6be1a3a3b7bce7fcba32c0eb8ae549ef1851a61675afc1770f52dedf131658036b7b6414fdd4e4e WHIRLPOOL 821a4228ff1f3e2fbc5af7db07536ffeeed7c35ad6a9238948f3c9b350ddf556fbc69e036ce08ed2bc9c7c805b653ff1532c336b37b67acb40ccf41e7bacb6a2
+DIST badvpn-1.999.130.tar.gz 1340372 SHA256 bfd4bbfebd7274bcec792558c9a2fd60e39cd92e04673825ade5d04154766109 SHA512 958d6f3b7a8074fa7ba2f26812c9b2c39272b75d762a12a821ad2d0db9cdc9b9307338d77ca0dcadcf57b81fa4632362e67524de4246d01829951e8924a89770 WHIRLPOOL 77bf158eb4624301a7ecc3f17583faf3525d8ff165478535d6f9d33b42d4e50906ede42a8dea4454bb06b6845a20aa3127649ba0ceaf08e0e04fe9839de7184c
+EBUILD badvpn-1.999.126.ebuild 1950 SHA256 cd773f8b040bc907ee3496d589c642a8981dc3af904083f7a40c8b40b5c8f860 SHA512 df2c00a2d0e74bb54fa11b30744bf685caf3ec6b42d6639314a8c0b11862d18a38a15ee8f12692ccdd74c1c70f74a9c4fec25e00260af356487c3cd6119042d1 WHIRLPOOL d9c6dea57ff8d4782fc5e5339e5ec925a00ec8bc8911a1366821feafc87a10979d1093673158bfd99d3217728b149ebb7d536049742077c57339e0d67a4f6eda
+EBUILD badvpn-1.999.127.ebuild 2004 SHA256 886da7ce9dd19a63d561ab3cb7c2c3f2433351f93e32316c659e4910c3743dc2 SHA512 bd246dab767f82d2b3e9976782e0a76b72e5bac17e09392712156158952a5f31dba9a51518a738b448c94064e94dc4050a559c485143da70ba1a7173078dabf3 WHIRLPOOL 1a11e65c34b21f9a4b8a812f9dfaca3703faf1fb68f6cac116dd82aab06f4a181a87ed2524ba55c29458399d7a94a8760b4f935a8b79f7f8936c4d2fa18f6bdc
+EBUILD badvpn-1.999.128.ebuild 2018 SHA256 50a723f0d6ac115e74def6a337643a3d9139c13b5e725b99a9c178cef4f12e2c SHA512 961793858377216a5ac12cdd614765572332bf37fbbe1b7bef8a3f17d495d9e70bdc9271d4dee522fe212744a0fec08591426a71a3a13665c4879bac4daac8b3 WHIRLPOOL 6201512a4d51445ffc7ead41ae8c4365338b01e43c3ce30c687eda8c18753fead5ee7b25598b30ab4dcf15fd406c5ff0fa00db02d511b543f0e395e7d0bc527c
+EBUILD badvpn-1.999.129.ebuild 2070 SHA256 97bdb6e172e0f9eda1b8d5836aae09ae6205bf5af88c3c7e30e8ea9aadeab0e8 SHA512 95afb2657387e0598987965e58ede6a274d595bdc1748eb8e22c3d16e39af1206605e34420b7ea51a2ace928ce9a577d65293dec8512fd745b272c4b9b003359 WHIRLPOOL 815dc81c6e04fb57c8a7632495f611c7d39dd3e96269bfd8852c423eb7dc0676fdf616b1718bfab57f3dfc3eb73ca46bed5106c27934f0e6557d079272b73672
+EBUILD badvpn-1.999.130.ebuild 1976 SHA256 1f9d3c707539e1385946853b0c94364ddebc44a2da9f555d6ffe31fd0ab08af3 SHA512 ba1c2e0362eaa4aec4b9b4f2cf782d5a5bca50c821cd95c2b6e7077390459bb047f5d59f31b0fcfc752d4a15d5327dd2dc68d23c24f14e7a90c587f3571d6548 WHIRLPOOL 0a477aab4e3ae6328d281896d7d0a53e0c7c66f8a1b20280700b1940a788e4174e6d0b846f31ecd9056c5fdb887340a1534abadbb6b8c7ca01428d579fc718e8
+MISC metadata.xml 1849 SHA256 717870252cb6f900f827d8ccb2615bb249eb739ee069b3dbea744f665270189a SHA512 fcec8de10a74e9c1950b1dc3e70b949bd6d5a8cbbcad3295f1b7dd177882959f53842b52e613dba70cf1928e85b8caa97d5b19abdec68804fe7e24bad36e8a08 WHIRLPOOL 7849599b81efd51bc98ca5e9b04fd692a996216fe28e322aa183c92fac920e97876c6094afa404fd49fd94576d2bef13c633ad4848d7a922dc3c8177027b895e
diff --git a/net-vpn/badvpn/badvpn-1.999.126.ebuild b/net-vpn/badvpn/badvpn-1.999.126.ebuild
new file mode 100644
index 000000000000..56e19578c566
--- /dev/null
+++ b/net-vpn/badvpn/badvpn-1.999.126.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils cmake-utils user toolchain-funcs
+
+MY_P=${PN}-${PV/_rc/rc}
+DESCRIPTION="Peer-to-peer VPN, NCD scripting language, tun2socks proxifier"
+HOMEPAGE="https://code.google.com/p/badvpn/"
+SRC_URI="https://badvpn.googlecode.com/files/${MY_P}.tar.bz2"
+
+LICENSE="BSD"
+KEYWORDS="~amd64 ~arm ~x86"
+SLOT="0"
+TARGETS="+client +ncd +server +tun2socks +udpgw"
+IUSE="${TARGETS} debug"
+# tests are only ncd related
+RESTRICT="!ncd? ( test )"
+
+COMMON_DEPEND="
+ client? (
+ dev-libs/nspr
+ dev-libs/nss
+ dev-libs/openssl
+ )
+ server? (
+ dev-libs/nspr
+ dev-libs/nss
+ dev-libs/openssl
+ )
+ ncd? (
+ dev-libs/openssl
+ )"
+RDEPEND="${COMMON_DEPEND}
+ ncd? (
+ sys-apps/iproute2
+ >=virtual/udev-171
+ )"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig"
+# we need at least one target
+REQUIRED_USE="|| ( ${TARGETS//+/} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ enewuser ${PN}
+}
+
+src_prepare() {
+ # allow user to easily apply patches
+ epatch_user
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_NOTHING_BY_DEFAULT=1
+ $(cmake-utils_use_build client CLIENT)
+ $(cmake-utils_use_build server SERVER)
+ $(cmake-utils_use_build ncd NCD)
+ $(cmake-utils_use_build tun2socks TUN2SOCKS)
+ $(cmake-utils_use_build udpgw UDPGW)
+ )
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ # OOHMSA: do this on portage level?
+ tc-is-cross-compiler && die "these tests do not work when cross compiling!"
+
+ einfo "Running NCD tests"
+ cd "${S}"/ncd/tests || die
+ bash ./run_tests "${CMAKE_BUILD_DIR}/ncd/badvpn-ncd" \
+ || die "one or more tests failed"
+}
+
+src_install() {
+ cmake-utils_src_install
+ dodoc ChangeLog
+
+ if use server; then
+ newinitd "${FILESDIR}"/${PN}-server.init ${PN}-server
+ newconfd "${FILESDIR}"/${PN}-server.conf ${PN}-server
+ fi
+
+ if use ncd; then
+ newinitd "${FILESDIR}"/${PN}-ncd.init ${PN}-ncd
+ newconfd "${FILESDIR}"/${PN}-ncd.conf ${PN}-ncd
+ fi
+}
diff --git a/net-vpn/badvpn/badvpn-1.999.127.ebuild b/net-vpn/badvpn/badvpn-1.999.127.ebuild
new file mode 100644
index 000000000000..f8b68ce72105
--- /dev/null
+++ b/net-vpn/badvpn/badvpn-1.999.127.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils cmake-utils user toolchain-funcs systemd
+
+MY_P=${PN}-${PV/_rc/rc}
+DESCRIPTION="Peer-to-peer VPN, NCD scripting language, tun2socks proxifier"
+HOMEPAGE="https://code.google.com/p/badvpn/"
+SRC_URI="https://badvpn.googlecode.com/files/${MY_P}.tar.bz2"
+
+LICENSE="BSD"
+KEYWORDS="amd64 arm x86"
+SLOT="0"
+TARGETS="+client +ncd +server +tun2socks +udpgw"
+IUSE="${TARGETS} debug"
+# tests are only ncd related
+RESTRICT="!ncd? ( test )"
+
+COMMON_DEPEND="
+ client? (
+ dev-libs/nspr
+ dev-libs/nss
+ dev-libs/openssl
+ )
+ server? (
+ dev-libs/nspr
+ dev-libs/nss
+ dev-libs/openssl
+ )
+ ncd? (
+ dev-libs/openssl
+ )"
+RDEPEND="${COMMON_DEPEND}
+ ncd? (
+ sys-apps/iproute2
+ >=virtual/udev-171
+ )"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig"
+# we need at least one target
+REQUIRED_USE="|| ( ${TARGETS//+/} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ enewuser ${PN}
+}
+
+src_prepare() {
+ # allow user to easily apply patches
+ epatch_user
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_NOTHING_BY_DEFAULT=1
+ $(cmake-utils_use_build client CLIENT)
+ $(cmake-utils_use_build server SERVER)
+ $(cmake-utils_use_build ncd NCD)
+ $(cmake-utils_use_build tun2socks TUN2SOCKS)
+ $(cmake-utils_use_build udpgw UDPGW)
+ )
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ # OOHMSA: do this on portage level?
+ tc-is-cross-compiler && die "these tests do not work when cross compiling!"
+
+ einfo "Running NCD tests"
+ cd "${S}"/ncd/tests || die
+ bash ./run_tests "${CMAKE_BUILD_DIR}/ncd/badvpn-ncd" \
+ || die "one or more tests failed"
+}
+
+src_install() {
+ cmake-utils_src_install
+ dodoc ChangeLog
+
+ if use server; then
+ newinitd "${FILESDIR}"/${PN}-server.init ${PN}-server
+ newconfd "${FILESDIR}"/${PN}-server.conf ${PN}-server
+ fi
+
+ if use ncd; then
+ newinitd "${FILESDIR}"/${P}-ncd.init ${PN}-ncd
+ newconfd "${FILESDIR}"/${PN}-ncd.conf ${PN}-ncd
+ systemd_dounit "${FILESDIR}"/badvpn-ncd.service
+ fi
+}
diff --git a/net-vpn/badvpn/badvpn-1.999.128.ebuild b/net-vpn/badvpn/badvpn-1.999.128.ebuild
new file mode 100644
index 000000000000..879722ef31ba
--- /dev/null
+++ b/net-vpn/badvpn/badvpn-1.999.128.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils cmake-utils user toolchain-funcs systemd
+
+MY_P=${PN}-${PV/_rc/rc}
+DESCRIPTION="Peer-to-peer VPN, NCD scripting language, tun2socks proxifier"
+HOMEPAGE="https://code.google.com/p/badvpn/"
+SRC_URI="https://badvpn.googlecode.com/files/${MY_P}.tar.bz2"
+
+LICENSE="BSD"
+KEYWORDS="~amd64 ~arm ~x86"
+SLOT="0"
+TARGETS="+client +ncd +server +tun2socks +udpgw"
+IUSE="${TARGETS} debug"
+# tests are only ncd related
+RESTRICT="!ncd? ( test )"
+
+COMMON_DEPEND="
+ client? (
+ dev-libs/nspr
+ dev-libs/nss
+ dev-libs/openssl
+ )
+ server? (
+ dev-libs/nspr
+ dev-libs/nss
+ dev-libs/openssl
+ )
+ ncd? (
+ dev-libs/openssl
+ )"
+RDEPEND="${COMMON_DEPEND}
+ ncd? (
+ sys-apps/iproute2
+ >=virtual/udev-171
+ )"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig"
+# we need at least one target
+REQUIRED_USE="|| ( ${TARGETS//+/} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ enewuser ${PN}
+}
+
+src_prepare() {
+ # allow user to easily apply patches
+ epatch_user
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_NOTHING_BY_DEFAULT=1
+ $(cmake-utils_use_build client CLIENT)
+ $(cmake-utils_use_build server SERVER)
+ $(cmake-utils_use_build ncd NCD)
+ $(cmake-utils_use_build tun2socks TUN2SOCKS)
+ $(cmake-utils_use_build udpgw UDPGW)
+ )
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ # OOHMSA: do this on portage level?
+ tc-is-cross-compiler && die "these tests do not work when cross compiling!"
+
+ einfo "Running NCD tests"
+ cd "${S}"/ncd/tests || die
+ bash ./run_tests "${CMAKE_BUILD_DIR}/ncd/badvpn-ncd" \
+ || die "one or more tests failed"
+}
+
+src_install() {
+ cmake-utils_src_install
+ dodoc ChangeLog
+
+ if use server; then
+ newinitd "${FILESDIR}"/${PN}-server.init ${PN}-server
+ newconfd "${FILESDIR}"/${PN}-server.conf ${PN}-server
+ fi
+
+ if use ncd; then
+ newinitd "${FILESDIR}"/${PN}-1.999.127-ncd.init ${PN}-ncd
+ newconfd "${FILESDIR}"/${PN}-ncd.conf ${PN}-ncd
+ systemd_dounit "${FILESDIR}"/badvpn-ncd.service
+ fi
+}
diff --git a/net-vpn/badvpn/badvpn-1.999.129.ebuild b/net-vpn/badvpn/badvpn-1.999.129.ebuild
new file mode 100644
index 000000000000..6183228f2ab0
--- /dev/null
+++ b/net-vpn/badvpn/badvpn-1.999.129.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils cmake-utils user toolchain-funcs systemd
+
+MY_P=${PN}-${PV/_rc/rc}
+DESCRIPTION="Peer-to-peer VPN, NCD scripting language, tun2socks proxifier"
+HOMEPAGE="https://github.com/ambrop72/badvpn https://code.google.com/p/badvpn/"
+SRC_URI="https://github.com/ambrop72/badvpn/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="amd64 ~arm x86"
+SLOT="0"
+TARGETS="+client +ncd +server +tun2socks +udpgw"
+IUSE="${TARGETS} debug"
+# tests are only ncd related
+RESTRICT="!ncd? ( test )"
+
+COMMON_DEPEND="
+ client? (
+ dev-libs/nspr
+ dev-libs/nss
+ dev-libs/openssl
+ )
+ server? (
+ dev-libs/nspr
+ dev-libs/nss
+ dev-libs/openssl
+ )
+ ncd? (
+ dev-libs/openssl
+ )"
+RDEPEND="${COMMON_DEPEND}
+ ncd? (
+ sys-apps/iproute2
+ >=virtual/udev-171
+ )"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig"
+# we need at least one target
+REQUIRED_USE="|| ( ${TARGETS//+/} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ enewuser ${PN}
+}
+
+src_prepare() {
+ # allow user to easily apply patches
+ epatch_user
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_NOTHING_BY_DEFAULT=1
+ $(cmake-utils_use_build client CLIENT)
+ $(cmake-utils_use_build server SERVER)
+ $(cmake-utils_use_build ncd NCD)
+ $(cmake-utils_use_build tun2socks TUN2SOCKS)
+ $(cmake-utils_use_build udpgw UDPGW)
+ )
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ # OOHMSA: do this on portage level?
+ tc-is-cross-compiler && die "these tests do not work when cross compiling!"
+
+ einfo "Running NCD tests"
+ cd "${S}"/ncd/tests || die
+ bash ./run_tests "${CMAKE_BUILD_DIR}/ncd/badvpn-ncd" \
+ || die "one or more tests failed"
+}
+
+src_install() {
+ cmake-utils_src_install
+ dodoc ChangeLog
+
+ if use server; then
+ newinitd "${FILESDIR}"/${PN}-server.init ${PN}-server
+ newconfd "${FILESDIR}"/${PN}-server.conf ${PN}-server
+ fi
+
+ if use ncd; then
+ newinitd "${FILESDIR}"/${PN}-1.999.127-ncd.init ${PN}-ncd
+ newconfd "${FILESDIR}"/${PN}-ncd.conf ${PN}-ncd
+ systemd_dounit "${FILESDIR}"/badvpn-ncd.service
+ fi
+}
diff --git a/net-vpn/badvpn/badvpn-1.999.130.ebuild b/net-vpn/badvpn/badvpn-1.999.130.ebuild
new file mode 100644
index 000000000000..8fc6bb47aa1e
--- /dev/null
+++ b/net-vpn/badvpn/badvpn-1.999.130.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils cmake-utils user toolchain-funcs systemd
+
+MY_P=${PN}-${PV/_rc/rc}
+DESCRIPTION="Peer-to-peer VPN, NCD scripting language, tun2socks proxifier"
+HOMEPAGE="https://github.com/ambrop72/badvpn https://code.google.com/p/badvpn/"
+SRC_URI="https://github.com/ambrop72/badvpn/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+KEYWORDS="~amd64 ~arm ~x86"
+SLOT="0"
+TARGETS="+client +ncd +server +tun2socks +udpgw"
+IUSE="${TARGETS} debug"
+# tests are only ncd related
+RESTRICT="!ncd? ( test )"
+
+COMMON_DEPEND="
+ client? (
+ dev-libs/nspr
+ dev-libs/nss
+ dev-libs/openssl:0
+ )
+ server? (
+ dev-libs/nspr
+ dev-libs/nss
+ dev-libs/openssl:0
+ )"
+RDEPEND="${COMMON_DEPEND}
+ ncd? (
+ sys-apps/iproute2
+ >=virtual/udev-171
+ )"
+DEPEND="${COMMON_DEPEND}
+ virtual/pkgconfig"
+# we need at least one target
+REQUIRED_USE="|| ( ${TARGETS//+/} )"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ enewuser ${PN}
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_NOTHING_BY_DEFAULT=1
+ $(cmake-utils_use_build client CLIENT)
+ $(cmake-utils_use_build server SERVER)
+ $(cmake-utils_use_build ncd NCD)
+ $(cmake-utils_use_build tun2socks TUN2SOCKS)
+ $(cmake-utils_use_build udpgw UDPGW)
+ )
+
+ cmake-utils_src_configure
+}
+
+src_test() {
+ # OOHMSA: do this on portage level?
+ tc-is-cross-compiler && die "these tests do not work when cross compiling!"
+
+ einfo "Running NCD tests"
+ cd "${S}"/ncd/tests || die
+ bash ./run_tests "${CMAKE_BUILD_DIR}/ncd/badvpn-ncd" \
+ || die "one or more tests failed"
+}
+
+src_install() {
+ cmake-utils_src_install
+ dodoc ChangeLog
+
+ if use server; then
+ newinitd "${FILESDIR}"/${PN}-server.init ${PN}-server
+ newconfd "${FILESDIR}"/${PN}-server.conf ${PN}-server
+ fi
+
+ if use ncd; then
+ newinitd "${FILESDIR}"/${PN}-1.999.127-ncd.init ${PN}-ncd
+ newconfd "${FILESDIR}"/${PN}-ncd.conf ${PN}-ncd
+ systemd_dounit "${FILESDIR}"/badvpn-ncd.service
+ fi
+}
diff --git a/net-vpn/badvpn/files/badvpn-1.999.127-ncd.init b/net-vpn/badvpn/files/badvpn-1.999.127-ncd.init
new file mode 100644
index 000000000000..69f7ba45992a
--- /dev/null
+++ b/net-vpn/badvpn/files/badvpn-1.999.127-ncd.init
@@ -0,0 +1,24 @@
+#!/sbin/openrc-run
+# Copyright 1999-2013 Gentoo Foundation
+# Released under the 3-clause BSD license.
+
+command="${ncd_exec:-"/usr/bin/badvpn-ncd"}"
+command_args="${ncd_args} --config-file ${ncd_config:-/etc/ncd.conf}"
+command_background="YES"
+description="Network Configuration Daemon"
+pidfile="/var/run/${RC_SVCNAME}.pid"
+
+depend() {
+ need localmount
+ after bootmisc
+ before netmount
+}
+
+start_pre() {
+ if yesno "${ncd_syslog:-NO}"; then
+ command_args="${command_args}
+ --logger syslog
+ --syslog-ident \"${ncd_syslog_ident:-${RC_SVCNAME}}\"
+ --channel-loglevel ncd_log_msg info"
+ fi
+}
diff --git a/net-vpn/badvpn/files/badvpn-ncd.conf b/net-vpn/badvpn/files/badvpn-ncd.conf
new file mode 100644
index 000000000000..ad34c66f7ca3
--- /dev/null
+++ b/net-vpn/badvpn/files/badvpn-ncd.conf
@@ -0,0 +1,11 @@
+# NCD program file.
+#ncd_config="/etc/ncd.conf"
+
+# enable or disable syslog.
+#ncd_syslog="NO"
+
+# Syslog identification.
+#ncd_syslog_ident="ncd"
+
+# Additional arguments.
+#ncd_args=""
diff --git a/net-vpn/badvpn/files/badvpn-ncd.init b/net-vpn/badvpn/files/badvpn-ncd.init
new file mode 100644
index 000000000000..e408075128a4
--- /dev/null
+++ b/net-vpn/badvpn/files/badvpn-ncd.init
@@ -0,0 +1,48 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Released under the 3-clause BSD license.
+
+command="${ncd_exec:-"/usr/bin/badvpn-ncd"}"
+command_args="${ncd_args} --config-file ${ncd_config:-/etc/ncd.conf}"
+command_background="YES"
+description="Network Configuration Daemon"
+pidfile="/var/run/${RC_SVCNAME}.pid"
+
+depend() {
+ need localmount
+ after bootmisc
+ before netmount
+ if yesno "${ncd_syslog:-NO}"; then
+ use logger
+ fi
+}
+
+start_pre() {
+ if yesno "${ncd_syslog:-NO}"; then
+ command_args="${command_args}
+ --logger syslog
+ --syslog-ident \"${ncd_syslog_ident:-${RC_SVCNAME}}\""
+ fi
+}
+
+start()
+{
+ [ -n "$command" ] || return 0
+ local _background=
+ ebegin "Starting ${name:-$RC_SVCNAME}"
+ if yesno "${command_background}"; then
+ if [ -z "${pidfile}" ]; then
+ eend 1 "command_background option used but no pidfile specified"
+ return 1
+ fi
+ _background="--background --make-pidfile"
+ fi
+ eval start-stop-daemon --start \
+ --exec $command \
+ ${procname:+--name} $procname \
+ ${pidfile:+--pidfile} $pidfile \
+ $_background $start_stop_daemon_args \
+ -- $command_args
+ eend $? "Failed to start $RC_SVCNAME"
+ return $?
+}
diff --git a/net-vpn/badvpn/files/badvpn-ncd.service b/net-vpn/badvpn/files/badvpn-ncd.service
new file mode 100644
index 000000000000..6ca7aa515e00
--- /dev/null
+++ b/net-vpn/badvpn/files/badvpn-ncd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Network Configuation Daemon
+After=syslog.target
+
+[Service]
+ExecStart=/usr/bin/badvpn-ncd --logger syslog --syslog-ident ncd --loglevel warning --channel-loglevel ncd_log_msg info /etc/ncd.conf
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/net-vpn/badvpn/files/badvpn-server.conf b/net-vpn/badvpn/files/badvpn-server.conf
new file mode 100644
index 000000000000..ed5103d3d0ef
--- /dev/null
+++ b/net-vpn/badvpn/files/badvpn-server.conf
@@ -0,0 +1,11 @@
+# User account to run server as.
+#vpn_user="badvpn"
+
+# Enable or disable syslog.
+#vpn_syslog="NO"
+
+# Syslog identification.
+#vpn_syslog_ident="badvpn-server"
+
+# Arguments to badvpn-server.
+vpn_args="--listen-addr 0.0.0.0:7179"
diff --git a/net-vpn/badvpn/files/badvpn-server.init b/net-vpn/badvpn/files/badvpn-server.init
new file mode 100644
index 000000000000..32ee7fefe33e
--- /dev/null
+++ b/net-vpn/badvpn/files/badvpn-server.init
@@ -0,0 +1,48 @@
+#!/sbin/openrc-run
+# Copyright 1999-2012 Gentoo Foundation
+# Released under the 3-clause BSD license.
+
+command="${vpn_exec:-/usr/bin/badvpn-server}"
+command_args="${vpn_args}"
+command_background="YES"
+description="BadVPN server"
+pidfile="/var/run/${RC_SVCNAME}.pid"
+start_stop_daemon_args="--user \"${vpn_user:-badvpn}\""
+
+depend() {
+ need localmount
+ after bootmisc
+ if yesno "${vpn_syslog:-NO}"; then
+ use logger
+ fi
+}
+
+start_pre() {
+ if yesno "${vpn_syslog:-NO}"; then
+ command_args="${command_args}
+ --logger syslog
+ --syslog-ident \"${vpn_syslog_ident:-${RC_SVCNAME}}\""
+ fi
+}
+
+start()
+{
+ [ -n "$command" ] || return 0
+ local _background=
+ ebegin "Starting ${name:-$RC_SVCNAME}"
+ if yesno "${command_background}"; then
+ if [ -z "${pidfile}" ]; then
+ eend 1 "command_background option used but no pidfile specified"
+ return 1
+ fi
+ _background="--background --make-pidfile"
+ fi
+ eval start-stop-daemon --start \
+ --exec $command \
+ ${procname:+--name} $procname \
+ ${pidfile:+--pidfile} $pidfile \
+ $_background $start_stop_daemon_args \
+ -- $command_args
+ eend $? "Failed to start $RC_SVCNAME"
+ return $?
+}
diff --git a/net-vpn/badvpn/metadata.xml b/net-vpn/badvpn/metadata.xml
new file mode 100644
index 000000000000..e2a7803599c3
--- /dev/null
+++ b/net-vpn/badvpn/metadata.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>williamh@gentoo.org</email>
+ <description>backup Maintainer, CC him on bugs</description>
+ </maintainer>
+ <upstream>
+ <maintainer status="active">
+ <email>ambrop7@gmail.com</email>
+ <name>Ambroz Bizjak</name>
+ </maintainer>
+ <doc lang="en">https://code.google.com/p/badvpn/w/list</doc>
+ <bugs-to>https://github.com/ambrop72/badvpn/issues</bugs-to>
+ <remote-id type="github">ambrop72/badvpn</remote-id>
+ <remote-id type="google-code">badvpn</remote-id>
+ </upstream>
+ <use>
+ <flag name="client">Build the badvpn-client program, a daemon that
+ runs on endpoints of the VPN.</flag>
+ <flag name="server">Build the badvpn-server program, a central
+ server that manages the VPN network.</flag>
+ <flag name="ncd">Build NCD, a lightweight scripting language
+ especially suited for network configurations.</flag>
+ <flag name="tun2socks">Build tun2socks, a program which implements
+ a TUN device that forwards TCP traffic through a SOCKS5
+ server.</flag>
+ <flag name="udpgw">Build udpgw, a small daemon which allows tun2socks to forward UDP traffic.</flag> </use>
+ <longdescription lang="en">
+ BadVPN is an open-source peer-to-peer VPN system. It provides a
+ Layer 2 (Ethernet) network between the peers (VPN nodes). The peers
+ connect to a central server which acts as a chat server for them to
+ establish direct connections between each other (data connections).
+ These connections are used for transferring network data (Ethernet
+ frames), and can be secured with a multitude of mechanisms.
+
+ The BadVPN package also includes other network-related software,
+ like tun2socks and NCD.
+ </longdescription>
+</pkgmetadata>