]> git.pld-linux.org Git - packages/apache-mod_gzip.git/blobdiff - apache-mod_gzip.spec
- use %service
[packages/apache-mod_gzip.git] / apache-mod_gzip.spec
index 4217d3fa66bb94927e36546c767d527ade327771..9b432d2980ff78890ca79b3240fbdf6d4e6c8d3e 100644 (file)
@@ -3,24 +3,25 @@
 Summary:       Apache module: On-the-fly compression of HTML documents
 Summary(pl):   Modu³ do apache: kompresuje dokumenty HTML w locie
 Name:          apache-mod_%{mod_name}
-Version:       1.3.19.1a
-Release:       4
+Version:       2.0.40
+Release:       0.1
 License:       Apache
 Group:         Networking/Daemons
-Source0:       http://www.remotecommunications.com/apache/mod_%{mod_name}/src/%{version}/mod_%{mod_name}.c
-Source1:       http://www.remotecommunications.com/apache/mod_%{mod_name}/src/%{version}/changes.txt
-Source2:       http://www.remotecommunications.com/apache/mod_%{mod_name}/src/%{version}/commands.txt
-Source3:       http://www.remotecommunications.com/apache/mod_%{mod_name}/src/%{version}/samples.txt
-Source4:       %{name}.conf
+Source0:       http://www.gknw.com/development/apache/httpd-2.0/unix/modules/mod_%{mod_name}-%{version}.tar.gz
+# Source0-md5: 30c17d999edb5d83368369cde1c921bb
+Source1:       %{name}.conf
+Source2:       %{name}.logrotate
+#URL:          http://www.schroepl.net/projekte/mod_gzip/
 BuildRequires: %{apxs}
-BuildRequires: apache(EAPI)-devel
+BuildRequires: apache-devel >= 2.0.40
+BuildRequires: rpmbuild(macros) >= 1.268
 BuildRequires: zlib-devel
-Prereq:                %{_sbindir}/apxs
-Requires:      apache(EAPI)
+Requires:      apache(modules-api) = %apache_modules_api
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define                _pkglibdir      %(%{apxs} -q LIBEXECDIR)
-%define         _sysconfdir     /etc/httpd
+%define                _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
+%define                _sysconfdir     %(%{apxs} -q SYSCONFDIR 2>/dev/null)
+%define                _pkglogdir      %(%{apxs} -q PREFIX 2>/dev/null)/logs
 
 %description
 Apache module: On-the-fly compression of HTML documents. Browser will
@@ -31,47 +32,36 @@ Modu
 sposób przezroczysty dekompresuj± i wy¶wietlaj± takie dokumenty.
 
 %prep
-%setup -q -T -c
-cp %{SOURCE0} .
-cp %{SOURCE1} .
-cp %{SOURCE2} .
-cp %{SOURCE3} .
+%setup -q -n mod_%{mod_name}
 
 %build
-%{apxs} -c mod_%{mod_name}.c -o mod_%{mod_name}.so -lz
+%{apxs} -Wc,-Wall,-pipe -c mod_%{mod_name}.c mod_%{mod_name}_debug.c mod_%{mod_name}_compress.c -o mod_%{mod_name}.so
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
+install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/httpd.conf,/etc/logrotate.d,%{_pkglogdir}}
 
 install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
-install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mod_gzip.conf
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf/90_mod_%{mod_name}.conf
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
+
+> $RPM_BUILD_ROOT%{_pkglogdir}/mod_gzip.log
+
+%clean
+rm -rf $RPM_BUILD_ROOT
 
 %post
-%{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
-if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*mod_gzip.conf" /etc/httpd/httpd.conf; then
-        echo "Include /etc/httpd/mod_gzip.conf" >> /etc/httpd/httpd.conf
-fi
-if [ -f /var/lock/subsys/httpd ]; then
-       /etc/rc.d/init.d/httpd restart 1>&2
-fi
+%service -q httpd restart
 
-%preun
+%postun
 if [ "$1" = "0" ]; then
-       %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
-       grep -v "^Include.*mod_gzip.conf" /etc/httpd/httpd.conf > \
-                /etc/httpd/httpd.conf.tmp
-        mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
-       if [ -f /var/lock/subsys/httpd ]; then
-               /etc/rc.d/init.d/httpd restart 1>&2
-       fi
+       %service -q httpd restart
 fi
 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
 %files
 %defattr(644,root,root,755)
-%doc *.txt
-%attr(755,root,root) %{_pkglibdir}/*
-%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_gzip.conf
+%doc *.txt logos/*
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf/*_mod_%{mod_name}.conf
+%attr(755,root,root) %{_pkglibdir}/*.so
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/*
+%attr(640,root,root) %ghost %{_pkglogdir}/*
This page took 0.091762 seconds and 4 git commands to generate.