#Module-Specific definitions %define mod_version 0.99 %define mod_name mod_ziplook %define mod_conf 87_%{mod_name}.conf %define mod_so %{mod_name}.so %define sourcename %{mod_name}-%{mod_version} %define apache_version 2.0.53 # Standard Module Definitions %define name apache2-%{mod_name} %define version %{apache_version}_%{mod_version} Summary: Mod_ziplook is a DSO module for the apache2 Web server Name: %{name} Version: %{version} Release: %mkrel 4 Group: System/Servers License: BSD URL: http://pihl.kumpu.org/ziplook/index2.html Source0: %{mod_name}2-%{mod_version}.tar.bz2 Source1: %{mod_conf}.bz2 # http://www.winimage.com/zLibDll/unzip21.zip Source2: unzip21.zip BuildRequires: unzip BuildRequires: zip BuildRequires: zlib-devel BuildRequires: perl Prereq: apache2 >= %{apache_version} Prereq: apache2-conf BuildRequires: apache2-devel >= %{apache_version}-1mdk BuildRequires: file BuildRoot: %{_tmppath}/%{name}-buildroot %description With the mod_ziplook apache2 module you can view zip-archive files directly in apache2 without extracting them to filesystem. It's useful with large documentation zip-files which are not very often hit. %prep %setup -q -n ziplook unzip %{SOURCE2} zip README.zip README # strip away annoying ^M find . -type f|xargs file|grep 'CRLF'|cut -d: -f1|xargs perl -p -i -e 's/\r//' find . -type f|xargs file|grep 'text'|cut -d: -f1|xargs perl -p -i -e 's/\r//' %build %{_sbindir}/apxs2 -c %{mod_name}.c -I. -lz %install [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} install -d %{buildroot}%{_libdir}/apache2-extramodules install -d %{buildroot}%{_sysconfdir}/httpd/conf.d install -m0755 .libs/*.so %{buildroot}%{_libdir}/apache2-extramodules/ bzcat %{SOURCE1} > %{buildroot}%{_sysconfdir}/httpd/conf.d/%{mod_conf} install -d %{buildroot}%{_var}/www/html/addon-modules ln -s ../../../..%{_docdir}/%{name}-%{version} %{buildroot}%{_var}/www/html/addon-modules/%{name}-%{version} # make the example work... (ugly, but it works...) NEW_URL=/addon-modules/%{name}-%{version}/ perl -pi -e "s|_REPLACE_ME_|$NEW_URL|g" %{buildroot}%{_sysconfdir}/httpd/conf.d/%{mod_conf} %post if [ -f %{_var}/lock/subsys/httpd ]; then %{_initrddir}/httpd restart 1>&2; fi %postun if [ "$1" = "0" ]; then if [ -f %{_var}/lock/subsys/httpd ]; then %{_initrddir}/httpd restart 1>&2 fi fi %clean [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} %files %defattr(-,root,root) %doc README* %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/httpd/conf.d/%{mod_conf} %attr(0755,root,root) %{_libdir}/apache2-extramodules/%{mod_so} %{_var}/www/html/addon-modules/* %changelog * Sun Mar 20 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_0.99-4mdk - use the %%mkrel macro * Mon Feb 28 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_0.99-3mdk - fix %%post and %%postun to prevent double restarts - fix bug #6574 * Wed Feb 16 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_0.99-2mdk - spec file cleanups, remove the ADVX-build stuff * Tue Feb 8 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.53_0.99-1mdk - rebuilt for apache 2.0.53 * Tue Sep 28 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.52_0.99-1mdk - built for apache 2.0.52 * Thu Sep 16 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.51_0.99-1mdk - built for apache 2.0.51 * Mon Jul 12 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.0.50_0.99-1mdk - built for apache 2.0.50 - remove redundant provides * Mon Jun 14 2004 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.49_0.99-1mdk - built for apache 2.0.49 * Wed Nov 05 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.48_0.99-1mdk - built for apache 2.0.48 * Thu Jul 10 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.47_0.99-1mdk - rebuilt against latest apache2, requires and buildrequires * Sat May 31 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.46_0.99-1mdk - rebuilt for apache v2.0.46 - buildprereq ADVX-build >= 9.2 * Wed May 14 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.0.45_0.99-1mdk - initial cooker contrib