app-editors/cursor-bin: add 0.42.4, drop 0.42.3
[gentoo-zh.git] / net-p2p / n2n / n2n-3.0.ebuild
blob8c5e27e0b9f6e334d4e97e1382855ea662387368
1 # Copyright 2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 DESCRIPTION="A Layer Two Peer-to-Peer VPN"
8 inherit systemd cmake
10 HOMEPAGE="http://www.ntop.org/n2n/"
11 SRC_URI="https://github.com/ntop/n2n/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
12 LICENSE="GPL-3"
13 SLOT="0"
14 KEYWORDS="amd64"
15 IUSE="
16 +openssl
17 caps
18 pcap
19 zstd
20 upnp
22 DEPEND="
23 acct-user/n2n
24 acct-group/n2n
25 openssl? ( dev-libs/openssl )
26 caps? ( sys-libs/libcap )
27 pcap? ( net-libs/libpcap )
28 zstd? ( app-arch/zstd )
29 upnp? ( net-libs/miniupnpc net-libs/libnatpmp )
31 RDEPEND="${DEPEND}"
33 src_configure() {
34 mycmakeargs=(
35 -DBUILD_SHARED_LIBS=OFF
36 -DN2N_OPTION_USE_OPENSSL="$(usex openssl ON OFF)"
37 -DN2N_OPTION_USE_OPENSSL="$(usex openssl ON OFF)"
38 -DN2N_OPTION_USE_CAPLIB="$(usex caps ON OFF)"
39 -DN2N_OPTION_USE_PCAPLIB="$(usex pcap ON OFF)"
40 -DN2N_OPTION_USE_ZSTD="$(usex zstd ON OFF)"
41 -DN2N_OPTION_USE_PORTMAPPING="$(usex upnp ON OFF)"
43 cmake_src_configure
46 src_install() {
47 cmake_src_install
48 rm -r "${D:?}/usr/share" || die
49 doman "${S}/edge.8"
50 doman "${S}/n2n.7"
51 doman "${S}/supernode.1"
52 keepdir /var/log/n2n
53 systemd_newunit "${S}/packages/etc/systemd/system/edge@.service.in" n2n-edge@.service
54 systemd_newunit "${S}/packages/etc/systemd/system/supernode.service.in" n2n-supernode.service
55 insinto /etc/n2n
56 newins "${S}/packages/etc/n2n/edge.conf.sample" edge-example.conf
57 doins "${S}/packages/etc/n2n/supernode.conf.sample"