%define name awstats %define version 6.4 %define release 4mdk Name: %{name} Version: %{version} Release: %{release} Summary: Advanced Web Statistics License: GPL Group: Networking/WWW URL: http://awstats.sourceforge.net Source0: http://prdownloads.sourceforge.net/awstats/%{name}-%{version}.tar.bz2 Patch0: awstats-6.4-conf.patch.bz2 BuildArch: noarch Requires: apache >= 2.0.54 BuildRequires: apache-base >= 2.0.54-5mdk BuildRoot: %{_tmppath}/%{name}-%{version} %description Advanced Web Statistics is a powerful and featureful tool that generates advanced web server graphic statistics. This server log analyzer works from command line or as a CGI and shows you all information your log contains, in graphical web pages. It can analyze a lot of web/wap/proxy servers like Apache, IIS, Weblogic, Webstar, Squid, ... but also mail or ftp servers. This program can measure visits, unique vistors, authenticated users, pages, domains/countries, OS busiest times, robot visits, type of files, search engines/keywords used, visits duration, HTTP errors and more... Statistics can be updated from a browser or your scheduler. The program also supports virtual servers, plugins and a lot of features. %prep %setup -q %patch -b .defaultconf # fix perms find . -type f -exec chmod 644 {} \; find . -name *.pl -exec chmod 755 {} \; rm -f wwwroot/cgi-bin/plugins/.#geoip_city_maxmind.pm.1.8 # fix encoding find . -type f | perl -ne 'chomp; print "$_\n" if -T $_' | xargs perl -pi -e 'tr/\r//d' %build %install rm -rf %{buildroot} # apache configuration install -d -m 755 %{buildroot}%{_sysconfdir}/httpd/conf/webapps.d cat > %{buildroot}%{_sysconfdir}/httpd/conf/webapps.d/%{name}.conf <<EOF # Awstats configuration Alias /awstats %{_var}/www/%{name} <Directory %{_var}/www/%{name}> Allow from all </Directory> SetEnv PERL5LIB %{_datadir}/%{name}/lib:%{_datadir}/%{name}/plugins EOF # cron task install -d -m 755 %{buildroot}%{_sysconfdir}/cron.daily cat > %{buildroot}%{_sysconfdir}/cron.daily/%{name} <<EOF #!/bin/sh %{_var}/www/cgi-bin/awstats.pl -config=awstats.conf -update > /dev/null EOF chmod 755 %{buildroot}%{_sysconfdir}/cron.daily/%{name} install -d -m 755 %{buildroot}%{_sysconfdir}/%{name} install -d -m 755 %{buildroot}%{_var}/www/cgi-bin install -d -m 755 %{buildroot}%{_var}/www/%{name} install -d -m 755 %{buildroot}%{_datadir}/%{name} install -d -m 755 %{buildroot}%{_localstatedir}/%{name} install -m 755 wwwroot/cgi-bin/awstats.pl %{buildroot}%{_var}/www/cgi-bin install -m 644 wwwroot/cgi-bin/awstats.model.conf %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf cp -r tools %{buildroot}%{_datadir}/%{name} cp -r wwwroot/cgi-bin/lang %{buildroot}%{_datadir}/%{name} cp -r wwwroot/cgi-bin/lib %{buildroot}%{_datadir}/%{name} cp -r wwwroot/cgi-bin/plugins %{buildroot}%{_datadir}/%{name} cp -r wwwroot/icon %{buildroot}%{_var}/www/%{name} cp -r wwwroot/css %{buildroot}%{_var}/www/%{name} cp -r wwwroot/js %{buildroot}%{_var}/www/%{name} %clean rm -rf %{buildroot} %post if [ $1 -eq 1 ]; then perl -pi -e 's/SiteDomain=""/SiteDomain="'`hostname`'"/' %{_sysconfdir}/%{name}/%{name}.conf fi %_post_webapp %postun %_postun_webapp %files %defattr(-,root,root) %doc README.TXT docs/* %config(noreplace) %{_sysconfdir}/httpd/conf/webapps.d/%{name}.conf %config(noreplace) %{_sysconfdir}/%{name} %{_sysconfdir}/cron.daily/%{name} %{_datadir}/%{name} %{_localstatedir}/%{name} %{_var}/www/cgi-bin/%{name}.pl %{_var}/www/%{name} %changelog * Mon Jul 04 2005 Guillaume Rousse <guillomovitch@mandriva.org> 6.4-4mdk - better fix encoding - use new apache rpm macros - fix cron task perms * Wed Jun 22 2005 Guillaume Rousse <guillomovitch@mandriva.org> 6.4-3mdk - new apache setup * Sat Mar 19 2005 Guillaume Rousse <guillomovitch@mandrake.org> 6.4-2mdk - incluse missing web files (fix bug #14788) - rediff configuration patch - fix files encoding - fix cron task shellbang * Sun Mar 06 2005 Frederic Crozat <fcrozat@mandrakesoft.com> 6.4-1mdk - Release 6.4 - SECURITY FIX - UPGRADE IS HIGHLY RECOMMANDED * Fri Feb 18 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 6.3-2mdk - spec file cleanups, remove the ADVX-build stuff * Thu Jan 27 2005 Guillaume Rousse <guillomovitch@mandrake.org> 6.3-1mdk - new version (fix remote vulnerability) - herein document whenever possible - no more order for apache configuration - reload apache instead of restart it - don't tag executables in %{_sysconfdir} as executables * Tue Dec 21 2004 Erwan Velu <velu@seanodes.com> 6.2-1mdk - 6.2 * Tue Jul 13 2004 Guillaume Rousse <guillomovitch@mandrake.org> 6.1-1mdk - new version - apache config file in %{_sysconfdir}/httpd/webapps.d * Fri Jul 02 2004 Guillaume Rousse <guillomovitch@mandrake.org> 6.0-3mdk - fix perms * Fri Jul 02 2004 Guillaume Rousse <guillomovitch@mandrake.org> 6.0-2mdk - remove useless provide * Thu Feb 26 2004 Frederic Crozat <fcrozat@mandrakesoft.com> 6.0-1mdk - Release 6.0 - Regenerate patch0 - Ensure cron file is executable * Fri Dec 12 2003 Guillaume Rousse <guillomovitch@mandrake.org> 5.9-2mdk - fixed conf file (fix bug #6497) * Tue Sep 30 2003 Guillaume Rousse <guillomovitch@linux-mandrake.com> 5.9-1mdk - 5.9 - ADVX macros * Thu Jul 17 2003 Guillaume Rousse <guillomovitch@linux-mandrake.com> 5.6-2mdk - fixes from Frederic Crozat <fcrozat@mandrakesoft.com> - cron task - fixed configuration * Sun Jul 06 2003 Guillaume Rousse <guillomovitch@linux-mandrake.com> 5.6-1mdk - 5.6 * Sat Jun 21 2003 Guillaume Rousse <guillomovitch@linux-mandrake.com> 5.5-1mdk - 5.5 - apache 2 setup * Tue Mar 18 2003 Guillaume Rousse <g.rousse@linux-mandrake.com> 5.4-1mdk - 5.4 - configuration patch merged upstream - post-install automatic configuration * Mon Feb 03 2003 Guillaume Rousse <g.rousse@linux-mandrake.com> 5.3-1mdk - first mdk release