]>
Commit | Line | Data |
---|---|---|
d418d050 | 1 | # $Revision: 1.1 $ |
2 | %define apxs /usr/sbin/apxs | |
3 | %define mod_name clamav | |
4 | Summary: an Apache virus scanning filter | |
5 | Name: apache-mod_%{mod_name} | |
6 | Version: 0.12 | |
7 | Release: 1 | |
8 | License: GPL | |
9 | Group: Networking/Daemons | |
10 | Source0: http://software.othello.ch/mod_clamav/mod_%{mod_name}-%{version}.tar.gz | |
11 | Source1: %{name}.conf | |
12 | Patch0: %{name}-libtool-tag.patch | |
13 | URL: http://software.othello.ch/mod_clamav/ | |
14 | BuildRequires: %{apxs} | |
15 | BuildRequires: autoconf | |
16 | BuildRequires: automake | |
17 | BuildRequires: apache-devel | |
18 | BuildRequires: apr-devel | |
19 | BuildRequires: apr-util-devel | |
20 | Requires: apache >= 2 | |
21 | Requires: apache-mod_proxy | |
22 | Requires: clamav | |
23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
24 | ||
25 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR) | |
26 | %define _sysconfdir /etc/httpd | |
27 | %define _libexecdir %{_libdir}/apache | |
28 | ||
29 | %description | |
30 | mod_clamav is an Apache 2 filter which scans the content delivered by | |
31 | the proxy module (mod_proxy) for viruses using the Clamav virus | |
32 | scanning engine. | |
33 | ||
34 | %prep | |
35 | %setup -q -n mod_%{mod_name}-%{version} | |
36 | %patch0 -p0 | |
37 | ||
38 | %build | |
39 | %{__aclocal} | |
40 | %{__autoconf} | |
41 | %{__automake} | |
42 | ||
43 | CPPFLAGS="${CPPFLAGS} -I `/usr/bin/apr-config --includedir`" | |
44 | CPPFLAGS="${CPPFLAGS} -I `/usr/bin/apu-config --includedir`" | |
45 | export CPPFLAGS | |
46 | ||
47 | %configure \ | |
48 | --with-apxs=%{apxs} | |
49 | ||
50 | %{__make} | |
51 | ||
52 | %install | |
53 | rm -rf $RPM_BUILD_ROOT | |
54 | ||
55 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/httpd.conf} | |
56 | install .libs/mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir} | |
57 | ||
58 | CFG="$RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf" | |
59 | install %{SOURCE1} ${CFG}/32_mod_clamav.conf | |
60 | ||
61 | %clean | |
62 | rm -rf $RPM_BUILD_ROOT | |
63 | ||
64 | %post | |
65 | if [ -f /var/lock/subsys/httpd ]; then | |
66 | /etc/rc.d/init.d/httpd restart 1>&2 | |
67 | else | |
68 | echo "Run \"/etc/rc.d/init.d/httpd start\" to start apache http daemon." | |
69 | fi | |
70 | ||
71 | %preun | |
72 | if [ "$1" = "0" ]; then | |
73 | if [ -f /var/lock/subsys/httpd ]; then | |
74 | /etc/rc.d/init.d/httpd restart 1>&2 | |
75 | fi | |
76 | fi | |
77 | ||
78 | %files | |
79 | %defattr(644,root,root,755) | |
80 | %doc AUTHORS ChangeLog COPYING INSTALL mod_clamav.html NEWS README TODO | |
81 | %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/httpd.conf/32_mod_clamav.conf | |
82 | %attr(755,root,root) %{_libexecdir}/mod_%{mod_name}.so |