- CAN-2003-0842, CAN-2003-0843, CAN-2003-0844 fix from SuSE
[packages/apache-mod_gzip.git] / apache-mod_gzip.spec
1 %define         mod_name        gzip
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}
6 Version:        1.3.26.1a
7 Release:        2
8 License:        Apache
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 URL:            http://sourceforge.net/projects/mod-gzip/
15 BuildRequires:  %{apxs}
16 BuildRequires:  apache(EAPI)-devel
17 BuildRequires:  zlib-devel
18 Requires(post,preun):   %{apxs}
19 Requires(post,preun):   grep
20 Requires(preun):        fileutils
21 Requires:       apache(EAPI)
22 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR)
25 %define         _sysconfdir     /etc/httpd
26
27 %description
28 Apache module: On-the-fly compression of HTML documents. Browser will
29 transparently decompress and display such documents.
30
31 %description -l pl
32 Modu³ do apache: kompresuje dokumenty HTML w locie. Przegl±darki w
33 sposób przezroczysty dekompresuj± i wy¶wietlaj± takie dokumenty.
34
35 %prep
36 %setup -q -n mod_%{mod_name}-%{version}
37 %patch0 -p1
38
39 %build
40 %{apxs} -Wc,-Wall,-pipe -c mod_%{mod_name}.c mod_%{mod_name}_debug.c mod_%{mod_name}_compress.c -o mod_%{mod_name}.so
41
42 %install
43 rm -rf $RPM_BUILD_ROOT
44 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir},/etc/logrotate.d}
45
46 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
47 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
48
49 install %{SOURCE1} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
50
51 %clean
52 rm -rf $RPM_BUILD_ROOT
53
54 %post
55 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
56 if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*mod_%{mod_name}.conf" /etc/httpd/httpd.conf; then
57         echo "Include /etc/httpd/mod_%{mod_name}.conf" >> /etc/httpd/httpd.conf
58 fi
59 if [ -f /var/lock/subsys/httpd ]; then
60         /etc/rc.d/init.d/httpd restart 1>&2
61 fi
62
63 %preun
64 if [ "$1" = "0" ]; then
65         %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
66         umask 027
67         grep -v "^Include.*mod_%{mod_name}.conf" /etc/httpd/httpd.conf > \
68                 /etc/httpd/httpd.conf.tmp
69         mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
70         if [ -f /var/lock/subsys/httpd ]; then
71                 /etc/rc.d/init.d/httpd restart 1>&2
72         fi
73 fi
74
75 %files
76 %defattr(644,root,root,755)
77 %doc docs/manual/english/*
78 %lang(de) %doc docs/manual/deutsch
79 %attr(755,root,root) %{_pkglibdir}/*
80 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_gzip.conf
81 %attr(640,root,root) %config(noreplace) /etc/logrotate.d/*
This page took 0.037533 seconds and 3 git commands to generate.