]> git.pld-linux.org Git - packages/apache-mod_gzip.git/blob - apache-mod_gzip.spec
- fixed huge bug (zeroing httpd.conf after deinstalation)
[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.19.1a
7 Release:        3
8 License:        Apache Software License
9 Group:          Networking/Daemons
10 Source0:        http://www.remotecommunications.com/apache/mod_%{mod_name}/src/%{version}/mod_%{mod_name}.c
11 Source1:        http://www.remotecommunications.com/apache/mod_%{mod_name}/src/%{version}/changes.txt
12 Source2:        http://www.remotecommunications.com/apache/mod_%{mod_name}/src/%{version}/commands.txt
13 Source3:        http://www.remotecommunications.com/apache/mod_%{mod_name}/src/%{version}/samples.txt
14 Source4:        %{name}.conf
15 BuildRequires:  %{apxs}
16 BuildRequires:  apache(EAPI)-devel
17 BuildRequires:  zlib-devel
18 Prereq:         %{_sbindir}/apxs
19 Requires:       apache(EAPI)
20 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21
22 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR)
23 %define         _sysconfdir     /etc/httpd
24
25 %description
26 Apache module: On-the-fly compression of HTML documents. Browser will
27 transparently decompress and display such documents.
28
29 %description -l pl
30 Modu³ do apache: kompresuje dokumenty HTML w locie. Przegl±darki w
31 sposób przezroczysty dekompresuj± i wy¶wietlaj± takie dokumenty.
32
33 %prep
34 %setup -q -T -c
35 cp %{SOURCE0} .
36 cp %{SOURCE1} .
37 cp %{SOURCE2} .
38 cp %{SOURCE3} .
39
40 %build
41 %{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.so -lz
42
43 %install
44 rm -rf $RPM_BUILD_ROOT
45 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
46
47 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
48 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mod_gzip.conf
49
50 gzip -9nf *.txt
51
52 %post
53 %{_sbindir}/apxs -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
54 if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*mod_gzip.conf" /etc/httpd/httpd.conf; then
55         echo "Include /etc/httpd/mod_gzip.conf" >> /etc/httpd/httpd.conf
56 fi
57 if [ -f /var/lock/subsys/httpd ]; then
58         /etc/rc.d/init.d/httpd restart 1>&2
59 fi
60
61 %preun
62 if [ "$1" = "0" ]; then
63         %{_sbindir}/apxs -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
64         grep -v "^Include.*mod_gzip.conf" /etc/httpd/httpd.conf > \
65                 /etc/httpd/httpd.conf.tmp
66         mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
67         if [ -f /var/lock/subsys/httpd ]; then
68                 /etc/rc.d/init.d/httpd restart 1>&2
69         fi
70 fi
71
72 %clean
73 rm -rf $RPM_BUILD_ROOT
74
75 %files
76 %defattr(644,root,root,755)
77 %doc *.gz
78 %attr(755,root,root) %{_pkglibdir}/*
79 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_gzip.conf
This page took 0.045139 seconds and 4 git commands to generate.