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