- Fix the install part since extra and experimental rules are not longer

included in 3.x
- Remove EL5 bits since EL5/EPEL5 are OEL-ed
- Bump reqs
This commit is contained in:
Athmane Madjoudj 2017-04-22 14:35:44 +01:00
parent 887ce1a4ea
commit 544ea44c25

View File

@ -1,82 +1,55 @@
%global with_extras 0%{?fedora} || 0%{?rhel} <= 6
Summary: ModSecurity Rules
Name: mod_security_crs
Version: 3.0.0
Release: 1%{?dist}
Release: 2%{?dist}
License: ASL 2.0
URL: https://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project
Group: System Environment/Daemons
Source: https://github.com/SpiderLabs/owasp-modsecurity-crs/archive/v%{version}/owasp-modsecurity-crs-%{version}.tar.gz
BuildArch: noarch
Requires: mod_security >= 2.7.0
Requires: mod_security >= 2.8.0
Obsoletes: mod_security_crs-extras
%description
This package provides the base rules for mod_security.
%if %with_extras
%package extras
Summary: Supplementary mod_security rules
Group: System Environment/Daemons
Requires: %name = %version-%release
%description extras
This package provides supplementary rules for mod_security.
%endif
%prep
%autosetup -q -n
%setup -q -n owasp-modsecurity-crs-%{version}
%build
%install
rm -rf %{buildroot}
install -d %{buildroot}%{_sysconfdir}/httpd/modsecurity.d/
install -d %{buildroot}%{_sysconfdir}/httpd/modsecurity.d/activated_rules
install -d %{buildroot}%{_prefix}/lib/modsecurity.d/base_rules
%if %with_extras
install -d %{buildroot}%{_prefix}/lib/modsecurity.d/optional_rules
install -d %{buildroot}%{_prefix}/lib/modsecurity.d/experimental_rules
install -d %{buildroot}%{_prefix}/lib/modsecurity.d/slr_rules
%endif
# To exclude rules (pre/post)
mv rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf.example rules/REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.conf
mv rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf.example rules/RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf
install -m0644 modsecurity_crs_10_setup.conf.example %{buildroot}%{_sysconfdir}/httpd/modsecurity.d/modsecurity_crs_10_config.conf
install -m0644 base_rules/* %{buildroot}%{_prefix}/lib/modsecurity.d/base_rules/
%if %with_extras
install -m0644 optional_rules/* %{buildroot}%{_prefix}/lib/modsecurity.d/optional_rules/
install -m0644 experimental_rules/* %{buildroot}%{_prefix}/lib/modsecurity.d/experimental_rules/
install -m0644 slr_rules/* %{buildroot}%{_prefix}/lib/modsecurity.d/slr_rules
%endif
install -m0644 rules/* %{buildroot}%{_prefix}/lib/modsecurity.d/base_rules/
mv crs-setup.conf.example %{buildroot}%{_sysconfdir}/httpd/modsecurity.d/crs-setup.conf
# activate base_rules
for f in `ls %{buildroot}/%{_prefix}/lib/modsecurity.d/base_rules/` ; do
ln -s %{_prefix}/lib/modsecurity.d/base_rules/$f %{buildroot}%{_sysconfdir}/httpd/modsecurity.d/activated_rules/$f;
done
%clean
rm -rf %{buildroot}
%files
%doc CHANGES INSTALL LICENSE README.md
%license LICENSE
%doc CHANGES README.md
%config(noreplace) %{_sysconfdir}/httpd/modsecurity.d/activated_rules/*
%config(noreplace) %{_sysconfdir}/httpd/modsecurity.d/modsecurity_crs_10_config.conf
%config(noreplace) %{_sysconfdir}/httpd/modsecurity.d/crs-setup.conf
%{_prefix}/lib/modsecurity.d/base_rules
%if %with_extras
%files extras
%{_prefix}/lib/modsecurity.d/optional_rules
%{_prefix}/lib/modsecurity.d/experimental_rules
%{_prefix}/lib/modsecurity.d/slr_rules
%endif
%changelog
* Sat Apr 22 2017 Athmane Madjoudj <athmane@fedoraproject.org> - 3.0.0-2
- Fix the install part since extra and experimental rules are not longer included in 3.x
- Remove EL5 bits since EL5/EPEL5 are OEL-ed
- Bump reqs
* Sat Apr 22 2017 Athmane Madjoudj <athmane@fedoraproject.org> - 3.0.0-1
- Update to 3.0.0
- Clean up the spec