]> git.pld-linux.org Git - packages/apache-mod_gzip.git/blob - apache-mod_gzip.spec
ee5fc19da24020b28d834641da0e70e5e69b66da
[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 Patch0:         mod_%{mod_name}-name_clash.patch
12 URL:            http://sourceforge.net/projects/mod-gzip/
13 BuildRequires:  %{apxs}
14 BuildRequires:  apache(EAPI)-devel
15 BuildRequires:  zlib-devel
16 Requires(post,preun):   %{apxs}
17 Requires(post,preun):   grep
18 Requires(preun):        fileutils
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 -n mod_%{mod_name}-%{version}
35 %patch0 -p1
36
37 %build
38 %{apxs} -Wc,-Wall,-pipe -c mod_%{mod_name}.c mod_%{mod_name}_debug.c mod_%{mod_name}_compress.c -o mod_%{mod_name}.so
39
40 %install
41 rm -rf $RPM_BUILD_ROOT
42 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
43
44 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
45 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
46
47 %clean
48 rm -rf $RPM_BUILD_ROOT
49
50 %post
51 %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
52 if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*mod_gzip.conf" /etc/httpd/httpd.conf; then
53         echo "Include /etc/httpd/mod_gzip.conf" >> /etc/httpd/httpd.conf
54 fi
55 if [ -f /var/lock/subsys/httpd ]; then
56         /etc/rc.d/init.d/httpd restart 1>&2
57 fi
58
59 %preun
60 if [ "$1" = "0" ]; then
61         %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
62         umask 027
63         grep -v "^Include.*mod_gzip.conf" /etc/httpd/httpd.conf > \
64                 /etc/httpd/httpd.conf.tmp
65         mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
66         if [ -f /var/lock/subsys/httpd ]; then
67                 /etc/rc.d/init.d/httpd restart 1>&2
68         fi
69 fi
70
71 %files
72 %defattr(644,root,root,755)
73 %doc docs/manual/english/*
74 %lang(de) %doc docs/manual/deutsch
75 %attr(755,root,root) %{_pkglibdir}/*
76 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_gzip.conf
This page took 0.037371 seconds and 2 git commands to generate.