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