Update to 7.5. While here, completely rewrite the Makefile. Use sed

instead of hard patches to minimize maintainership, and drastically
simplify the installation process. Add some OPTIONS to handle
dependencies on country lookups.

Previously, the path to the icons was being manually changed from
".../icon" to ".../icons". With this update, the port now installs
into the default location (.../icon). The awstatsicons alias will
need to be manually updated for existing installations; this is
explained in UPDATING.

Also, I am taking this port from the previous maintainer. It has
been over two years since he responded to a PR, and this is the
third in a row that has had no response. Under section 5.5 of the
PHB, I am considering this port to be abandoned. I'd like to thank
Alex for all the time that he did spend maintaining this port.

PR:		210821
Approved by:	maintainer timeout (2 weeks)
This commit is contained in:
Adam Weinberger 2016-07-18 15:26:42 +00:00
parent db77b6b018
commit 11aac59b28
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=418707
9 changed files with 673 additions and 775 deletions

View file

@ -6,6 +6,16 @@ You should get into the habit of checking this file for changes each time
you update your ports collection, before attempting any port upgrades.
20160718:
AFFECTS: users of www/awstats
AUTHOR: adamw@FreeBSD.org
The directory containing icons has changed from ".../icons" to ".../icon".
awstats has, in its suggested configuration file, contained an alias
from /awstatsicons. After applying the awstats-7.5 update, you must
update that alias to point to /usr/local/www/awstats/icon (just remove
the "s" at the end).
20160708:
AFFECTS: users of sysutils/screen
AUTHOR: cy@FreeBSD.org

View file

@ -2,12 +2,12 @@
# $FreeBSD$
PORTNAME= awstats
PORTVERSION= 7.4
PORTVERSION= 7.5
PORTEPOCH= 1
CATEGORIES= www
MASTER_SITES= SF/${PORTNAME}/AWStats/${PORTVERSION}
MAINTAINER= samm@os2.kiev.ua
MAINTAINER= adamw@FreeBSD.org
COMMENT= Free real-time logfile analyzer to get advanced web statistics
LICENSE= GPLv3
@ -19,78 +19,62 @@ USES= cpe dos2unix perl5 shebangfix
CPE_VENDOR= laurent_destailleur
SHEBANG_FILES= tools/*.pl wwwroot/cgi-bin/*.pl wwwroot/cgi-bin/plugins/*.pm
DOS2UNIX_GLOB= *.xml *.pm
NO_BUILD= yes
NO_ARCH= yes
USE_PERL5= run
DOS2UNIX_GLOB= tools/*.pl \
wwwroot/cgi-bin/awstats.model.conf \
wwwroot/cgi-bin/*.pl \
wwwroot/cgi-bin/lang/tooltips_f/*.txt \
wwwroot/cgi-bin/lang/tooltips_m/*.txt \
wwwroot/cgi-bin/lang/tooltips_w/*.txt \
wwwroot/cgi-bin/lang/*.txt \
wwwroot/cgi-bin/lib/* \
wwwroot/cgi-bin/plugins/*.pm \
wwwroot/cgi-bin/plugins/example/* \
wwwroot/css/* \
wwwroot/js/*
SUB_FILES= pkg-message
OPTIONS_DEFINE= DOCS IPV6
OPTIONS_RADIO= GEO
OPTIONS_RADIO_GEO= GEOIP GEOIPFREE
GEO_DESC= Identify country of source IPs
GEOIP_DESC= Country lookups via Geo::IP
GEOIPFREE_DESC= Country lookups via Geo::IPfree
GEOIP_RUN_DEPENDS= p5-Geo-IP>=0:net/p5-Geo-IP
GEOIPFREE_RUN_DEPENDS= p5-Geo-IPfree>=0:net/p5-Geo-IPfree
IPV6_RUN_DEPENDS= p5-Net-IP>=0:net-mgmt/p5-Net-IP \
p5-Net-DNS>=0:dns/p5-Net-DNS
pre-patch:
# This file is so messed up, not even dos2unix can fix it
@fixme="${WRKSRC}/wwwroot/cgi-bin/plugins/export_to_csv.pm" && \
${TR} '\r' '\n' < $$fixme > $$fixme.new && \
${MV} $$fixme.new $$fixme
post-patch:
@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \
${WRKSRC}/tools/awstats_buildstaticpages.pl \
${WRKSRC}/tools/awstats_configure.pl \
${WRKSRC}/tools/awstats_updateall.pl \
${WRKSRC}/wwwroot/cgi-bin/awstats.pl
@${REINPLACE_CMD} -E -e 's|/usr/local/etc/awstats|${ETCDIR}|' \
-e 's|/etc/awstats/(awstats.model.conf)|${ETCDIR}/\1|' \
-e 's,/usr/(local|share)/awstats/wwwroot,${WWWDIR},' \
${WRKSRC}/tools/*.pl \
${WRKSRC}/tools/httpd_conf \
${WRKSRC}/tools/nginx/* \
${WRKSRC}/wwwroot/cgi-bin/*.pl \
${WRKSRC}/wwwroot/cgi-bin/*.conf
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \
-e 's|%%WWWDIR%%|${WWWDIR}|' \
-e 's|AWSTATS_PATH/wwwroot|AWSTATS_PATH|' \
${WRKSRC}/tools/awstats_configure.pl
pre-install:
.for f in dolibarr httpd_conf nginx webmin
@${MV} ${WRKSRC}/tools/$f ${WRKSRC}/docs
.endfor
do-install:
@${MKDIR} ${STAGEDIR}${WWWDIR}/tools/webmin
(cd ${WRKSRC}/tools && ${INSTALL_SCRIPT} awstats_buildstaticpages.pl \
awstats_configure.pl awstats_exportlib.pl awstats_updateall.pl \
logresolvemerge.pl maillogconvert.pl urlaliasbuilder.pl \
${STAGEDIR}${WWWDIR}/tools)
(cd ${WRKSRC}/tools && ${COPYTREE_SHARE} xslt ${STAGEDIR}${WWWDIR}/tools)
@${MKDIR} ${STAGEDIR}${WWWDIR}/cgi-bin
(cd ${WRKSRC}/wwwroot/cgi-bin && ${INSTALL_SCRIPT} awredir.pl awstats.pl \
awstats.model.conf ${STAGEDIR}${WWWDIR}/cgi-bin)
@${MKDIR} ${STAGEDIR}${WWWDIR}/cgi-bin/lang/tooltips_f
${INSTALL_DATA} ${WRKSRC}/wwwroot/cgi-bin/lang/tooltips_f/*.txt \
${STAGEDIR}${WWWDIR}/cgi-bin/lang/tooltips_f
@${MKDIR} ${STAGEDIR}${WWWDIR}/cgi-bin/lang/tooltips_m
${INSTALL_DATA} ${WRKSRC}/wwwroot/cgi-bin/lang/tooltips_m/*.txt \
${STAGEDIR}${WWWDIR}/cgi-bin/lang/tooltips_m
@${MKDIR} ${STAGEDIR}${WWWDIR}/cgi-bin/lang/tooltips_w
${INSTALL_DATA} ${WRKSRC}/wwwroot/cgi-bin/lang/tooltips_w/*.txt \
${STAGEDIR}${WWWDIR}/cgi-bin/lang/tooltips_w
${INSTALL_DATA} ${WRKSRC}/wwwroot/cgi-bin/lang/*.txt \
${STAGEDIR}${WWWDIR}/cgi-bin/lang
(cd ${WRKSRC}/wwwroot/cgi-bin && ${COPYTREE_SHARE} lib \
${STAGEDIR}${WWWDIR}/cgi-bin)
@${MKDIR} ${STAGEDIR}${WWWDIR}/cgi-bin/plugins
${INSTALL_DATA} ${WRKSRC}/wwwroot/cgi-bin/plugins/*.pm \
${STAGEDIR}${WWWDIR}/cgi-bin/plugins
(cd ${WRKSRC}/wwwroot/cgi-bin/plugins && ${COPYTREE_SHARE} example \
${STAGEDIR}${WWWDIR}/cgi-bin/plugins)
@${MKDIR} ${STAGEDIR}${WWWDIR}/classes
${INSTALL_DATA} ${WRKSRC}/wwwroot/classes/awgraphapplet.jar \
${STAGEDIR}${WWWDIR}/classes
(cd ${WRKSRC}/wwwroot && ${COPYTREE_SHARE} "js css" ${STAGEDIR}${WWWDIR})
(cd ${WRKSRC}/wwwroot/icon && ${COPYTREE_SHARE} "browser clock cpu \
flags mime os other" ${STAGEDIR}${WWWDIR}/icons)
@${MKDIR} ${STAGEDIR}${WWWDIR}
(cd ${WRKSRC} && ${COPYTREE_SHARE} tools ${STAGEDIR}${WWWDIR})
(cd ${WRKSRC}/wwwroot && ${COPYTREE_SHARE} "cgi-bin css icon js" ${STAGEDIR}${WWWDIR})
@${ECHO_CMD} ""
@${ECHO_CMD} "* Use ${WWWDIR}/tools/awstats_configure.pl to setup your hosts."
@${ECHO_CMD} ""
@${MKDIR} ${STAGEDIR}${WWWDIR}/classes
${INSTALL_DATA} ${WRKSRC}/wwwroot/classes/awgraphapplet.jar ${STAGEDIR}${WWWDIR}/classes
do-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
(cd ${WRKSRC}/docs && ${COPYTREE_SHARE} images ${STAGEDIR}${DOCSDIR})
${INSTALL_DATA} ${WRKSRC}/docs/*.* ${STAGEDIR}${DOCSDIR}
(cd ${WRKSRC}/docs && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR})
.include <bsd.port.mk>

View file

@ -1,2 +1,3 @@
SHA256 (awstats-7.4.tar.gz) = 43abfe7341c2be64f55bb89557347475640ca7ba4473ff30412a3d44358dab55
SIZE (awstats-7.4.tar.gz) = 2936102
TIMESTAMP = 1467647076
SHA256 (awstats-7.5.tar.gz) = 83c34bdeab9c277c14bea348c2d320f4a1e808388264139821c6bd6dfd1394f8
SIZE (awstats-7.5.tar.gz) = 2936644

View file

@ -1,13 +0,0 @@
--- tools/awstats_buildstaticpages.pl.orig 2015-07-21 07:55:55 UTC
+++ tools/awstats_buildstaticpages.pl
@@ -299,8 +299,8 @@
# Check if AWSTATS prog is found
my $AwstatsFound=0;
if (-s "$Awstats") { $AwstatsFound=1; }
-elsif (-s "/usr/local/awstats/wwwroot/cgi-bin/awstats.pl") {
- $Awstats="/usr/local/awstats/wwwroot/cgi-bin/awstats.pl";
+elsif (-s "%%PREFIX%%/www/awstats/cgi-bin/awstats.pl") {
+ $Awstats="%%PREFIX%%/www/awstats/cgi-bin/awstats.pl";
$AwstatsFound=1;
}
elsif (-s "/usr/lib/cgi-bin/awstats.pl") {

View file

@ -1,88 +1,38 @@
--- tools/awstats_configure.pl.orig 2015-07-21 07:55:55 UTC
--- tools/awstats_configure.pl.orig 2016-07-17 17:51:11 UTC
+++ tools/awstats_configure.pl
@@ -27,12 +27,13 @@
@@ -27,7 +27,7 @@ $AWSTATS_CGI_PATH
$AWSTATS_MODEL_CONFIG
$AWSTATS_DIRDATA_PATH
/;
-$AWSTATS_PATH='';
-$AWSTATS_ICON_PATH='/usr/local/awstats/wwwroot/icon';
-$AWSTATS_CSS_PATH='/usr/local/awstats/wwwroot/css';
-$AWSTATS_CLASSES_PATH='/usr/local/awstats/wwwroot/classes';
-$AWSTATS_CGI_PATH='/usr/local/awstats/wwwroot/cgi-bin';
-$AWSTATS_MODEL_CONFIG='/etc/awstats/awstats.model.conf'; # Used only when configure ran on linux
+$AWSTATS_PATH='%%PREFIX%%/www/awstats';
+$AWSTATS_ICON_PATH='%%PREFIX%%/www/awstats/icon';
+$AWSTATS_CSS_PATH='%%PREFIX%%/www/awstats/css';
+$AWSTATS_CLASSES_PATH='%%PREFIX%%/www/awstats/classes';
+$AWSTATS_CGI_PATH='%%PREFIX%%/www/awstats/cgi-bin';
+$AWSTATS_MODEL_CONFIG='%%PREFIX%%/etc/awstats/awstats.model.conf';
+# Used only when configure ran on linux
$AWSTATS_DIRDATA_PATH='/var/lib/awstats'; # Used only when configure ran on linux
@@ -63,6 +64,7 @@
+$AWSTATS_PATH='%%WWWDIR%%';
$AWSTATS_ICON_PATH='/usr/local/awstats/wwwroot/icon';
$AWSTATS_CSS_PATH='/usr/local/awstats/wwwroot/css';
$AWSTATS_CLASSES_PATH='/usr/local/awstats/wwwroot/classes';
@@ -63,6 +63,9 @@ use vars qw/
'/etc/httpd/httpd.conf',
'/usr/local/apache/conf/httpd.conf',
'/usr/local/apache2/conf/httpd.conf',
+'%%PREFIX%%/etc/apache(13/22)/httpd.conf',
+'%%LOCALBASE%%/etc/apache13/httpd.conf',
+'%%LOCALBASE%%/etc/apache22/httpd.conf',
+'%%LOCALBASE%%/etc/apache24/httpd.conf'
);
use vars qw/
@@ -308,7 +310,8 @@
@@ -308,7 +311,7 @@ if ($OS eq 'linux') {
$AWSTATS_PATH=`pwd`; $AWSTATS_PATH =~ s/[\r\n]//;
$AWSTATS_PATH=~s/tools[\\\/]?$//;
$AWSTATS_PATH=~s/[\\\/]$//;
- if ($AWSTATS_PATH ne '/usr/local/awstats') {
+#freebsd default %%PREFIX%%/www/awstats
+ if ($AWSTATS_PATH ne '%%PREFIX%%/www/awstats') {
+ if ($AWSTATS_PATH ne '%%WWWDIR%%') {
print "Warning: AWStats standard directory on Linux OS is '/usr/local/awstats'.\n";
print "If you want to use standard directory, you should first move all content\n";
print "of AWStats distribution from current directory:\n";
@@ -323,10 +326,10 @@
print "configure.pl aborted.\n";
exit 1;
}
- $AWSTATS_ICON_PATH="$AWSTATS_PATH/wwwroot/icon";
- $AWSTATS_CSS_PATH="$AWSTATS_PATH/wwwroot/css";
- $AWSTATS_CLASSES_PATH="$AWSTATS_PATH/wwwroot/classes";
- $AWSTATS_CGI_PATH="$AWSTATS_PATH/wwwroot/cgi-bin";
+ $AWSTATS_ICON_PATH="$AWSTATS_PATH/icon";
+ $AWSTATS_CSS_PATH="$AWSTATS_PATH/css";
+ $AWSTATS_CLASSES_PATH="$AWSTATS_PATH/classes";
+ $AWSTATS_CGI_PATH="$AWSTATS_PATH/cgi-bin";
}
}
elsif ($OS eq 'macosx') {
@@ -419,6 +422,7 @@
@@ -419,6 +422,7 @@ if (! scalar keys %ApacheConfPath) {
print "\n".($bidon?"Now, enter":"Enter")." full config file path of your Web server.\n";
print "Example: /etc/httpd/httpd.conf\n";
+ print "Example: %%PREFIX%%/etc/apache(22/24)/httpd.conf";
+ print "Example: %%LOCALBASE%%/etc/apache24/httpd.conf\n";
print "Example: /usr/local/apache2/conf/httpd.conf\n";
print "Example: c:\\Program files\\apache group\\apache\\conf\\httpd.conf\n";
$bidon='';
@@ -526,7 +530,7 @@
#
# This is to permit URL access to scripts/files in AWStats directory.
#
-<Directory "$AWSTATS_PATH/wwwroot">
+<Directory "$AWSTATS_PATH/">
Options None
AllowOverride None
Order allow,deny
@@ -545,12 +549,12 @@
# -----------------------------
my $modelfile='';
if ($OS eq 'linux') {
- if (-f "$AWSTATS_PATH/wwwroot/cgi-bin/awstats.model.conf") {
- $modelfile="$AWSTATS_PATH/wwwroot/cgi-bin/awstats.model.conf";
+ if (-f "$AWSTATS_PATH/cgi-bin/awstats.model.conf") {
+ $modelfile="$AWSTATS_PATH/cgi-bin/awstats.model.conf";
}
else {
$modelfile="$AWSTATS_MODEL_CONFIG";
- if (! -s $modelfile || ! -w $modelfile) { $modelfile="$AWSTATS_PATH/wwwroot/cgi-bin/awstats.model.conf"; }
+ if (! -s $modelfile || ! -w $modelfile) { $modelfile="$AWSTATS_PATH/cgi-bin/awstats.model.conf"; }
}
}
elsif ($OS eq "macosx") {

View file

@ -1,13 +0,0 @@
--- tools/awstats_updateall.pl.orig 2015-07-21 07:55:55 UTC
+++ tools/awstats_updateall.pl
@@ -129,8 +129,8 @@
# Check if AWSTATS prog is found
my $AwstatsFound=0;
if (-s "$Awstats") { $AwstatsFound=1; }
- elsif (-s "/usr/local/awstats/wwwroot/cgi-bin/awstats.pl") {
- $Awstats="/usr/local/awstats/wwwroot/cgi-bin/awstats.pl";
+ elsif (-s "%%PREFIX%%/www/awstats/cgi-bin/awstats.pl") {
+ $Awstats="%%PREFIX%%/www/awstats/cgi-bin/awstats.pl";
$AwstatsFound=1;
}
if (! $AwstatsFound) {

View file

@ -1,21 +0,0 @@
--- wwwroot/cgi-bin/awstats.pl.orig 2015-06-18 14:35:12 UTC
+++ wwwroot/cgi-bin/awstats.pl
@@ -8983,12 +8983,12 @@ sub DefinePerlParsingFormat {
$LogFormatString =~ s/%>s/%code/g;
$LogFormatString =~ s/%b(\s)/%bytesd$1/g;
$LogFormatString =~ s/%b$/%bytesd/g;
- $LogFormatString =~ s/\"%{Referer}i\"/%refererquot/g;
- $LogFormatString =~ s/\"%{User-Agent}i\"/%uaquot/g;
- $LogFormatString =~ s/%{mod_gzip_input_size}n/%gzipin/g;
- $LogFormatString =~ s/%{mod_gzip_output_size}n/%gzipout/g;
- $LogFormatString =~ s/%{mod_gzip_compression_ratio}n/%gzipratio/g;
- $LogFormatString =~ s/\(%{ratio}n\)/%deflateratio/g;
+ $LogFormatString =~ s/\"%\{Referer\}i\"/%refererquot/g;
+ $LogFormatString =~ s/\"%\{User-Agent\}i\"/%uaquot/g;
+ $LogFormatString =~ s/%\{mod_gzip_input_size\}n/%gzipin/g;
+ $LogFormatString =~ s/%\{mod_gzip_output_size\}n/%gzipout/g;
+ $LogFormatString =~ s/%\{mod_gzip_compression_ratio\}n/%gzipratio/g;
+ $LogFormatString =~ s/\(%\{ratio\}n\)/%deflateratio/g;
# Replacement for a IIS and ISA format string
$LogFormatString =~ s/cs-uri-query/%query/g; # Must be before cs-uri

View file

@ -1,32 +1,10 @@
*****************************************************************
Please add the following to your apache config, and restart.
*********************************************************************
#
# Directives to allow use of AWStats as a CGI
#
Alias /awstatsclasses "%%PREFIX%%/www/awstats/classes/"
Alias /awstatscss "%%PREFIX%%/www/awstats/css/"
Alias /awstatsicons "%%PREFIX%%/www/awstats/icons/"
ScriptAlias /awstats/ "%%PREFIX%%/www/awstats/cgi-bin/"
Use %%PREFIX%%/www/awstats/tools/awstats_configure.pl to set up your
hosts.
#
# This is to permit URL access to scripts/files in AWStats directory.
#
<Directory "%%PREFIX%%/www/awstats/">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
To activate awstats in your webserver, see the example files for
apache: %%DOCSDIR%%/httpd_conf
nginx: %%DOCSDIR%%/nginx/
*****************************************************************
If you are upgrading from AWStats 6.4 or older, please note the following:
If you used the geoip plugin, you must edit your AWStats config file
to change the line
LoadPlugin="geoip GEOIP_STANDARD"
into
LoadPlugin="geoip GEOIP_STANDARD /pathto/GeoIP.dat"
*****************************************************************
*********************************************************************

File diff suppressed because it is too large Load diff