2 %define apxs /usr/sbin/apxs
3 Summary: Apache module: On-the-fly compression of HTML documents
4 Summary(pl): Modu³ do apache: kompresuje dokumenty HTML w locie
5 Name: apache-mod_%{mod_name}
9 Group: Networking/Daemons
10 Source0: http://dl.sourceforge.net/mod-gzip/mod_gzip-%{version}.tgz
11 # Source0-md5: 080ccc5d789ed5efa0c0a7625e4fa02d
12 Source1: mod_%{mod_name}.logrotate
13 Patch0: mod_%{mod_name}-name_clash.patch
14 Patch1: mod_%{mod_name}-security.patch
15 URL: http://sourceforge.net/projects/mod-gzip/
16 BuildRequires: %{apxs}
17 BuildRequires: apache(EAPI)-devel
18 BuildRequires: zlib-devel
19 Requires(post,preun): %{apxs}
20 Requires(post,preun): grep
21 Requires(preun): fileutils
22 Requires: apache(EAPI)
23 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 %define _pkglibdir %(%{apxs} -q LIBEXECDIR)
26 %define _sysconfdir /etc/httpd
29 Apache module: On-the-fly compression of HTML documents. Browser will
30 transparently decompress and display such documents.
33 Modu³ do apache: kompresuje dokumenty HTML w locie. Przegl±darki w
34 sposób przezroczysty dekompresuj± i wy¶wietlaj± takie dokumenty.
37 %setup -q -n mod_%{mod_name}-%{version}
42 %{apxs} -Wc,-Wall,-pipe -c mod_%{mod_name}.c mod_%{mod_name}_debug.c mod_%{mod_name}_compress.c -o mod_%{mod_name}.so
45 rm -rf $RPM_BUILD_ROOT
46 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir},/etc/logrotate.d}
48 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
49 sed -e 's#logs/mod_gzip.log#/var/log/httpd/mod_gzip.log#g' docs/mod_gzip.conf.sample > $RPM_BUILD_ROOT%{_sysconfdir}/mod_gzip.conf
51 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
54 rm -rf $RPM_BUILD_ROOT
57 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
58 if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*mod_%{mod_name}.conf" /etc/httpd/httpd.conf; then
59 echo "Include /etc/httpd/mod_%{mod_name}.conf" >> /etc/httpd/httpd.conf
61 if [ -f /var/lock/subsys/httpd ]; then
62 /etc/rc.d/init.d/httpd restart 1>&2
66 if [ "$1" = "0" ]; then
67 %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
69 grep -v "^Include.*mod_%{mod_name}.conf" /etc/httpd/httpd.conf > \
70 /etc/httpd/httpd.conf.tmp
71 mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
72 if [ -f /var/lock/subsys/httpd ]; then
73 /etc/rc.d/init.d/httpd restart 1>&2
78 %defattr(644,root,root,755)
79 %doc docs/manual/english/*
80 %lang(de) %doc docs/manual/deutsch
81 %attr(755,root,root) %{_pkglibdir}/*
82 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_gzip.conf
83 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/*