diff --git a/awstats-awstats_path.patch b/awstats-awstats_path.patch new file mode 100644 index 0000000..ba708d6 --- /dev/null +++ b/awstats-awstats_path.patch @@ -0,0 +1,38 @@ +From: Chris Caron +Date: Tue, 29 Nov 2016 20:33:53 -0500 +Subject: update default path to be more compatible with Linux distro +Website: http://nuxref.com + +Make it so you don't have to pass in the -awstats=/path/to/awstats.pl +every time any script is called. + +--- + +diff -Naur awstats-7.4/tools/awstats_buildstaticpages.pl awstats-7.4.patched/tools/awstats_buildstaticpages.pl +--- awstats-7.4/tools/awstats_buildstaticpages.pl 2014-09-23 03:16:09.000000000 -0400 ++++ awstats-7.4.patched/tools/awstats_buildstaticpages.pl 2016-11-29 20:33:53.203777945 -0500 +@@ -299,6 +299,10 @@ + # Check if AWSTATS prog is found + my $AwstatsFound=0; + if (-s "$Awstats") { $AwstatsFound=1; } ++elsif (-s "/usr/share/awstats/wwwroot/cgi-bin/awstats.pl") { ++ $Awstats="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl"; ++ $AwstatsFound=1; ++} + elsif (-s "/usr/local/awstats/wwwroot/cgi-bin/awstats.pl") { + $Awstats="/usr/local/awstats/wwwroot/cgi-bin/awstats.pl"; + $AwstatsFound=1; +diff -Naur awstats-7.4/tools/awstats_updateall.pl awstats-7.4.patched/tools/awstats_updateall.pl +--- awstats-7.4/tools/awstats_updateall.pl 2014-09-23 03:16:09.000000000 -0400 ++++ awstats-7.4.patched/tools/awstats_updateall.pl 2016-11-29 20:34:58.026745752 -0500 +@@ -129,6 +129,10 @@ + # Check if AWSTATS prog is found + my $AwstatsFound=0; + if (-s "$Awstats") { $AwstatsFound=1; } ++ elsif (-s "/usr/share/awstats/wwwroot/cgi-bin/awstats.pl") { ++ $Awstats="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl"; ++ $AwstatsFound=1; ++ } + elsif (-s "/usr/local/awstats/wwwroot/cgi-bin/awstats.pl") { + $Awstats="/usr/local/awstats/wwwroot/cgi-bin/awstats.pl"; + $AwstatsFound=1; diff --git a/awstats.spec b/awstats.spec index fa63385..b47c35e 100644 --- a/awstats.spec +++ b/awstats.spec @@ -14,6 +14,8 @@ Patch0: awstats-awredir.pl-sanitize-parameters.patch Patch1: awstats-7.0-httpd-2.4.patch %endif +Patch2: awstats-awstats_path.patch + # distribution specific definitions %define use_systemd (0%{?fedora} || 0%{?rhel} >= 7) @@ -76,6 +78,7 @@ out of the ordinary configuration. %if 0%{?rhel} == 7 || 0%{?fedora} %patch1 -p 1 %endif +%patch2 -p 1 # Fix style sheets. perl -pi -e 's,/icon,/awstatsicons,g' wwwroot/css/*