File modsecurity.spec of Package modsecurity
#
# spec file for package modsecurity
#
# Copyright (c) 2022 SUSE LLC
#
# 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/
#
%bcond_without curl
%bcond_without geoip
%bcond_without lua
%bcond_without pcre2
%bcond_without ssdeep
%bcond_without yajl
Name: modsecurity
Version: 3.0.7
Release: 0
Summary: Web application firewall engine
License: BSD-2-Clause
Group: Productivity/Networking/Security
URL: https://www.modsecurity.org/
Source0: https://github.com/SpiderLabs/ModSecurity/releases/download/v%{version}/modsecurity-v%{version}.tar.gz
Source1: baselibs.conf
BuildRequires: automake
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: gd-devel
BuildRequires: git
BuildRequires: libtool
BuildRequires: libxslt-devel
BuildRequires: openssl-devel
BuildRequires: pcre-devel
BuildRequires: pkgconfig
%if %{with curl}
BuildRequires: libcurl-devel
%endif
%if %{with geoip}
BuildRequires: libmaxminddb-devel
%endif
%if %{with lua}
BuildRequires: lua-devel
%endif
%if %{with pcre2}
BuildRequires: pcre2-devel
%endif
%if %{with ssdeep}
BuildRequires: libfuzzy-devel
%endif
%if %{with yajl}
BuildRequires: libyajl-devel
%endif
%description
ModSecurity is a toolkit for real-time web application monitoring, logging, and
access control.
%package -n libmodsecurity3
Summary: Web application firewall engine
Group: System/Libraries
%description -n libmodsecurity3
ModSecurity is a toolkit for real-time web application monitoring, logging, and
access control.
%package devel
Summary: Development files for modsecurity, a web application firewall engine
Group: Development/Languages/C and C++
Requires: libmodsecurity3 = %{version}
%description devel
ModSecurity is a toolkit for real-time web application monitoring, logging, and
access control.
This subpackage holds the development headers for the library.
%prep
%setup -q -n %{name}-v%{version}
%build
export MAKEFLAGS=-j$(($(grep -c ^processor /proc/cpuinfo) - 0))
sh build.sh
%configure \
%if %{with pcre2}
--with-pcre2=yes \
%endif
--disable-doxygen-doc --disable-examples --disable-dependency-tracking
%make_build
%install
export MAKEFLAGS=-j$(($(grep -c ^processor /proc/cpuinfo) - 0))
%make_install
find %{buildroot} -type f -name "*.la" -delete -print
find %{buildroot} -type f -name "*.a" -delete -print
install -Ddm0755 %{buildroot}%{_datadir}/%{name}
install -m0644 %{name}.conf-recommended %{buildroot}%{_datadir}/%{name}/
install -m0644 unicode.mapping %{buildroot}%{_datadir}/%{name}/
%post -n libmodsecurity3 -p /sbin/ldconfig
%postun -n libmodsecurity3 -p /sbin/ldconfig
%files
%license LICENSE
%{_bindir}/modsec-rules-check
%dir %{_datadir}/modsecurity
%{_datadir}/modsecurity/modsecurity.conf-recommended
%{_datadir}/modsecurity/unicode.mapping
%files -n libmodsecurity3
%license LICENSE
%{_libdir}/libmodsecurity.so.3
%{_libdir}/libmodsecurity.so.3.*
%files devel
%{_libdir}/libmodsecurity.so
%{_includedir}/modsecurity
%{_libdir}/pkgconfig/*.pc
%changelog