]> git.pld-linux.org Git - packages/apache-mod_gzip.git/blob - apache-mod_gzip.spec
- umask in scripts, other fixes/cosmetics where needed
[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:        4
8 License:        Apache
9 Group:          Networking/Daemons
10 # working URL: http://www.schroepl.net/_download/mod_gzip-1.3.19.1b.zip
11 Source0:        http://www.remotecommunications.com/apache/mod_%{mod_name}/src/%{version}/mod_%{mod_name}.c
12 Source1:        http://www.remotecommunications.com/apache/mod_%{mod_name}/src/%{version}/changes.txt
13 Source2:        http://www.remotecommunications.com/apache/mod_%{mod_name}/src/%{version}/commands.txt
14 Source3:        http://www.remotecommunications.com/apache/mod_%{mod_name}/src/%{version}/samples.txt
15 Source4:        %{name}.conf
16 URL:            http://www.schroepl.net/projekte/mod_gzip/
17 BuildRequires:  %{apxs}
18 BuildRequires:  apache(EAPI)-devel
19 BuildRequires:  zlib-devel
20 Requires(post,preun):   %{apxs}
21 Requires(post,preun):   grep
22 Requires(preun):        fileutils
23 Requires:       apache(EAPI)
24 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25
26 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR)
27 %define         _sysconfdir     /etc/httpd
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 -T -c
39 cp %{SOURCE0} .
40 cp %{SOURCE1} .
41 cp %{SOURCE2} .
42 cp %{SOURCE3} .
43
44 %build
45 %{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.so -lz
46
47 %install
48 rm -rf $RPM_BUILD_ROOT
49 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
50
51 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
52 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mod_gzip.conf
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/httpd/httpd.conf ] && ! grep -q "^Include.*mod_gzip.conf" /etc/httpd/httpd.conf; then
60         echo "Include /etc/httpd/mod_gzip.conf" >> /etc/httpd/httpd.conf
61 fi
62 if [ -f /var/lock/subsys/httpd ]; then
63         /etc/rc.d/init.d/httpd 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_gzip.conf" /etc/httpd/httpd.conf > \
71                 /etc/httpd/httpd.conf.tmp
72         mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
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 *.txt
81 %attr(755,root,root) %{_pkglibdir}/*
82 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_gzip.conf
This page took 0.085508 seconds and 4 git commands to generate.