]>
Commit | Line | Data |
---|---|---|
e7204cb7 | 1 | %define apxs /usr/sbin/apxs |
dbbca04e JR |
2 | # Use the following command to verify gitver and githash when updating from master: |
3 | # wget --content-disposition https://github.com/SpiderLabs/owasp-modsecurity-crs/tarball/master | |
4 | %define gitver 2.2.7-21 | |
5 | %define githash d4f9c5a | |
e7204cb7 JR |
6 | Summary: OWASP ModSecurity Core Rule Set (CRS) |
7 | Name: apache-mod_security_crs | |
1750fac0 JR |
8 | #Version: %(echo %{gitver} | tr - .) |
9 | Version: 2.2.8 | |
10 | Release: 1 | |
e7204cb7 JR |
11 | License: ASL 2.0 |
12 | Group: Networking/Daemons/HTTP | |
1750fac0 JR |
13 | #Source0: https://github.com/SpiderLabs/owasp-modsecurity-crs/tarball/%{githash}/SpiderLabs-owasp-modsecurity-crs-%{gitver}-%{githash}.tar.gz |
14 | Source0: https://github.com/SpiderLabs/owasp-modsecurity-crs/archive/%{version}/SpiderLabs-owasp-modsecurity-crs-%{version}.tar.gz | |
15 | # Source0-md5: fdee278c02d41a1377dc20a616b2f327 | |
e7204cb7 JR |
16 | URL: http://www.modsecurity.org/ |
17 | BuildRequires: apache-devel | |
18 | BuildRequires: rpmbuild(macros) >= 1.268 | |
19 | Requires: apache-mod_security >= 2.7.0 | |
dbbca04e | 20 | BuildArch: noarch |
e7204cb7 JR |
21 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
22 | ||
23 | %define apacheconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d | |
24 | ||
25 | %description | |
26 | OWASP ModSecurity Core Rule Set provides generic protection from | |
27 | unknown vulnerabilities often found in web applications, which are | |
28 | in most cases custom coded. The Core Rules are heavily commented to | |
29 | allow it to be used as a step-by-step deployment guide | |
30 | for ModSecurity™. | |
31 | ||
dbbca04e JR |
32 | %package extras |
33 | Summary: Supplementary OWASP ModSecurity Core Rule Set (CRS) | |
34 | Group: Networking/Daemons/HTTP | |
35 | Requires: %{name} = %{version}-%{release} | |
36 | ||
37 | %description extras | |
38 | This package provides supplementary rules for mod_security. | |
39 | ||
e7204cb7 | 40 | %prep |
1750fac0 JR |
41 | #%setup -q -n SpiderLabs-owasp-modsecurity-crs-%{githash} |
42 | %setup -q -n owasp-modsecurity-crs-%{version} | |
e7204cb7 JR |
43 | |
44 | %build | |
45 | ||
46 | %install | |
47 | rm -rf $RPM_BUILD_ROOT | |
dbbca04e JR |
48 | install -d $RPM_BUILD_ROOT%{apacheconfdir}/modsecurity.d/activated_rules \ |
49 | $RPM_BUILD_ROOT%{_datadir}/modsecurity.d/base_rules \ | |
50 | $RPM_BUILD_ROOT%{_datadir}/modsecurity.d/{optional,experimental,slr}_rules | |
51 | ||
52 | install modsecurity_crs_10_setup.conf.example $RPM_BUILD_ROOT%{apacheconfdir}/modsecurity.d/modsecurity_crs_10_config.conf | |
53 | install base_rules/* $RPM_BUILD_ROOT%{_datadir}/modsecurity.d/base_rules/ | |
e7204cb7 | 54 | |
dbbca04e JR |
55 | install optional_rules/* $RPM_BUILD_ROOT%{_datadir}/modsecurity.d/optional_rules/ |
56 | install experimental_rules/* $RPM_BUILD_ROOT%{_datadir}/modsecurity.d/experimental_rules/ | |
57 | install slr_rules/* $RPM_BUILD_ROOT%{_datadir}/modsecurity.d/slr_rules | |
58 | ||
59 | # activate base_rules | |
60 | cd $RPM_BUILD_ROOT/%{_datadir}/modsecurity.d/base_rules | |
61 | for f in * ; do | |
62 | ln -s %{_datadir}/modsecurity.d/base_rules/$f $RPM_BUILD_ROOT%{apacheconfdir}/modsecurity.d/activated_rules/$f | |
63 | done | |
e7204cb7 JR |
64 | |
65 | %clean | |
66 | rm -rf $RPM_BUILD_ROOT | |
67 | ||
68 | %files | |
69 | %defattr(644,root,root,755) | |
1750fac0 | 70 | %doc CHANGES INSTALL LICENSE README.md util |
dbbca04e JR |
71 | %config(noreplace) %verify(not md5 mtime size) %{apacheconfdir}/modsecurity.d/activated_rules/* |
72 | %config(noreplace) %verify(not md5 mtime size) %{apacheconfdir}/modsecurity.d/modsecurity_crs_10_config.conf | |
81894058 | 73 | %dir %{_datadir}/modsecurity.d |
dbbca04e JR |
74 | %{_datadir}/modsecurity.d/base_rules |
75 | ||
76 | %files extras | |
77 | %defattr(644,root,root,755) | |
78 | %{_datadir}/modsecurity.d/optional_rules | |
79 | %{_datadir}/modsecurity.d/experimental_rules | |
80 | %{_datadir}/modsecurity.d/slr_rules |