X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=apache1-mod_gzip.spec;h=2014c90ed5a53f1b246dfd6b802c353572fdce0c;hb=adbb5f4cf8e88da5023dbbe4478f1e68b7e6cacc;hp=57218765efd86d6bbdb79a68ba50fa417f76fcd0;hpb=74ef495470a9ca689d2d74ec75d1cabcb6759d90;p=packages%2Fapache1-mod_gzip.git diff --git a/apache1-mod_gzip.spec b/apache1-mod_gzip.spec index 5721876..2014c90 100644 --- a/apache1-mod_gzip.spec +++ b/apache1-mod_gzip.spec @@ -1,74 +1,90 @@ %define mod_name gzip -%define apxs /usr/sbin/apxs +%define apxs /usr/sbin/apxs1 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} +Summary(pl.UTF-8): Moduł do apache: kompresuje dokumenty HTML w locie +Name: apache1-mod_%{mod_name} Version: 1.3.26.1a -Release: 1 +Release: 3 License: Apache Group: Networking/Daemons Source0: http://dl.sourceforge.net/mod-gzip/mod_gzip-%{version}.tgz -URL: http://sourceforge.net/projects/mod-gzip/ +# Source0-md5: 080ccc5d789ed5efa0c0a7625e4fa02d +Source1: %{name}.conf +Source2: %{name}.logrotate +Patch0: %{name}-name_clash.patch +Patch1: %{name}-security.patch +URL: http://www.schroepl.net/projekte/mod_gzip/ BuildRequires: %{apxs} -BuildRequires: apache(EAPI)-devel +BuildRequires: apache1-devel >= 1.3.33-2 +BuildRequires: rpmbuild(macros) >= 1.268 BuildRequires: zlib-devel -Requires(post,preun): %{apxs} -Requires(post,preun): grep -Requires(preun): fileutils -Requires: apache(EAPI) +Requires(triggerpostun): %{apxs} +Requires(triggerpostun): grep +Requires(triggerpostun): sed >= 4.0 +Requires: apache1(EAPI) +Obsoletes: apache-mod_gzip <= 1.3.26.1a 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 transparently decompress and display such documents. -%description -l pl -Modu³ do apache: kompresuje dokumenty HTML w locie. Przegl±darki w -sposób przezroczysty dekompresuj± i wy¶wietlaj± takie dokumenty. +%description -l pl.UTF-8 +Moduł do apache: kompresuje dokumenty HTML w locie. Przeglądarki w +sposób przezroczysty dekompresują i wyświetlają takie dokumenty. %prep %setup -q -n mod_%{mod_name}-%{version} +%patch0 -p1 +%patch1 -p1 %build %{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}/conf.d,/etc/logrotate.d,%{_pkglogdir}} install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir} -install docs/mod_gzip.conf.sample $RPM_BUILD_ROOT%{_sysconfdir}/mod_gzip.conf +install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/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 apache restart -%preun +%postun if [ "$1" = "0" ]; then + %service -q apache restart +fi + +%triggerpostun -- %{name} < 1.3.26.1a-1.1 +if grep -q '^Include conf\.d/\*\.conf' /etc/apache/apache.conf; then %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2 - umask 027 - 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 + sed -i -e ' + /^Include.*mod_%{mod_name}\.conf/d + ' /etc/apache/apache.conf +else + # they're still using old apache.conf + sed -i -e ' + s,^Include.*mod_%{mod_name}\.conf,Include %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf, + ' /etc/apache/apache.conf fi +%service -q apache restart %files %defattr(644,root,root,755) %doc docs/manual/english/* %lang(de) %doc docs/manual/deutsch %attr(755,root,root) %{_pkglibdir}/* -%attr(640,root,root) %config(noreplace) %verify(not size mtime md5) %{_sysconfdir}/mod_gzip.conf +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*_mod_%{mod_name}.conf +%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/* +%attr(640,root,root) %ghost %{_pkglogdir}/*