Name: awstats Version: 6.4 Release: 0.1.pre Summary: Advanced Web Statistics License: GPL Group: Applications/Internet URL: http://awstats.sourceforge.net #Source0: http://dl.sf.net/awstats/awstats-6.3.tgz Source0: http://awstats.sourceforge.net/files/awstats-6.4.tgz BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: httpd Requires: perl Requires(post): perl Requires(postun): /sbin/service %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. With the default configuration, the statistics are available: http://localhost/awstats/awstats.pl %prep %setup -q # Fix style sheets. perl -pi -e 's,/icon,/awstatsicons,g' wwwroot/css/* # Fix some bad file permissions here for convenience. chmod -x tools/httpd_conf find tools/xslt -type f | xargs chmod -x # Remove \r in conf file (file written on MS Windows) perl -pi -e 's/\r//g' tools/httpd_conf %install rm -rf $RPM_BUILD_ROOT ### Create cron job %{__cat} <awstats.cron #!/bin/bash if [ -f %{_localstatedir}/log/httpd/access_log ] ; then exec perl %{_datadir}/awstats/tools/awstats_updateall.pl now \ -confdir="%{_sysconfdir}/awstats" \ -awstatsprog="%{_datadir}/awstats/wwwroot/cgi-bin/awstats.pl" >/dev/null fi exit 0 EOF ### Create folders mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{httpd/conf.d,%{name},cron.hourly} mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name} mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name} ### Install files cp -pr tools $RPM_BUILD_ROOT%{_datadir}/%{name} chmod 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/tools/*.pl chmod 644 $RPM_BUILD_ROOT%{_datadir}/%{name}/tools/httpd_conf cp -pr wwwroot $RPM_BUILD_ROOT%{_datadir}/%{name} chmod 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/wwwroot/cgi-bin/*.pl rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/wwwroot/classes/src ### We want these outside CGI path. rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/wwwroot/cgi-bin/{lang,lib,plugins} cp -pr wwwroot/cgi-bin/{lang,lib,plugins} $RPM_BUILD_ROOT%{_datadir}/%{name} rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/wwwroot/cgi-bin/awstats.model.conf ### Commit permanent changes to default configuration install -p -m 644 wwwroot/cgi-bin/awstats.model.conf \ $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/%{name}.model.conf %{__perl} -pi -e ' s|^LogFile=.*$|LogFile="%{_localstatedir}/log/httpd/access_log"|; s|^DirData=.*$|DirData="%{_localstatedir}/lib/awstats"|; s|^DirCgi=.*$|DirCgi="/awstats"|; s|^DirIcons=.*$|DirIcons="/awstatsicons"|; s|^SiteDomain=.*$|SiteDomain="localhost.localdomain"|; s|^HostAliases=.*$|HostAliases="localhost 127.0.0.1"|; s|^EnableLockForUpdate=.*$|EnableLockForUpdate=1|; s|^SaveDatabaseFilesWithPermissionsForEveryone=.*$|SaveDatabaseFilesWithPermissionsForEveryone=0|; s|^SkipHosts=.*$|SkipHosts="127.0.0.1"|; s|^Expires=.*$|Expires=3600|; ' $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/%{name}.model.conf install -p -m 644 $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/%{name}.{model,localhost.localdomain}.conf # Fix scripts %{__perl} -pi -e 's|/usr/local/awstats|%{_datadir}/awstats|g' \ $RPM_BUILD_ROOT%{_datadir}/%{name}/tools/{*.pl,httpd_conf} # Apache configuration install -p -m 644 tools/httpd_conf $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/%{name}.conf %{__perl} -pi -e 's|/usr/local|%{_datadir}|g' $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/%{name}.conf echo "# Additional Perl modules SetEnv PERL5LIB %{_datadir}/awstats/lib:%{_datadir}/awstats/plugins " >> $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/%{name}.conf # Cron job install -m 0755 awstats.cron $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/%{name} %clean rm -rf $RPM_BUILD_ROOT %post if [ $1 -eq 1 ]; then if [ ! -f %{_sysconfdir}/%{name}/%{name}.`hostname`.conf ]; then %{__cat} %{_sysconfdir}/%{name}/%{name}.model.conf | \ %{__perl} -p -e 's|^SiteDomain=.*$|SiteDomain="'`hostname`'"|; s|^HostAliases=.*$|HostAliases="REGEX[^.*'${HOSTNAME//./\\\\.}'\$]"|; ' > %{_sysconfdir}/%{name}/%{name}.`hostname`.conf || : fi fi %postun if [ $1 -ne 0 ]; then /sbin/service httpd condrestart >/dev/null 2>&1 fi %files %defattr(-,root,root,755) # Apache configuration file %config %{_sysconfdir}/httpd/conf.d/%{name}.conf %config(noreplace) %attr(755,root,root) %{_sysconfdir}/cron.hourly/%{name} %config(noreplace) %{_sysconfdir}/%{name}/ %{_localstatedir}/lib/%{name} %dir %{_datadir}/%{name} %dir %{_datadir}/%{name}/wwwroot %{_datadir}/%{name}/tools %{_datadir}/%{name}/wwwroot/cgi-bin # Different defattr to fix lots of files which should not be +x. %defattr(644,root,root,755) %doc README.TXT docs/* %{_datadir}/%{name}/lang %{_datadir}/%{name}/lib %{_datadir}/%{name}/plugins %{_datadir}/%{name}/wwwroot/classes %{_datadir}/%{name}/wwwroot/css %{_datadir}/%{name}/wwwroot/icon %{_datadir}/%{name}/wwwroot/js %changelog * Tue Feb 15 2005 Aurelien Bompard 6.4-0.1.pre - update to 6.4pre to fix a vulnerability * Thu Feb 10 2005 Aurelien Bompard 6.3-1 - version 6.3 final * Thu Jan 27 2005 Aurelien Bompard 6.3-0.1.20050122 - update to 6.3pre to fix vulnerability * Sun Nov 28 2004 Aurelien Bompard 6.2-0.fdr.1 - version 6.2 * Thu May 20 2004 Aurelien Bompard 6.1-0.fdr.6 - remove redundant substitution * Thu May 20 2004 Aurelien Bompard 6.1-0.fdr.5 - be closer to upstream default configuration - use the included apache conf file - merge changes from Michael Schwendt (bug 1608) * Wed May 19 2004 Aurelien Bompard 6.1-0.fdr.4 - fix cron job for relocated tools * Wed May 19 2004 Aurelien Bompard 6.1-0.fdr.3 - keep the tools in the tools subdirectory * Wed May 19 2004 Aurelien Bompard 6.1-0.fdr.2 - fix scripts in /usr/bin - rename configure.pl to awstats_configure.pl * Sun May 16 2004 Aurelien Bompard 6.1-0.fdr.1 - version 6.1 * Wed Mar 03 2004 Aurelien Bompard 6.0.0.fdr.2 - requires perl without version to fix build on rh9 * Tue Feb 19 2004 Aurelien Bompard 6.0-0.fdr.1 - version 6.0 * Mon Dec 22 2003 Aurelien Bompard 5.9-0.fdr.5 - solve stupid bug in %%install - only create the preconfigured config file on install, not on upgrade * Mon Dec 22 2003 Aurelien Bompard 5.9-0.fdr.4 - post scriptlet doesn't overwrite user configuration now be careful if you upgrade from 5.9-0.fdr.3 - replace _DATADIR in apache configuration in the install stage (was in the post scriptlet before) - remove 'noreplace' tag from the apache config file - various cleanups in the %%install stage - Thanks to Mickael Schwendt. * Sun Dec 07 2003 Aurelien Bompard 5.9-0.fdr.3 - %%post et %%postun now use condrestart instead of restart - only restart apache if we are upgrading - install and cp use the "-p" switch - use %%_datadir in /etc/httpd/conf.d/awstats.conf - improve cron job - don't brutally recode HTML pages - the scan is now done hourly instead of daily - *.pm files are not executable any more - tools are in %%bindir - various other improvements - many thanks to Michael Schwendt and Dag Wieers. * Sat Nov 29 2003 Aurelien Bompard 5.9-0.fdr.2 - Set the hostname in %%post (thanks to Michael Koziarski) - Improved customization in %%post * Sun Nov 16 2003 Aurelien Bompard 5.9-0.fdr.1 - fix /etc/cron.daily/awstats permissions - fix log name in conf file - port to fedora (from Mandrake)