## START: Set by rpmautospec ## (rpmautospec version 0.8.1) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # Generated by go2rpm 1.17.1 %bcond check 1 # https://github.com/TecharoHQ/anubis %global goipath github.com/TecharoHQ/anubis Version: 1.21.3 %gometa -L -f %global common_description %{expand: Weighs the soul of incoming HTTP requests to stop AI crawlers.} Name: anubis Release: %autorelease Summary: Weighs the soul of incoming HTTP requests to stop AI crawlers # Generated by go-vendor-tools License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC 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 BuildRequires: go-vendor-tools BuildRequires: sed BuildRequires: systemd-rpm-macros # To build the assets BuildRequires: bash BuildRequires: brotli BuildRequires: golang-github-evanw-esbuild BuildRequires: gzip BuildRequires: make BuildRequires: nodejs-cssnano BuildRequires: nodejs-cssnano-preset-advanced BuildRequires: nodejs-npm BuildRequires: nodejs-postcss-url BuildRequires: postcss-cli BuildRequires: zstd %description %{common_description} %prep %goprep -A %setup -q -T -D -a1 %{forgesetupargs} #autopatch -p1 # Neuter vendoring logic in the Makefile sed -i 's/assets: deps/assets:/' Makefile %generate_buildrequires %go_vendor_license_buildrequires -c %{S:2} %build make assets export GO_LDFLAGS="-X 'github.com/TecharoHQ/anubis.Version=%{version}-%{release}'" %gobuild -o %{gobuilddir}/bin/%{name} %{goipath}/cmd/%{name} %install %go_vendor_license_install -c %{S:2} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ install -Dpm0644 -t %{buildroot}%{_unitdir}/ run/anubis@.service install -Dpm0644 -t %{buildroot}%{_sysconfdir}/%{name}/ run/default.env %post %systemd_post anubis@default.service %preun %systemd_preun anubis@default.service %postun %systemd_postun_with_restart anubis@default.service %check %go_vendor_license_check -c %{S:2} %if %{with check} export DONT_USE_NETWORK=1 # Skip tests that don't work in mock because they spawn an HTTP server # TODO: make this less coarse rm lib/{anubis,http}_test.go %gocheck %endif %files -f %{go_vendor_license_filelist} %license vendor/modules.txt %doc docs README.md %{_bindir}/%{name} %{_unitdir}/anubis@.service %dir %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}/default.env %changelog ## START: Generated by rpmautospec * Mon Aug 18 2025 Davide Cavalca - 1.21.3-1 - Import rhbz#2360489 ## END: Generated by rpmautospec