# Generated by go2rpm 1.19.0 %bcond check 0 %global debug_package %{nil} %global bpf_headers_commit 56937c66784879fe5e2ff89db5bc05aa061d594c %global bpf_headers_commit_short %(c=%{bpf_headers_commit}; echo ${c:0:7}) # https://github.com/daeuniverse/dae %global goipath github.com/daeuniverse/dae Version: 2.0.0 %global tag v%{version} %gometa -L -f Name: dae Release: %autorelease Summary: EBPF-based Linux high-performance transparent proxy solution # Generated by go-vendor-tools License: AGPL-3.0-only AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND CC-PDDC AND MIT AND MPL-2.0 URL: %{gourl} Source0: %{gosource} # Generated by go-vendor-tools Source1: %{archivename}-vendor.tar.bz2 Source2: go-vendor-tools.toml Source3: https://github.com/daeuniverse/dae_bpf_headers/archive/%{bpf_headers_commit}/dae_bpf_headers-%{bpf_headers_commit}.tar.gz Source4: https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat Source5: https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat BuildRequires: go-vendor-tools BuildRequires: clang-devel BuildRequires: llvm-devel BuildRequires: golang >= 1.24 BuildRequires: git BuildRequires: systemd-units BuildRequires: systemd-rpm-macros Requires: systemd-units Requires: (dae-geo or (v2ray-geoip and v2ray-domain-list-community)) %description EBPF-based Linux high-performance transparent proxy solution. %package geo Summary: The geoip data file. BuildArch: noarch %description geo The geo database file. %prep %goprep -p1 tar -xf %{S:1} tar -xvf %{SOURCE3} --strip-components=1 -C %{_builddir}/%{name}-%{version}/trace/kern/headers tar -xvf %{SOURCE3} --strip-components=1 -C %{_builddir}/%{name}-%{version}/control/kern/headers %generate_buildrequires %go_vendor_license_buildrequires -c %{S:2} %build %global gomodulesmode GO111MODULE=on make CFLAGS="-fno-stack-protector" ebpf export GO_LDFLAGS='-s -w -X github.com/daeuniverse/dae/cmd.Version=%{version}' %gobuild -o %{gobuilddir}/bin/dae %{goipath} %install %go_vendor_license_install -c %{S:2} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ 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 %{SOURCE4} %{buildroot}%{_datadir}/%{name}/geosite.dat install -D -p -m 0644 %{SOURCE5} %{buildroot}%{_datadir}/%{name}/geoip.dat %check %if %{with check} %gotest ./... %endif %files -f %{go_vendor_license_filelist} %doc docs CHANGELOGS.md README.md %doc hack/templates/example-config.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