Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
network:utilities
awstats
awstats.spec
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File awstats.spec of Package awstats
# # spec file for package awstats # # Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: awstats Summary: Advanced Web Statistics License: GPL-3.0 Group: Productivity/Networking/Web/Utilities Version: 7.8 Release: 0 Url: http://awstats.sourceforge.net %if 0%{?suse_version} %if 0%{?suse_version} > 1500 BuildRequires: apache-rpm-macros %else %define apache_apxs /usr/sbin/apxs2 %endif BuildRequires: apache2-devel Recommends: apache2 %define apache_mmn %(%{_libdir}/apache2_MMN | sed 's/apache_mmn_//') # Needed perl modules for the plugins Recommends: perl-Net-DNS Recommends: perl-Net-IP Recommends: perl-Storable Recommends: perl-Geo-IP Recommends: %{name} = %{version} %endif %if 0%{?suse_version} > 1020 BuildRequires: fdupes %endif %if 0%{?fedora_version} BuildRequires: httpd-devel Requires: httpd %define apache_mmn %(rpm -q --provides httpd | grep mmn | awk -F " = " '{print $2}') %endif Requires: cron Requires: logrotate Requires: perl >= 5.00.503 Requires: perl(URI) Requires: perl(Net::DNS) Requires: perl(Net::IP) Source: awstats-%{version}.tar.gz Source4: cron.d.awstats Source5: awstats-update Source6: awstats-update.8 Source7: awstats.logrotate Source8: awstats-rpmlintrc Source9: awstats.README Patch2: %{name}-3473378-urldecode.patch # PATCH-FIX-OPENSUSE awstats-fix_css_icon_path.patch -- fix path to icons inside the css Patch3: %{name}-fix_css_icon_path.patch Patch4: %{name}-config_path.patch BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build %define apache_htdocsdir %(%{apache_apxs} -q HTDOCSDIR) %define apache_sysconfdir %(%{apache_apxs} -q SYSCONFDIR) %define apache_cgidir %(%{apache_apxs} -q CGIDIR) %if 0%{?apache_mmn} >= 20120211 %define apache_access Require all granted %else %define apache_access Order allow,deny\ Allow from all %endif %description Advanced Web Statistics (AWStats) is a powerful Web server log file analyzer (Perl script) that shows Web statistics including visitors, pages, hits, hours, search engines, keywords used to find your site, broken links, robots, and more. 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 like visits, unique vistors, authenticated users, pages, domains/countries, OS busiest times, robot visits, type of files, search engines,keywords and keyphrases used, visits duration, cluster balancing, HTTP errors and also screen size, web browser java,flash,etc support and more... Statistics can be updated from a browser or your scheduler. AWStats uses a partial information file to be able to process large log files, often and quickly. It can analyze log files from IIS (W3C log format), Apache log files (NCSA combined/XLF/ELF log format or common/CLF log format), WebStar and most of all web, proxy, wap, streaming servers (and ftp servers or mail logs). The program also supports virtual servers, plugins and a lot of features. %package doc Summary: Documentation package for awstat Group: Productivity/Networking/Web/Utilities Provides: w3af-gtk = %{version} Obsoletes: w3af-gtk < %{version} Requires: %{name} = %{version} %description doc This package contains the documentation for awstats %prep %setup -q %patch2 -p1 %patch3 -p1 %patch4 -p1 %build # if the following command fails, then apache dependencies are not met %{apache_apxs} -q datadir >/dev/null %install function create_config(){ LOGFILE=$1 LOGTYPE=$2 CONFNAME=$3 PLUGINS=$4 # Using sed rather than a diff here, to make sure all relevant # options are checked (upstream defaults have moved around in # the past)MiscTrackerUrl="/js sed -e "s|^LogFile.*|LogFile=\"$LOGFILE\"|g" \ -e 's|^LogFormat.*|LogFormat=1|g' \ -e "s|^LogType.*|LogType=$LOGTYPE|g" \ -e 's|^DNSLookup.*|DNSLookup=1|g' \ -e 's|^DirData.*|DirData="%{_var}/cache/awstats"|g' \ -e 's|^DirIcons.*|DirIcons="/awstats/icon"|g' \ -e 's|^DirLang.*|DirLang=%{_datadir}/awstats/lang"|g' \ -e 's|^ErrorMessages.*|ErrorMessages="An error occurred. Contact your Administrator"|g' \ -e 's|^HostAliases.*|HostAliases="localhost 127.0.0.1"|g' \ -e 's|^#Include\s*|Include="%{_sysconfdir}/awstats/awstats.conf.local"|g' \ -e 's|^NotPageList.*|NotPageList="css js class gif jpg jpeg png bmp ico rss xml swf"|g' \ -e 's|^MiscTrackerUrl.*|MiscTrackerUrl="/awstats/js/awstats_misc_tracker.js"|g' \ -e 's|^ShowFlagLinks.*|ShowFlagLinks="de en es fr nl"|g' \ -e 's|^StyleSheet.*|StyleSheet="/awstats/css/awstats_bw.css"|g' \ -e 's|^AllowToUpdateStatsFromBrowser.*|AllowToUpdateStatsFromBrowser=1|g' \ -e 's|^EnableLockForUpdate.*|EnableLockForUpdate=1|g' \ -e 's|^SaveDatabaseFilesWithPermissionsForEveryone.*|SaveDatabaseFilesWithPermissionsForEveryone=1|g' \ wwwroot/cgi-bin/awstats.model.conf > %{buildroot}%{_sysconfdir}/awstats/$CONFNAME # -e 's|^AllowAccessFromWebToAuthenticatedUsersOnly.*|AllowAccessFromWebToAuthenticatedUsersOnly=1|g' \ for pluginname in $PLUGINS; do sed -i "s|^#LoadPlugin\s*=\s*\"$pluginname\"|LoadPlugin=\"$pluginname\"|g" %{buildroot}%{_sysconfdir}/awstats/$CONFNAME done } # create the directories needed for installation mkdir -p %{buildroot}%{cgidir}/classes mkdir -p %{buildroot}%{_sysconfdir}/awstats mkdir -p %{buildroot}%{apache_sysconfdir}/conf.d/ mkdir -p %{buildroot}%{apache_cgidir}/classes mkdir -p %{buildroot}%{_datadir}/awstats/classes mkdir -p %{buildroot}%{_var}/cache/awstats mkdir -p %{buildroot}%{_defaultdocdir}/%{name}/examples # create some example configs create_config "%{_var}/log/apache2/awstats.log" "W" "awstats.web.conf" "tooltips ipv6 hashfiles" create_config "%{_var}/log/vsftpd.log" "F" "awstats.vsftp.conf" "tooltips ipv6" create_config "%{_var}/log/mail" "M" "awstats.smtp.conf" "tooltips ipv6" # install the files cp -r wwwroot/{icon,css,js} %{buildroot}%{_datadir}/awstats/ cp -r wwwroot/cgi-bin/{lang,lib,plugins} %{buildroot}%{_datadir}/awstats/ cp -r wwwroot/classes/*.jar %{buildroot}%{_datadir}/awstats/classes/ install -Dm755 wwwroot/cgi-bin/awstats.pl %{buildroot}%{apache_cgidir}/ # fix permissions chmod -x %{buildroot}%{_datadir}/awstats/plugins/*.pm chmod -x %{buildroot}%{_datadir}/awstats/lang/*.txt # fix wrong line encoding (dos) for file in $(find %{buildroot}%{apache_cgidir}/plugins/ -type f -name "*.pm"); do sed -i 's/\r$//' $file done for file in $(find docs/* -maxdepth 1 -type f); do sed -i 's/\r$//' $file done # install additional sources install -Dm644 %{SOURCE4} %{buildroot}%{_sysconfdir}/cron.d/suse.de-awstats install -Dm755 %{SOURCE5} %{buildroot}%{_sbindir}/awstats-update install -Dm644 %{SOURCE6} %{buildroot}%{_mandir}/man8/awstats-update.8 install -Dm644 %{SOURCE7} %{buildroot}/etc/logrotate.d/awstats cat > %{buildroot}%{apache_sysconfdir}/conf.d/awstats.conf << EOF # # The location and format of the access logfile (Common Logfile Format). # If you do not define any access logfiles within a <VirtualHost> # container, they will be logged here. Contrariwise, if you *do* # define per-<VirtualHost> access logfiles, transactions will be # logged therein and *not* in this file. In this case you have to # modify awstats yourself to point to the correct, combined log file. # <IfDefine AWSTATS> CustomLog /var/log/apache2/awstats.log combined Alias /awstats/icon/ "%{_datadir}/awstats/icon/" <Directory "%{_datadir}/awstats/icon"> Options Indexes MultiViews AllowOverride None %{apache_access} </Directory> Alias /awstats/lang/ "%{_datadir}/awstats/lang/" <Directory "%{_datadir}/awstats/lang"> AllowOverride None %{apache_access} </Directory> Alias /awstats/css/ "%{_datadir}/awstats/css/" <Directory "%{_datadir}/awstats/css/"> AllowOverride None %{apache_access} </Directory> Alias /awstatsclasses "%{_datadir}/awstats/classes" <Directory "%{_datadir}/awstats/classes"> AllowOverride None %{apache_access} </Directory> Alias /awstats/js/ "%{_datadir}/awstats/js/" <Directory "%{_datadir}/awstats/js/"> AllowOverride None %{apache_access} </Directory> </IfDefine> EOF # install docu mkdir -p %{buildroot}%{_defaultdocdir}/%{name}/examples # install the scripts in tools into the examples dir mv %{buildroot}%{_datadir}/awstats/plugins/example/* %{buildroot}%{_defaultdocdir}/%{name}/examples/ rm -rf %{buildroot}%{_datadir}/awstats/plugins/example for file in $(find tools/ -name *.pl); do sed -e 's/\r$//' $file > %{buildroot}%{_defaultdocdir}/%{name}/examples/$(basename $file) chmod +x %{buildroot}%{_defaultdocdir}/%{name}/examples/$(basename $file) done install -m644 README.md %{buildroot}%{_defaultdocdir}/%{name}/ cp -r docs %{buildroot}%{_defaultdocdir}/%{name}/ chmod -x %{buildroot}%{_defaultdocdir}/%{name}/docs/*.pdf chmod -x %{buildroot}%{_defaultdocdir}/%{name}/docs/*.html chmod -x %{buildroot}%{_defaultdocdir}/%{name}/docs/images/* chmod -x %{buildroot}%{_defaultdocdir}/%{name}/docs/*.txt install -m644 wwwroot/cgi-bin/awstats.model.conf %{buildroot}%{_defaultdocdir}/%{name}/ install -m644 %{SOURCE9} %{buildroot}%{_defaultdocdir}/%{name}/README.SUSE rm %{buildroot}%{_defaultdocdir}/%{name}/docs/COPYING.TXT %if 0%{?suse_version} > 1020 %fdupes -s %{buildroot}%{_defaultdocdir}/%{name} %endif %clean rm -rf $RPM_BUILD_ROOT %post # Former workaround for CVE-2020-29600/CVE-2020-35176, kept as best practice if [ ! -f %{_sysconfdir}/awstats/awstats.conf ]; then cat > %{_sysconfdir}/awstats/awstats.conf << EOF # The existence of this file prevents awstats from attempting to look in other # directories for its configurations, which previously led to exploits. # # You may replace this file with your own configuration, or remove it if you # really want awstats to search the directories listed in @PossibleConfigDir # in %{apache_cgidir}/awstats.pl. EOF fi %files %defattr(-,root,root) %doc %{_mandir}/man8/awstats-update.8.gz %dir %{_sysconfdir}/awstats %dir %{apache_sysconfdir}/conf.d %dir %{_datadir}/awstats %config(noreplace) %{_sysconfdir}/logrotate.d/awstats %config(noreplace) %{apache_sysconfdir}/conf.d/awstats.conf %if 0%{?suse_version} >= 1550 %dir %{_sysconfdir}/cron.d %endif %config(noreplace) %{_sysconfdir}/cron.d/suse.de-awstats %config(noreplace) %{_sysconfdir}/awstats/awstats.web.conf %config(noreplace) %{_sysconfdir}/awstats/awstats.vsftp.conf %config(noreplace) %{_sysconfdir}/awstats/awstats.smtp.conf %{_sbindir}/awstats-update %{_datadir}/awstats/* %{apache_cgidir}/* %defattr(-,wwwrun,www) %dir %{_var}/cache/awstats %files doc %defattr(0644,root,root, 0755) %doc %{_defaultdocdir}/%{name} %changelog
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor