|
|
1dfed0a |
Name: awstats
|
|
|
accaa73 |
Version: 6.95
|
|
|
560ee5f |
Release: 1%{?dist}
|
|
|
1dfed0a |
Summary: Advanced Web Statistics
|
|
|
28c9ec1 |
License: GPLv2
|
|
|
1dfed0a |
Group: Applications/Internet
|
|
|
1dfed0a |
URL: http://awstats.sourceforge.net
|
|
|
28c9ec1 |
Source0: http://dl.sf.net/awstats/awstats-%{version}.tar.gz
|
|
|
8da1b75 |
Source1: awstats.README.SELinux
|
|
|
a1ec352 |
Source2: awstats.README.Fedora
|
|
|
28c9ec1 |
|
|
|
1dfed0a |
BuildArch: noarch
|
|
|
1dfed0a |
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
|
|
28c9ec1 |
BuildRequires: checkpolicy, selinux-policy-devel
|
|
|
1dfed0a |
Requires: perl
|
|
|
28c9ec1 |
Requires(post): perl
|
|
|
28c9ec1 |
Requires(postun): /sbin/service
|
|
cvsextras |
8225e71 |
|
|
cvsextras |
8225e71 |
%description
|
|
cvsextras |
8225e71 |
Advanced Web Statistics is a powerful and featureful tool that generates
|
|
cvsextras |
8225e71 |
advanced web server graphic statistics. This server log analyzer works
|
|
cvsextras |
8225e71 |
from command line or as a CGI and shows you all information your log contains,
|
|
cvsextras |
8225e71 |
in graphical web pages. It can analyze a lot of web/wap/proxy servers like
|
|
cvsextras |
8225e71 |
Apache, IIS, Weblogic, Webstar, Squid, ... but also mail or ftp servers.
|
|
cvsextras |
8225e71 |
|
|
cvsextras |
8225e71 |
This program can measure visits, unique vistors, authenticated users, pages,
|
|
cvsextras |
8225e71 |
domains/countries, OS busiest times, robot visits, type of files, search
|
|
cvsextras |
8225e71 |
engines/keywords used, visits duration, HTTP errors and more...
|
|
cvsextras |
8225e71 |
Statistics can be updated from a browser or your scheduler.
|
|
cvsextras |
8225e71 |
The program also supports virtual servers, plugins and a lot of features.
|
|
cvsextras |
8225e71 |
|
|
cvsextras |
8225e71 |
With the default configuration, the statistics are available:
|
|
cvsextras |
8225e71 |
http://localhost/awstats/awstats.pl
|
|
cvsextras |
8225e71 |
|
|
|
28c9ec1 |
%package selinux
|
|
|
28c9ec1 |
Summary: SELinux support for Awstats
|
|
|
28c9ec1 |
Group: Applications/Internet
|
|
|
28c9ec1 |
Requires: %{name} = %{version}
|
|
|
28c9ec1 |
Requires(post): policycoreutils
|
|
|
28c9ec1 |
Requires(preun): policycoreutils
|
|
|
28c9ec1 |
Requires(postun): policycoreutils
|
|
|
28c9ec1 |
|
|
|
28c9ec1 |
%description selinux
|
|
|
28c9ec1 |
This package adds SELinux enforcement to AWstats.
|
|
|
28c9ec1 |
|
|
|
8da1b75 |
|
|
cvsextras |
8225e71 |
%prep
|
|
cvsextras |
8225e71 |
%setup -q
|
|
cvsextras |
8225e71 |
# Fix style sheets.
|
|
cvsextras |
8225e71 |
perl -pi -e 's,/icon,/awstatsicons,g' wwwroot/css/*
|
|
cvsextras |
8225e71 |
# Fix some bad file permissions here for convenience.
|
|
cvsextras |
8225e71 |
chmod -x tools/httpd_conf
|
|
cvsextras |
8225e71 |
find tools/xslt -type f | xargs chmod -x
|
|
|
480a4c5 |
# Remove \r in various files
|
|
|
480a4c5 |
perl -pi -e 's/\r//g' docs/COPYING.TXT docs/LICENSE.TXT docs/pad_awstats.xml docs/awstats_changelog.txt docs/styles.css tools/httpd_conf tools/logresolvemerge.pl tools/awstats_exportlib.pl tools/awstats_buildstaticpages.pl tools/maillogconvert.pl tools/urlaliasbuilder.pl wwwroot/cgi-bin/awredir.pl
|
|
|
8da1b75 |
# SELinux README
|
|
|
8da1b75 |
cp -a %{SOURCE1} README.SELinux
|
|
|
a1ec352 |
cp -a %{SOURCE2} README.Fedora
|
|
|
28c9ec1 |
mkdir selinux
|
|
|
8da1b75 |
|
|
cvsextras |
8225e71 |
|
|
cvsextras |
8225e71 |
%install
|
|
cvsextras |
8225e71 |
rm -rf $RPM_BUILD_ROOT
|
|
cvsextras |
8225e71 |
|
|
cvsextras |
8225e71 |
### Create cron job
|
|
|
57e2633 |
cat <<EOF >awstats.cron
|
|
cvsextras |
8225e71 |
#!/bin/bash
|
|
|
6603be0 |
exec %{_datadir}/awstats/tools/awstats_updateall.pl now \
|
|
|
6603be0 |
-configdir="%{_sysconfdir}/awstats" \
|
|
|
6603be0 |
-awstatsprog="%{_datadir}/awstats/wwwroot/cgi-bin/awstats.pl" >/dev/null
|
|
cvsextras |
8225e71 |
exit 0
|
|
cvsextras |
8225e71 |
EOF
|
|
cvsextras |
8225e71 |
|
|
cvsextras |
8225e71 |
### Create folders
|
|
cvsextras |
8225e71 |
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/{httpd/conf.d,%{name},cron.hourly}
|
|
cvsextras |
8225e71 |
mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/%{name}
|
|
cvsextras |
8225e71 |
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}
|
|
cvsextras |
8225e71 |
|
|
cvsextras |
8225e71 |
### Install files
|
|
cvsextras |
8225e71 |
cp -pr tools $RPM_BUILD_ROOT%{_datadir}/%{name}
|
|
cvsextras |
8225e71 |
chmod 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/tools/*.pl
|
|
cvsextras |
8225e71 |
chmod 644 $RPM_BUILD_ROOT%{_datadir}/%{name}/tools/httpd_conf
|
|
cvsextras |
8225e71 |
cp -pr wwwroot $RPM_BUILD_ROOT%{_datadir}/%{name}
|
|
cvsextras |
8225e71 |
chmod 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/wwwroot/cgi-bin/*.pl
|
|
cvsextras |
8225e71 |
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/wwwroot/classes/src
|
|
cvsextras |
8225e71 |
### We want these outside CGI path.
|
|
cvsextras |
8225e71 |
rm -rf $RPM_BUILD_ROOT%{_datadir}/%{name}/wwwroot/cgi-bin/{lang,lib,plugins}
|
|
cvsextras |
8225e71 |
cp -pr wwwroot/cgi-bin/{lang,lib,plugins} $RPM_BUILD_ROOT%{_datadir}/%{name}
|
|
cvsextras |
8225e71 |
|
|
cvsextras |
8225e71 |
rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/wwwroot/cgi-bin/awstats.model.conf
|
|
cvsextras |
8225e71 |
|
|
cvsextras |
8225e71 |
### Commit permanent changes to default configuration
|
|
cvsextras |
8225e71 |
install -p -m 644 wwwroot/cgi-bin/awstats.model.conf \
|
|
cvsextras |
8225e71 |
$RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/%{name}.model.conf
|
|
|
8da1b75 |
perl -pi -e '
|
|
cvsextras |
8225e71 |
s|^LogFile=.*$|LogFile="%{_localstatedir}/log/httpd/access_log"|;
|
|
cvsextras |
8225e71 |
s|^DirData=.*$|DirData="%{_localstatedir}/lib/awstats"|;
|
|
cvsextras |
8225e71 |
s|^DirCgi=.*$|DirCgi="/awstats"|;
|
|
cvsextras |
8225e71 |
s|^DirIcons=.*$|DirIcons="/awstatsicons"|;
|
|
cvsextras |
8225e71 |
s|^SiteDomain=.*$|SiteDomain="localhost.localdomain"|;
|
|
cvsextras |
8225e71 |
s|^HostAliases=.*$|HostAliases="localhost 127.0.0.1"|;
|
|
cvsextras |
8225e71 |
s|^EnableLockForUpdate=.*$|EnableLockForUpdate=1|;
|
|
cvsextras |
8225e71 |
s|^SaveDatabaseFilesWithPermissionsForEveryone=.*$|SaveDatabaseFilesWithPermissionsForEveryone=0|;
|
|
cvsextras |
8225e71 |
s|^SkipHosts=.*$|SkipHosts="127.0.0.1"|;
|
|
cvsextras |
8225e71 |
s|^Expires=.*$|Expires=3600|;
|
|
|
8da1b75 |
' $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/%{name}.model.conf
|
|
|
1dfed0a |
install -p -m 644 $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/%{name}.{model,localhost.localdomain}.conf
|
|
cvsextras |
8225e71 |
|
|
cvsextras |
8225e71 |
# Fix scripts
|
|
|
8da1b75 |
perl -pi -e 's|/usr/local/awstats|%{_datadir}/awstats|g' \
|
|
cvsextras |
8225e71 |
$RPM_BUILD_ROOT%{_datadir}/%{name}/tools/{*.pl,httpd_conf}
|
|
cvsextras |
8225e71 |
|
|
|
5838715 |
# Fix encoding of changelog
|
|
|
5838715 |
iconv -f iso-8859-1 -t utf-8 < docs/awstats_changelog.txt > docs/awstats_changelog.txt.utf8
|
|
|
5838715 |
mv docs/awstats_changelog.txt.utf8 docs/awstats_changelog.txt
|
|
|
5838715 |
|
|
cvsextras |
8225e71 |
# Apache configuration
|
|
cvsextras |
8225e71 |
install -p -m 644 tools/httpd_conf $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/%{name}.conf
|
|
|
8da1b75 |
perl -pi -e 's|/usr/local|%{_datadir}|g;s|Allow from all|Allow from 127.0.0.1|g' \
|
|
|
8da1b75 |
$RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/%{name}.conf
|
|
cvsextras |
8225e71 |
echo "# Additional Perl modules
|
|
cvsextras |
8225e71 |
<IfModule mod_env.c>
|
|
cvsextras |
8225e71 |
SetEnv PERL5LIB %{_datadir}/awstats/lib:%{_datadir}/awstats/plugins
|
|
cvsextras |
8225e71 |
</IfModule>" >> $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/%{name}.conf
|
|
cvsextras |
8225e71 |
|
|
cvsextras |
8225e71 |
# Cron job
|
|
cvsextras |
8225e71 |
install -m 0755 awstats.cron $RPM_BUILD_ROOT%{_sysconfdir}/cron.hourly/%{name}
|
|
cvsextras |
8225e71 |
|
|
|
28c9ec1 |
# SELinux support
|
|
|
28c9ec1 |
cd selinux
|
|
|
28c9ec1 |
echo 'policy_module(%{name}, 1.0)' > %{name}.te
|
|
|
28c9ec1 |
echo '%{_datadir}/awstats/wwwroot/cgi-bin(/.*)? system_u:object_r:httpd_sys_script_exec_t:s0' > %{name}.fc
|
|
|
28c9ec1 |
echo '%{_localstatedir}/lib/awstats(/.*)? system_u:object_r:httpd_sys_script_rw_t:s0' >> %{name}.fc
|
|
|
28c9ec1 |
touch %{name}.if
|
|
|
28c9ec1 |
make -f %{_datadir}/selinux/devel/Makefile
|
|
|
28c9ec1 |
install -p -m 644 -D %{name}.pp $RPM_BUILD_ROOT%{_datadir}/selinux/packages/%{name}/%{name}.pp
|
|
|
28c9ec1 |
|
|
cvsextras |
8225e71 |
|
|
cvsextras |
8225e71 |
%clean
|
|
cvsextras |
8225e71 |
rm -rf $RPM_BUILD_ROOT
|
|
cvsextras |
8225e71 |
|
|
|
441792c |
|
|
cvsextras |
8225e71 |
%post
|
|
cvsextras |
8225e71 |
if [ $1 -eq 1 ]; then
|
|
cvsextras |
8225e71 |
if [ ! -f %{_sysconfdir}/%{name}/%{name}.`hostname`.conf ]; then
|
|
cvsextras |
8225e71 |
%{__cat} %{_sysconfdir}/%{name}/%{name}.model.conf | \
|
|
cvsextras |
8225e71 |
%{__perl} -p -e 's|^SiteDomain=.*$|SiteDomain="'`hostname`'"|;
|
|
cvsextras |
8225e71 |
s|^HostAliases=.*$|HostAliases="REGEX[^.*'${HOSTNAME//./\\\\.}'\$]"|;
|
|
cvsextras |
8225e71 |
' > %{_sysconfdir}/%{name}/%{name}.`hostname`.conf || :
|
|
cvsextras |
8225e71 |
fi
|
|
cvsextras |
8225e71 |
fi
|
|
|
441792c |
|
|
cvsextras |
8225e71 |
%postun
|
|
cvsextras |
8225e71 |
if [ $1 -ne 0 ]; then
|
|
cvsextras |
8225e71 |
/sbin/service httpd condrestart >/dev/null 2>&1
|
|
cvsextras |
8225e71 |
fi
|
|
|
28c9ec1 |
|
|
|
28c9ec1 |
%post selinux
|
|
|
28c9ec1 |
if [ "$1" -le "1" ]; then # Fist install
|
|
|
28c9ec1 |
semodule -i %{_datadir}/selinux/packages/%{name}/%{name}.pp 2>/dev/null || :
|
|
|
28c9ec1 |
fixfiles -R %{name} restore
|
|
|
441792c |
fi
|
|
cvsextras |
8225e71 |
|
|
|
28c9ec1 |
%preun selinux
|
|
|
28c9ec1 |
if [ "$1" -lt "1" ]; then # Final removal
|
|
|
28c9ec1 |
semodule -r %{name} 2>/dev/null || :
|
|
|
28c9ec1 |
fixfiles -R %{name} restore
|
|
|
28c9ec1 |
fi
|
|
|
28c9ec1 |
|
|
|
28c9ec1 |
%postun selinux
|
|
|
28c9ec1 |
if [ "$1" -ge "1" ]; then # Upgrade
|
|
|
28c9ec1 |
# Replaces the module if it is already loaded
|
|
|
28c9ec1 |
semodule -i %{_datadir}/selinux/packages/%{name}/%{name}.pp 2>/dev/null || :
|
|
|
28c9ec1 |
fi
|
|
cvsextras |
8225e71 |
|
|
|
8da1b75 |
|
|
cvsextras |
8225e71 |
%files
|
|
cvsextras |
8225e71 |
%defattr(-,root,root,755)
|
|
cvsextras |
8225e71 |
# Apache configuration file
|
|
|
6603be0 |
%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
|
|
cvsextras |
8225e71 |
%config(noreplace) %attr(755,root,root) %{_sysconfdir}/cron.hourly/%{name}
|
|
cvsextras |
8225e71 |
%config(noreplace) %{_sysconfdir}/%{name}/
|
|
cvsextras |
8225e71 |
%{_localstatedir}/lib/%{name}
|
|
cvsextras |
8225e71 |
%dir %{_datadir}/%{name}
|
|
cvsextras |
8225e71 |
%dir %{_datadir}/%{name}/wwwroot
|
|
cvsextras |
8225e71 |
%{_datadir}/%{name}/tools
|
|
cvsextras |
8225e71 |
%{_datadir}/%{name}/wwwroot/cgi-bin
|
|
cvsextras |
8225e71 |
# Different defattr to fix lots of files which should not be +x.
|
|
cvsextras |
8225e71 |
%defattr(644,root,root,755)
|
|
|
a1ec352 |
%doc README.TXT README.Fedora docs/*
|
|
cvsextras |
8225e71 |
%{_datadir}/%{name}/lang
|
|
cvsextras |
8225e71 |
%{_datadir}/%{name}/lib
|
|
cvsextras |
8225e71 |
%{_datadir}/%{name}/plugins
|
|
cvsextras |
8225e71 |
%{_datadir}/%{name}/wwwroot/classes
|
|
cvsextras |
8225e71 |
%{_datadir}/%{name}/wwwroot/css
|
|
cvsextras |
8225e71 |
%{_datadir}/%{name}/wwwroot/icon
|
|
cvsextras |
8225e71 |
%{_datadir}/%{name}/wwwroot/js
|
|
cvsextras |
8225e71 |
|
|
|
28c9ec1 |
%files selinux
|
|
|
28c9ec1 |
%defattr(644, root, root, 755)
|
|
|
28c9ec1 |
%doc README.SELinux
|
|
|
28c9ec1 |
%{_datadir}/selinux/packages/%{name}/%{name}.pp
|
|
|
8da1b75 |
|
|
|
aa09102 |
|
|
|
28c9ec1 |
%changelog
|
|
|
accaa73 |
* Thu Nov 26 2009 Tim Jackson <rpm@timj.co.uk> - 6.95-1
|
|
|
accaa73 |
- Update to version 6.95 (security fix)
|
|
|
accaa73 |
|
|
|
560ee5f |
* Sat May 30 2009 Tim Jackson <rpm@timj.co.uk> 6.9-1
|
|
|
560ee5f |
- Update to 6.9
|
|
|
560ee5f |
|
|
|
0dd9407 |
* Mon Dec 15 2008 Tim Jackson <rpm@timj.co.uk> 6.7-5
|
|
|
0dd9407 |
- remove extraneous file awstats.orig from package
|
|
|
0dd9407 |
|
|
|
480a4c5 |
* Sat Dec 06 2008 Tim Jackson <rpm@timj.co.uk> 6.7-4
|
|
|
480a4c5 |
- Use Debian's patch for CVE-2008-3714 (#474396)
|
|
|
a1ec352 |
- Add README.Fedora file pointing people towards the -selinux subpackage
|
|
|
a1ec352 |
|
|
|
9fcad73 |
* Sat Aug 23 2008 Tim Jackson <rpm@timj.co.uk> 6.7-3
|
|
|
9fcad73 |
- Fix CVE-2008-3714: cross-site scripting security issue (#459605)
|
|
|
9fcad73 |
|
|
|
6603be0 |
* Sun Mar 16 2008 Tim Jackson <rpm@timj.co.uk> 6.7-2
|
|
|
6603be0 |
- awstats does not actually require httpd (#406901)
|
|
|
6603be0 |
- Fix cron script to be compatible with SELinux (#435101)
|
|
|
6603be0 |
- Mark httpd config as noreplace
|
|
|
5838715 |
- Fix encoding of awstats_changelog.txt
|
|
|
5838715 |
- Remove some stray upstream temp files
|
|
|
5838715 |
- Fix EOL encoding of documentation to be consistent
|
|
|
6603be0 |
|
|
|
28c9ec1 |
* Tue Sep 18 2007 Tim Jackson <rpm@timj.co.uk> 6.7-1
|
|
|
28c9ec1 |
- initial import to EPEL-5, from Fedora
|