[Pkg-awstats-commits] [awstats] 02/11: Use patch (not perl) to apply Debian-specific configuration changes

Sergey Kirpichev sk-guest at alioth.debian.org
Thu Oct 17 22:28:35 UTC 2013


This is an automated email from the git hooks/post-receive script.

sk-guest pushed a commit to branch master
in repository awstats.

commit e7ca3e668c9f429f7cf2a02f6e54e85bdeb6cc8a
Author: Sergey B Kirpichev <skirpichev at gmail.com>
Date:   Sun Oct 6 21:07:48 2013 +0400

    Use patch (not perl) to apply Debian-specific configuration changes
---
 debian/patches/2003_awstats.conf.patch |  134 ++++++++++++++++++++++++++++++++
 debian/patches/series                  |    1 +
 debian/rules                           |   24 +-----
 3 files changed, 136 insertions(+), 23 deletions(-)

diff --git a/debian/patches/2003_awstats.conf.patch b/debian/patches/2003_awstats.conf.patch
new file mode 100644
index 0000000..f66ab21
--- /dev/null
+++ b/debian/patches/2003_awstats.conf.patch
@@ -0,0 +1,134 @@
+Author: Sergey B Kirpichev <skirpichev at gmail.com>
+Description: Debian-specific awstats config
+Forwarded: not-needed
+
+---
+ wwwroot/cgi-bin/awstats.model.conf |   28 ++++++++++++++--------------
+ 1 file changed, 14 insertions(+), 14 deletions(-)
+
+--- a/wwwroot/cgi-bin/awstats.model.conf
++++ b/wwwroot/cgi-bin/awstats.model.conf
+@@ -48,7 +48,7 @@
+ # If there are several log files from load balancing servers :
+ # Example: "/pathtotools/logresolvemerge.pl *.log |"
+ #
+-LogFile="/var/log/httpd/mylog.log"
++LogFile="/var/log/apache2/access.log"
+ 
+ 
+ # Enter the log file type you want to analyze.
+@@ -120,7 +120,7 @@
+ # Example for IIS:
+ # LogFormat = 2
+ #
+-LogFormat=1
++LogFormat=4
+ 
+ 
+ # If your log field's separator is not a space, you can change this parameter.
+@@ -166,7 +166,7 @@
+ # Note: You can also use @/mypath/myfile if list of aliases are in a file.
+ # Example: "www.myserver.com localhost 127.0.0.1 REGEX[mydomain\.(net|org)$]"
+ #
+-HostAliases="localhost 127.0.0.1 REGEX[myserver\.com$]"
++HostAliases="localhost 127.0.0.1"
+ 
+ 
+ # If you want to have hosts reported by name instead of ip address, AWStats
+@@ -186,7 +186,7 @@
+ # 2 - DNS Lookup is made only from static DNS cache file (if it exists)
+ # Default: 2
+ # 
+-DNSLookup=2
++DNSLookup=1
+ 
+ 
+ # When AWStats updates its statistics, it stores results of its analysis in 
+@@ -201,7 +201,7 @@
+ # Example: "C:/awstats_data_dir"
+ # Default: "."          (means same directory as awstats.pl)
+ #
+-DirData="."
++DirData="/var/lib/awstats"
+ 
+ 
+ # Relative or absolute web URL of your awstats cgi-bin directory.
+@@ -220,7 +220,7 @@
+ # Example: "../icon"
+ # Default: "/icon" (means you must copy icon directories in "/mywwwroot/icon")
+ #
+-DirIcons="/icon"
++DirIcons="/awstats-icon"
+ 
+ 
+ # When this parameter is set to 1, AWStats adds a button on report page to
+@@ -917,7 +917,7 @@
+ # Example: "/usr/share/awstats/lang"
+ # Default: "./lang" (means lang directory is in same location than awstats.pl)
+ #
+-DirLang="./lang"
++DirLang="/usr/share/awstats/lang"
+ 
+ 
+ # Show menu header with reports' links
+@@ -1313,7 +1313,7 @@
+ # DESCRIPTION: AWStats DNS cache files are read/saved as native hash files. 
+ # This increases DNS cache files loading speed, above all for very large web sites.
+ #
+-#LoadPlugin="hashfiles"
++LoadPlugin="hashfiles"
+ 
+ 
+ # PLUGIN: UserInfo
+@@ -1426,7 +1426,7 @@
+ # table with country name
+ # Replace spaces in the path of geoip data file with string "%20".
+ #
+-#LoadPlugin="geoip GEOIP_STANDARD /pathto/GeoIP.dat"
++#LoadPlugin="geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat"
+ 
+ # PLUGIN: GeoIP_City_Maxmind
+ # REQUIRED MODULES: Geo::IP or Geo::IP::PurePerl (from Maxmind)
+@@ -1435,7 +1435,7 @@
+ # and hits by city including regions.
+ # Replace spaces in the path of geoip data file with string "%20".
+ #
+-#LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /pathto/GeoIPCity.dat"
++#LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /usr/share/GeoIP/GeoIPCity.dat"
+ 
+ # PLUGIN: GeoIP_ASN_Maxmind
+ # REQUIRED MODULES: Geo::IP or Geo::IP::PurePerl (from Maxmind)
+@@ -1455,7 +1455,7 @@
+ # Canada can be detected.
+ # Replace spaces in the path of geoip data file with string "%20".
+ #
+-#LoadPlugin="geoip_region_maxmind GEOIP_STANDARD /pathto/GeoIPRegion.dat"
++#LoadPlugin="geoip_region_maxmind GEOIP_STANDARD /usr/share/GeoIP/GeoIPRegion.dat"
+ 
+ # PLUGIN: GeoIP_ISP_Maxmind
+ # REQUIRED MODULES: Geo::IP or Geo::IP::PurePerl (from Maxmind)
+@@ -1463,7 +1463,7 @@
+ # DESCRIPTION: This plugin adds a chart of hits by ISP.
+ # Replace spaces in the path of geoip data file with string "%20".
+ #
+-#LoadPlugin="geoip_isp_maxmind GEOIP_STANDARD /pathto/GeoIPISP.dat"
++#LoadPlugin="geoip_isp_maxmind GEOIP_STANDARD /usr/share/GeoIP/GeoIPISP.dat"
+ 
+ # PLUGIN: GeoIP_Org_Maxmind
+ # REQUIRED MODULES: Geo::IP or Geo::IP::PurePerl (from Maxmind)
+@@ -1471,7 +1471,7 @@
+ # DESCRIPTION: This plugin add a chart of hits by Organization name
+ # Replace spaces in the path of geoip data file with string "%20".
+ #
+-#LoadPlugin="geoip_org_maxmind GEOIP_STANDARD /pathto/GeoIPOrg.dat"
++#LoadPlugin="geoip_org_maxmind GEOIP_STANDARD /usr/share/GeoIP/GeoIPOrg.dat"
+ 
+ 
+ #-----------------------------------------------------------------------------
+@@ -1554,5 +1554,5 @@
+ # parameters that are lists of values.
+ #
+ 
+-#Include ""
++Include "/etc/awstats/awstats.conf.local"
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 48631f6..b9ec20c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@
 1020_LogFile_usage_docs.patch
 2001_awstatsprog_path.patch
 2002_nboflastupdatelookuptosave.patch
+2003_awstats.conf.patch
diff --git a/debian/rules b/debian/rules
index 6a279ab..3bfbc49 100755
--- a/debian/rules
+++ b/debian/rules
@@ -40,30 +40,8 @@ DEB_ANT_BUILDFILE = debian/build.xml
 DEB_ANT_BUILD_TARGET = bin-jar
 DEB_ANT_ARGS = -Dpackage=awgraphapplet -Dversion=$(DEB_NOEPOCH_VERSION)
 
-# Adjust for Debian (and cleanup) main config file
 common-configure-indep::
-	# Use perl rather than a diff here, to make sure all relevant
-	# options are checked (upstream defaults have moved around in
-	# the past)
-# Perl in shell in make requires extra care:
-#  * Single-quoting ('...') protects against shell expansion
-#  * Double-dollar ($$) expands to plain dollar ($) in make
-	perl -wp \
-		-e 's,^(LogFile\s*=\s*).*,$$1"/var/log/apache2/access.log",;' \
-		-e 's,^(DirData\s*=\s*).*,$$1"/var/lib/awstats",;' \
-		-e 's,^(LogFormat\s*=\s*).*,$${1}4,;' \
-		-e 's,^(DNSLookup\s*=\s*).*,$${1}1,;' \
-		-e 's,^(DirIcons\s*=\s*).*,$$1"/awstats-icon",;' \
-		-e 's,^(HostAliases\s*=\s*).*,$$1"localhost 127.0.0.1",;' \
-		-e 's,^(DirLang\s*=\s*).*,$$1"/usr/share/awstats/lang",;' \
-		-e 's,^#(LoadPlugin\s*=\s*"hashfiles"),$$1,;' \
-		-e 's,^#(Include\s*)"",$$1"/etc/awstats/awstats.conf.local",;' \
-		-e 's,^(#LoadPlugin\s*=\s*"geoip\s*GEOIP_STANDARD\s*).*,$$1/usr/share/GeoIP/GeoIP.dat",;' \
-		-e 's,^(#LoadPlugin\s*=\s*"geoip_region_maxmind\s*GEOIP_STANDARD\s*).*,$$1/usr/share/GeoIP/GeoIPRegion.dat",;' \
-		-e 's,^(#LoadPlugin\s*=\s*"geoip_city_maxmind\s*GEOIP_STANDARD\s*).*,$$1/usr/share/GeoIP/GeoIPCity.dat",;' \
-		-e 's,^(#LoadPlugin\s*=\s*"geoip_isp_maxmind\s*GEOIP_STANDARD\s*).*,$$1/usr/share/GeoIP/GeoIPISP.dat",;' \
-		-e 's,^(#LoadPlugin\s*=\s*"geoip_org_maxmind\s*GEOIP_STANDARD\s*).*,$$1/usr/share/GeoIP/GeoIPOrg.dat",;' \
-		< wwwroot/cgi-bin/awstats.model.conf > debian/awstats.conf
+	cp wwwroot/cgi-bin/awstats.model.conf debian/awstats.conf
 clean::
 	rm -f debian/awstats.conf
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/awstats.git



More information about the Pkg-awstats-commits mailing list