diff --git a/mod_security_crs.spec b/mod_security_crs.spec index 20179cf..e09e6ae 100644 --- a/mod_security_crs.spec +++ b/mod_security_crs.spec @@ -38,17 +38,20 @@ install -m0644 rules/*.data %{buildroot}%{_datarootdir}/mod_modsecurity_crs/rule install -m0644 plugins/* %{buildroot}%{_sysconfdir}/httpd/modsecurity.d/plugins/ mv crs-setup.conf.example %{buildroot}%{_sysconfdir}/httpd/modsecurity.d/crs-setup.conf +%post # activate base_rules for f in `ls %{buildroot}%{_datarootdir}/mod_modsecurity_crs/rules/` ; do ln -s %{_datarootdir}/mod_modsecurity_crs/rules/$f %{buildroot}%{_sysconfdir}/httpd/modsecurity.d/activated_rules/$f; done -%post sed '/Include(Optional)? modsecurity.d\/\*\.conf/a\tInclude$1 modsecurity.d/plugins/*-config.conf\n\tInclude$1 modsecurity.d/plugins/*-before.conf' %{_httpd_confdir}/mod_security.conf sed '/Include(Optional)? modsecurity.d\/local_rules\/\*\.conf/a\tInclude$1 modsecurity.d/plugins/*-after.conf' %{_httpd_confdir}/mod_security.conf %postun sed '/Include(Optional)? modsecurity.d\/plugins/d' %{_httpd_confdir}/mod_security.conf +for f in `ls %{buildroot}%{_datarootdir}/mod_modsecurity_crs/rules/` ; do + %{__rm} %{buildroot}%{_sysconfdir}/httpd/modsecurity.d/activated_rules/$f; +done %files %license LICENSE