%global bpf_headers_commit 38c614ea1a49785dccc058c0f0e14b25b26c8cd7 %global bpf_headers_commit_short %(c=%{bpf_headers_commit}; echo ${c:0:7}) Name: dae Version: 0.9.0 Release: 1%{?dist} Summary: eBPF-based Linux high-performance transparent proxy solution. License: AGPL-3.0-or-later URL: https://github.com/daeuniverse/%{name} Source0: %{url}/archive/v%{version}/%{name}-v%{version}.tar.gz Source1: https://github.com/daeuniverse/dae_bpf_headers/archive/%{bpf_headers_commit}/dae_bpf_headers-%{bpf_headers_commit}.tar.gz Source2: https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat Source3: https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat BuildRequires: clang-devel BuildRequires: llvm-devel BuildRequires: golang >= 1.22 BuildRequires: git BuildRequires: systemd-units BuildRequires: systemd-rpm-macros Requires: systemd-units Requires: (dae-geo or (v2ray-geoip and v2ray-domain-list-community)) %description The universal proxy platform. %package geo Summary: The geoip data file. BuildArch: noarch %description geo The geo database file. %global debug_package %{nil} %global source_date_epoch_from_changelog 0 %prep %setup -q -n %{name}-%{version} tar -xvf %{SOURCE1} --strip-components=1 -C %{_builddir}/%{name}-%{version}/trace/kern/headers tar -xvf %{SOURCE1} --strip-components=1 -C %{_builddir}/%{name}-%{version}/control/kern/headers %build go env -w GOPROXY=https://proxy.golang.org,direct export GOFLAGS="-buildmode=pie -trimpath -modcacherw" export CFLAGS="-fno-stack-protector" make VERSION=%{version} %install install -D -p -m 0755 %{name} %{buildroot}%{_bindir}/%{name} install -D -p -m 0644 install/%{name}.service %{buildroot}%{_unitdir}/%{name}.service install -D -p -m 0644 install/empty.dae %{buildroot}%{_sysconfdir}/%{name}/config.dae install -D -p -m 0644 example.dae %{buildroot}%{_sysconfdir}/%{name}/config.dae.example install -D -p -m 0644 %{_sourcedir}/geoip.dat %{buildroot}%{_datadir}/%{name}/geoip.dat install -D -p -m 0644 %{_sourcedir}/geosite.dat %{buildroot}%{_datadir}/%{name}/geosite.dat %files %defattr(-,root,root,-) %license LICENSE %doc README.md %{_bindir}/%{name} %attr(-, root, root) %{_unitdir}/%{name}.service %{_sysconfdir}/dae/config.dae.example %config(noreplace) %{_sysconfdir}/%{name}/config.dae %files geo %{_datadir}/%{name}/geoip.dat %{_datadir}/%{name}/geosite.dat %changelog %autochangelog