net-proxy/dae: add 0.6.0_rc2, drop 0.6.0_rc1
[gentoo-zh.git] / net-proxy / dae / dae-0.6.0_rc2.ebuild
blob52baacacd723fcd42f6dd16266e2eb892430d790
1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit flag-o-matic linux-info go-module systemd shell-completion
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
26 RDEPEND="$DEPEND"
27 BDEPEND="sys-devel/clang"
29 S="${WORKDIR}"
31 pkg_pretend() {
32 local CONFIG_CHECK="
33 ~BPF
34 ~BPF_SYSCALL
35 ~BPF_JIT
36 ~CGROUPS
37 ~KPROBES
38 ~NET_INGRESS
39 ~NET_EGRESS
40 ~NET_SCH_INGRESS
41 ~NET_CLS_BPF
42 ~NET_CLS_ACT
43 ~BPF_STREAM_PARSER
44 ~DEBUG_INFO
45 ~DEBUG_INFO_BTF
46 ~KPROBE_EVENTS
47 ~BPF_EVENTS
50 if kernel_is -lt ${MINKV//./ }; then
51 ewarn "Kernel version at least ${MINKV} required"
54 check_extra_config
57 src_prepare() {
58 # Prevent conflicting with the user's flags
59 sed -i -e 's/-O2//' "${S}/Makefile" || die 'Failed to remove -O2 via sed'
60 sed -i -e 's/-Werror//' "${S}/Makefile" || die 'Failed to remove -Werror via sed'
62 default
65 src_compile() {
66 #-flto makes llvm-strip complains
67 #llvm-strip: error: '*/control/bpf_bpfel.o': The file was not recognized as a valid object file
68 filter-lto
69 # for dae's ebpf target
70 # gentoo-zh#3720
71 filter-flags "-march=*" "-mtune=*"
72 append-cflags "-fno-stack-protector"
74 emake VERSION="${PV}" GOFLAGS="-buildvcs=false -w"
77 src_install() {
78 dobin dae
80 systemd_dounit install/dae.service
81 newinitd "${FILESDIR}"/dae.initd dae
83 insinto /etc/dae
84 newins example.dae config.dae.example
85 newins install/empty.dae config.dae
87 newbashcomp install/shell-completion/dae.bash dae
88 newfishcomp install/shell-completion/dae.fish dae.fish
89 newzshcomp install/shell-completion/dae.zsh _dae
91 dosym -r "/usr/share/v2ray/geosite.dat" /usr/share/dae/geosite.dat
92 dosym -r "/usr/share/v2ray/geoip.dat" /usr/share/dae/geoip.dat