x11-terms/ghostty: add missing depend dev-libs/oniguruma
[gentoo-zh.git] / net-p2p / n2n / n2n-9999.ebuild
blobbc59e1acd050c7bf96c2e711e1ab89cd11994a07
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 git-r3
10 HOMEPAGE="http://www.ntop.org/n2n/"
11 LICENSE="GPL-3"
12 SLOT="0"
13 IUSE="
14 +openssl
15 caps
16 pcap
17 zstd
18 upnp
21 EGIT_REPO_URI="https://github.com/ntop/n2n.git"
23 DEPEND="
24 acct-user/n2n
25 acct-group/n2n
26 openssl? ( dev-libs/openssl )
27 caps? ( sys-libs/libcap )
28 pcap? ( net-libs/libpcap )
29 zstd? ( app-arch/zstd )
30 upnp? ( net-libs/miniupnpc net-libs/libnatpmp )
32 RDEPEND="${DEPEND}"
34 src_configure() {
35 mycmakeargs=(
36 -DBUILD_SHARED_LIBS=OFF
37 -DN2N_OPTION_USE_OPENSSL="$(usex openssl ON OFF)"
38 -DN2N_OPTION_USE_OPENSSL="$(usex openssl ON OFF)"
39 -DN2N_OPTION_USE_CAPLIB="$(usex caps ON OFF)"
40 -DN2N_OPTION_USE_PCAPLIB="$(usex pcap ON OFF)"
41 -DN2N_OPTION_USE_ZSTD="$(usex zstd ON OFF)"
42 -DN2N_OPTION_USE_PORTMAPPING="$(usex upnp ON OFF)"
44 cmake_src_configure
47 src_install() {
48 cmake_src_install
49 rm -r "${D:?}/usr/share" || die
50 doman "${S}/edge.8"
51 doman "${S}/n2n.7"
52 doman "${S}/supernode.1"
53 keepdir /var/log/n2n
54 systemd_newunit "${S}/packages/etc/systemd/system/edge@.service.in" n2n-edge@.service
55 systemd_newunit "${S}/packages/etc/systemd/system/supernode.service.in" n2n-supernode.service
56 insinto /etc/n2n
57 newins "${S}/packages/etc/n2n/edge.conf.sample" edge-example.conf
58 doins "${S}/packages/etc/n2n/supernode.conf.sample"