%define httpdconf_path /etc/httpd %define awstats_user awstats %define awstats_nuser 65036 %define awstats_group apache %define awstats_home /var/lib/awstats Name: awstats Version: 7.4 Release: 1mamba Summary: AWStats is a free log analyzer Group: Graphical Desktop/Applications/Internet Vendor: openmamba Distribution: openmamba Packager: Tiziana Ferro URL: http://awstats.sourceforge.net/ Source0: http://awstats.sourceforge.net/files/awstats-%{version}.tar.gz Source1: %{name}.crontab Source2: %{name}-httpd.conf Source3: %{name}.conf Patch0: %{name}-6.9-awstats_model_conf.patch Patch1: %{name}-created_dir_mode.patch License: GPL BuildArch: noarch #Requires: perl-Geo-IP #Requires: perl-Time-HiRes #Requires: perl-Storable BuildRoot: %{_tmppath}/%{name}-%{version}-root Requires(pre): apache %description AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically. This log analyzer works as a CGI or from command line and shows you all possible information your log contains, in few graphical web pages. %prep %setup -q #%patch0 -p1 #%patch1 -p1 %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" install -d %{buildroot}%{_bindir} install -d %{buildroot}%{_datadir}/%{name} install -d %{buildroot}%{_sysconfdir}/{%{name},cron.daily} install -d %{buildroot}%{awstats_home} install -d %{buildroot}%{httpdconf_path} install -m755 tools/awstats_* %{buildroot}%{_bindir} install -m755 tools/{logresolvemerge,maillogconvert,urlaliasbuilder}.pl \ %{buildroot}%{_bindir} cp -r wwwroot %{buildroot}%{_datadir}/awstats mv %{buildroot}%{_datadir}/awstats/wwwroot/cgi-bin/awstats.model.conf \ %{buildroot}%{_sysconfdir}/%{name} mv %{buildroot}%{_datadir}/awstats/wwwroot/cgi-bin/{lang,lib,plugins} \ %{buildroot}%{_datadir}/%{name} install %{SOURCE1} %{buildroot}/etc/cron.daily/awstats install %{SOURCE2} %{buildroot}%{httpdconf_path}/%{name}.conf install %{SOURCE3} %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf ln -s %{_datadir}/awstats/wwwroot/cgi-bin/awstats.pl %{buildroot}%{_bindir} %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %pre /usr/sbin/useradd -g %{awstats_group} -c 'WWW server logs analyzer' \ -d %{awstats_home} -s '/dev/null' -u %{awstats_nuser} %{awstats_user} \ 2>/dev/null /usr/sbin/usermod -g %{awstats_group} %{awstats_user} exit 0 %post if [ $1 -eq 1 ]; then grep -q 'Include /etc/httpd/awstats.conf' %{httpdconf_path}/httpd.conf && \ sed -i 's,.*\(Include /etc/httpd/awstats.conf*\),\1,' \ %{httpdconf_path}/httpd.conf || \ cat >> %{httpdconf_path}/httpd.conf << _EOF # # AWStats (WEB Log Analyzer) alias and permissions # Include %{httpdconf_path}/%{name}.conf _EOF [ -e /var/lock/subsys/httpd ] && service httpd reload fi exit 0 %preun if [ $1 = 0 ]; then if [ -r %{httpdconf_path}/httpd.conf ]; then sed -i 's,\(^Include /etc/httpd/awstats.conf*\),#\1,' \ %{httpdconf_path}/httpd.conf [ -e /var/lock/subsys/httpd ] && service httpd reload fi /usr/sbin/userdel %{awstats_user} fi exit 0 %files %defattr(-,root,root) %{_bindir}/* %dir %{_sysconfdir}/awstats %config(noreplace) %{_sysconfdir}/%{name}/*.conf %attr(640,root,root) %config(noreplace) %{_sysconfdir}/httpd/%{name}.conf %attr(640,root,root) %{_sysconfdir}/cron.daily/awstats %dir %{_datadir}/%{name} %{_datadir}/%{name}/lang %{_datadir}/%{name}/lib %{_datadir}/%{name}/plugins %dir %{_datadir}/%{name}/wwwroot %dir %{_datadir}/%{name}/wwwroot/cgi-bin %attr(755,root,root) %{_datadir}/%{name}/wwwroot/cgi-bin/* %{_datadir}/%{name}/wwwroot/classes %{_datadir}/%{name}/wwwroot/css %{_datadir}/%{name}/wwwroot/icon %{_datadir}/%{name}/wwwroot/js %attr(751,%{awstats_user},%{awstats_group}) %{awstats_home} %doc docs/* tools/webmin tools/xslt %changelog * Thu Aug 13 2015 Automatic Build System 7.4-1mamba - automatic version update by autodist * Wed Mar 12 2014 Automatic Build System 7.3-1mamba - automatic update by autodist * Sun Jul 14 2013 Automatic Build System 7.2-1mamba - automatic update by autodist * Wed Mar 13 2013 Automatic Build System 7.1.1-1mamba - automatic version update by autodist * Mon Dec 24 2012 Automatic Build System 7.1-1mamba - automatic version update by autodist * Sun Dec 19 2010 Automatic Build System 7.0-1mamba - automatic update by autodist * Mon Nov 23 2009 Automatic Build System 6.95-1mamba - automatic update by autodist * Thu Jul 16 2009 Automatic Build System 6.9-1mamba - automatic update by autodist * Fri Dec 12 2008 Silvan Calarco 6.8-1mamba - automatic update by autodist * Mon Jun 23 2008 Tiziana Ferro 6.7-2mamba - update mantainer * Thu Jun 12 2008 Tiziana Ferro 6.7-1mamba - update to 6.7 * Fri May 19 2006 Davide Madrisan 6.6-1qilnx - update to version 6.6 by autospec - this release fixes the security flaw CVE-2006-2237 (qibug#171) * Tue Jan 24 2006 Davide Madrisan 6.5-2qilnx - apache integration - added %%post and %%postun * Mon Jan 16 2006 Alessandro Ramazzina 6.5-1qilnx - package created by autospec