# Generated by go2rpm 1.16.0 %bcond check 1 # https://github.com/TecharoHQ/anubis %global goipath github.com/TecharoHQ/anubis Version: 1.16.0 %gometa -L -f %global common_description %{expand: Weighs the soul of incoming HTTP requests using proof-of-work to stop AI crawlers.} Name: anubis Release: %autorelease Summary: Weighs the soul of incoming HTTP requests using proof-of-work to stop AI crawlers # Generated by go-vendor-tools License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT URL: %{gourl} Source0: %{gosource} # Generated by go-vendor-tools Source1: %{archivename}-vendor.tar.bz2 Source2: go-vendor-tools.toml BuildRequires: go-vendor-tools BuildRequires: systemd-rpm-macros # To build the assets BuildRequires: bash BuildRequires: brotli BuildRequires: golang-github-evanw-esbuild BuildRequires: gzip BuildRequires: make BuildRequires: nodejs-npm BuildRequires: postcss-cli # TODO: this also needs cssnano and postcss-url to work BuildRequires: zstd %description %{common_description} %prep %goprep -A %setup -q -T -D -a1 %{forgesetupargs} #autopatch -p1 %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 rm lib/anubis_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 %autochangelog