app-crypt/etoken-sac: fix eutils EAPI 7
[gentoo-zh.git] / net-proxy / dae / dae-0.2.4.ebuild
blob390c098dbd1ffa3d033f9acb10530c1a8dfb9ab0
1 # Copyright 1999-2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit linux-info go-module systemd
8 _MY_PV=${PV/_rc/rc}
10 DESCRIPTION="A lightweight and high-performance transparent proxy solution based on eBPF"
11 HOMEPAGE="https://github.com/daeuniverse/dae"
13 LICENSE="AGPL-3"
14 SLOT="0"
15 KEYWORDS="~amd64 ~riscv"
16 MINKV="5.8"
17 SRC_URI="
18         https://github.com/daeuniverse/dae/releases/download/v${_MY_PV}/dae-full-src.zip -> ${P}.zip
20 RESTRICT="mirror"
22 DEPEND="
23         app-alternatives/v2ray-geoip
24         app-alternatives/v2ray-geosite
25         app-arch/p7zip
27 RDEPEND="$DEPEND"
28 BDEPEND="sys-devel/clang"
30 S=${WORKDIR}
32 pkg_pretend() {
33         local CONFIG_CHECK="
34                 ~BPF
35                 ~BPF_SYSCALL
36                 ~BPF_JIT
37                 ~CGROUPS
38                 ~KPROBES
39                 ~NET_INGRESS
40                 ~NET_EGRESS
41                 ~NET_SCH_INGRESS
42                 ~NET_CLS_BPF
43                 ~NET_CLS_ACT
44                 ~BPF_STREAM_PARSER
45                 ~DEBUG_INFO
46                 ~DEBUG_INFO_BTF
47                 ~KPROBE_EVENTS
48                 ~BPF_EVENTS
49         "
51         if kernel_is -lt ${MINKV//./ }; then
52                 ewarn "Kernel version at least ${MINKV} required"
53         fi
55         check_extra_config
58 src_compile() {
59         emake VERSION="${PV}" GOFLAGS="-buildvcs=false" CC=clang CFLAGS="$CFLAGS -fno-stack-protector"
62 src_install() {
63         dobin dae
64         systemd_dounit install/dae.service
65         insinto /etc/dae
66         newins example.dae config.dae.example
67         newins install/empty.dae config.dae
68         dosym -r "/usr/share/v2ray/geosite.dat" /usr/share/dae/geosite.dat
69         dosym -r "/usr/share/v2ray/geoip.dat" /usr/share/dae/geoip.dat