- added mlogc package
[packages/apache-mod_security.git] / apache-mod_security.spec
1 %define         mod_name        security
2 %define         apxs            /usr/sbin/apxs
3 Summary:        Apache module: securing web applications
4 Summary(pl.UTF-8):      Moduł do apache: ochrona aplikacji WWW
5 Name:           apache-mod_%{mod_name}
6 Version:        2.7.3
7 Release:        1
8 License:        GPL v2
9 Group:          Networking/Daemons/HTTP
10 Source0:        http://www.modsecurity.org/tarball/%{version}//modsecurity-apache_%{version}.tar.gz
11 # Source0-md5:  4a220bf4b954ed1760462e5956f65b21
12 Source1:        %{name}.conf
13 URL:            http://www.modsecurity.org/
14 BuildRequires:  apache-devel
15 BuildRequires:  autoconf
16 BuildRequires:  libxml2-devel
17 BuildRequires:  pcre-devel
18 BuildRequires:  pkgconfig
19 BuildRequires:  rpmbuild(macros) >= 1.268
20 Requires:       apache(modules-api) = %apache_modules_api
21 Requires:       apache-mod_unique_id
22 Suggests:       apache-mod_headers
23 Suggests:       apache-mod_security_crs
24 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25
26 %define         apacheconfdir   %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d
27 %define         apachelibdir    %(%{apxs} -q LIBEXECDIR 2>/dev/null)
28
29 %description
30 ModSecurity is an open source intrusion detection and prevention
31 engine for web applications. It operates embedded into the web server,
32 acting as a powerful umbrella - shielding web applications from
33 attacks.
34
35 %description -l pl.UTF-8
36 ModSecurity jest otwartym silnikiem wykrywania i zapobiegania intruzom
37 dla aplikacji WWW. Operuje w ramach serwera WWW, działając jak potężny
38 parasol chroniący aplikacje WWW przed atakami.
39
40 %package -n mlogc
41 Summary:        ModSecurity Audit Log Collector
42 Group:          Networking/Daemons/HTTP
43 Requires:       %{name} = %{version}
44
45 %description -n mlogc
46 This package contains the ModSecurity Audit Log Collector.
47
48 %prep
49 %setup -q -n modsecurity-apache_%{version}
50
51 %build
52 %configure
53 %{__make} \
54         CC="%{__cc}" \
55         CFLAGS="%{optflags}" \
56         top_dir="%{apachelibdir}"
57
58 %install
59 rm -rf $RPM_BUILD_ROOT
60 install -d $RPM_BUILD_ROOT{%{apachelibdir},%{apacheconfdir}} \
61         install -d $RPM_BUILD_ROOT{/var/log/mlogc/data,%{_bindir},%{_sysconfdir}}
62
63 install apache2/.libs/mod_%{mod_name}2.so $RPM_BUILD_ROOT%{apachelibdir}
64 cp -a %{SOURCE1} $RPM_BUILD_ROOT%{apacheconfdir}/90_mod_%{mod_name}.conf
65
66 install -d $RPM_BUILD_ROOT%{apacheconfdir}/modsecurity.d/blocking
67 cp -a modsecurity.conf-recommended $RPM_BUILD_ROOT%{apacheconfdir}/modsecurity.d
68 echo '# Drop your local rules in here.' > $RPM_BUILD_ROOT%{apacheconfdir}/modsecurity.d/modsecurity_localrules.conf
69
70 install mlogc/mlogc $RPM_BUILD_ROOT%{_bindir}
71 install mlogc/mlogc-batch-load.pl $RPM_BUILD_ROOT%{_bindir}/mlogc-batch-load
72 install mlogc/mlogc-default.conf $RPM_BUILD_ROOT%{_sysconfdir}/mlogc.conf
73
74 %clean
75 rm -rf $RPM_BUILD_ROOT
76
77 %post
78 %service -q httpd restart
79
80 %postun
81 if [ "$1" = "0" ]; then
82         %service -q httpd restart
83 fi
84
85 %files
86 %defattr(644,root,root,755)
87 %doc CHANGES README.* modsecurity* doc/* tools
88 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{apacheconfdir}/*_mod_%{mod_name}.conf
89 %dir %{apacheconfdir}/modsecurity.d
90 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{apacheconfdir}/modsecurity.d/*.*
91 %attr(755,root,root) %{apachelibdir}/*.so
92
93 %files -n mlogc
94 %defattr(644,root,root,755)
95 %doc mlogc/INSTALL
96 %attr(0640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mlogc.conf
97 %attr(0755,root,root) %{_bindir}/mlogc
98 %attr(0755,root,root) %{_bindir}/mlogc-batch-load
99 %attr(0755,root,root) %dir /var/log/mlogc
100 %attr(0770,root,http) %dir /var/log/mlogc/data
This page took 0.05356 seconds and 3 git commands to generate.