File coraza-spoa.spec of Package coraza-spoa
#
# spec file for package coraza-spoa
#
# Copyright (c) 2025 amagical.net
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: coraza-spoa
Version: 0.4.0+git3
Release: 0
Summary: A wrapper for integrating the OWASP Coraza WAF with HAProxy's SPOE filters
License: Apache-2.0
URL: https://github.com/corazawaf/coraza-spoa
Source: %{name}-%{version}.tar.xz
Source1: vendor.tar.xz
BuildRequires: golang-packaging
%description
Coraza SPOA is a system daemon which brings the Coraza Web Application Firewall
(WAF) as a backing service for HAProxy. It is written in Go, Coraza supports
ModSecurity SecLang rulesets and is 100% compatible with the OWASP Core Rule
Set v4.
%prep
%autosetup -p1 -a1
%build
go build \
-mod=vendor \
-buildmode=pie
%install
install -D -m0755 coraza-spoa %{buildroot}%{_bindir}/coraza-spoa
install -D -m0644 contrib/coraza-spoa.service %{buildroot}%{_unitdir}/coraza-spoa.service
install -D -m0644 example/coraza-spoa.yaml %{buildroot}%{_docdir}/coraza-spoa.yaml.example
%check
go test
%pre
%service_add_pre coraza-spoa.service
%post
%service_add_post coraza-spoa.service
%preun
%service_del_preun coraza-spoa.service
%postun
%service_del_postun coraza-spoa.service
%files
%license LICENSE
%doc README.md
%{_bindir}/coraza-spoa
%{_unitdir}/coraza-spoa.service
%{_docdir}/coraza-spoa.yaml.example
%changelog