I've made a new ebuild for awstats 6.2 based on the 6.1 ebuild. This should fix all the problems in bugs #63197, #63198, #63200 List of changes: * inherited webapp-apache * using postinstall-en.txt for instructions on what to put in apache config, not http_conf * there's no cvs files in 6.2 to remove * created /var/lib/awstats * fixed directory, files permissions * added instructions to build the initial statistics and to add a cron job to update them * added missing webapp_pkg_postinst to pkg_postinst One problem I have though is: * to use APACHEVER in src_unpack, I inherited webapp-apache and called webapp-detect But now when I try to install awstats, I'm getting the following errors: /usr/lib/portage/bin/ebuild.sh: line 1: webapp-apache_pkg_setup: command not found and * This ebuild did not call webapp_src_install() at the end * of the src_install() function Are webapp and webapp-apache not supposed to be used together? Reproducible: Always Steps to Reproduce:
Created attachment 43810 [details] awstats-6.2.ebuild
Created attachment 43811 [details] postinstall-en.txt
Created attachment 43813 [details] awstats-6.2.diff
Created attachment 43821 [details] awstats-6.2.ebuild Hmmm, APACHEVER seems to be working for me now without webapp-apache. So I removed the inherit to webapp-apache in this new ebuild, and all appears to be working. But I'd still like to know why I was having the problem before if anybody knows?
Created attachment 45183 [details] awstats-6.2.ebuild Updated the ebuild to move the directories from cgi-bin to /var/www/localhost/htdocs/awstats. So now, only the perl scripts are in the cgi-bin
In awstats-6.2.diff I see you using apche2 commands, but the ebuild only requires apache and not apache2. Can you change that to be maybe something like this? if (-e "/usr/sbin/apache2ctl") { print "\n-----> Restart Web server graceful with '/usr/sbin/apache2ctl graceful'\n"; my $ret=`/usr/sbin/apache2ctl graceful`; } elsif (-e "/usr/sbin/apachectl") { print "\n-----> Restart Web server graceful with '/usr/sbin/apachectl graceful'\n"; my $ret=`/usr/sbin/apachectl graceful`; } else print "\n-----> Error restarting Web server'\n"; } I see that you use the command "find", "sed" and "cp" but you have no dependency to it in the ebuild. Maybe adding something like this would be not a bad thing? RDEPEND=">=dev-lang/perl-5.6.1 >=media-libs/libpng-1.2 dev-perl/Time-Local net-www/apache" DEPEND="${RDEPEND} >=sys-apps/sed-4 sys-apps/findutils sys-apps/coreutils" cheers Steve
Created attachment 45740 [details] awstats-6.2.ebuild I was told on #gentoo-bugs if a command is part of the supported arch's system profile, their's no need to include it in DEPEND. But anyway, here's the fix.
Created attachment 45741 [details, diff] awstats-6.2.diff
to be honest: the awstats_configure.pl will always jump into the else statement. the reason is that /sbin/service does not exist on gentoo linux. the patch would probably need to look like this: --- awstats-6.2.orig/tools/awstats_configure.pl 2004-12-11 06:33:00.069716000 -0500 +++ awstats-6.2/tools/awstats_configure.pl 2004-12-11 06:43:32.885513744 -0500 @@ -654,9 +654,15 @@ if ($OS eq 'linux') { - my $command="/sbin/service"; - if (-x $command) { - print "\n-----> Restart Web server with '/sbin/service httpd restart'\n"; - my $ret=`/sbin/service httpd restart`; - print "$ret"; + if (-x "/usr/sbin/apache2ctl") + { + print "\n-----> Restart Web server graceful with '/usr/sbin/apache2ctl graceful'\n"; + my $ret=`/usr/sbin/apache2ctl graceful`; + } + elsif (-x "/usr/sbin/apachectl") + { + print "\n-----> Restart Web server graceful with '/usr/sbin/apachectl graceful'\n"; + my $ret=`/usr/sbin/apachectl graceful`; } else { print "\n-----> Don't forget to restart manually your web server\n"; what do you think? cheers SteveB
Your right, also their's no need for that last else statement in their. How about this: --- awstats-6.2.orig/tools/awstats_configure.pl 2004-12-11 06:33:00.000000000 -0500 +++ awstats-6.2/tools/awstats_configure.pl 2004-12-11 07:49:59.341480320 -0500 @@ -652,15 +652,15 @@ # ---------------------------------- if ($WebServerChanged) { if ($OS eq 'linux') { - my $command="/sbin/service"; - if (-x $command) { - print "\n-----> Restart Web server with '/sbin/service httpd restart'\n"; - my $ret=`/sbin/service httpd restart`; - print "$ret"; - } - else { - print "\n-----> Don't forget to restart manually your web server\n"; - } + if (-e "/usr/sbin/apache2ctl") { + print "\n-----> Restart Web server graceful with '/usr/sbin/apache2ctl graceful'\n"; + my $ret=`/usr/sbin/apache2ctl graceful`; + } elsif (-e "/usr/sbin/apachectl") { + print "\n-----> Restart Web server graceful with '/usr/sbin/apachectl graceful'\n"; + my $ret=`/usr/sbin/apachectl graceful`; + } else + print "\n-----> Error restarting Web server'\n"; + } } elsif ($OS eq 'macosx') { print "\n-----> Restart Web server with '/usr/sbin/apachectl restart'\n";
The last else statement is not bad. In your else statement you print a error, but in real there was no error at all. Why don't you leave the old else statement? It only shows the user that he needs to restart the web server, witch is not a bad thing.
It doesn't really matter. It's just semantics I guess, either one is fine. My thinking was just, if apachectl and apache2ctl doesn't exist on your system, than something is broke on your system. Mostly likely you won't be able to restart your server.
Re: Comment #12 Why would your system be broken if those files didn't exist? Because Gentoo only supports two web servers, Apache 1 or Apache 2?
Because apache is a dependency, so it has to be on the system for the ebuild to work.
Hi Tom what do you think about adding some thing like this at the top of src_install? # Change apache configuration local MY_APACHE_VER if [[ -f "${ROOT}/etc/apache2/conf/apache2.conf" ]] then MY_APACHE_VER="2" elif [[ -f "${ROOT}/etc/apache/conf/apache.conf" ]] then MY_APACHE_VER="" fi if [[ -f "${ROOT}/etc/apache${MY_APACHE_VER}/conf/apache${MY_APACHE_VER}.conf" ]] then sed -e "s:^\(Alias.*awstats/\)[0-9\.]*\(/.*\)$:\1${PV}\2:g" \ -e "s:^\([ \t]*ScriptAlias.*awstats/\)[0-9\.]*\(/.*\)$:\1${PV}\2:gI" \ -e "s:^\([ \t]*<Directory.*awstats/\)[0-9\.]*\(/.*\)$:\1${PV}\2:gI" \ -e "s:^\([ \t]*<Directory.*awstats/\)[0-9\.]*\(/.*\)$:\1${PV}\2:gI" \ -e "s:^\([ \t]*AuthUserFile.*awstats/\)[0-9\.]*\(/.*\)$:\1${PV}\2:gI" \ ${ROOT}/etc/apache${MY_APACHE_VER}/conf/apache${MY_APACHE_VER}.conf \ > ${T}/apache${MY_APACHE_VER}.conf dodir /etc/apache${MY_APACHE_VER}/conf insinto /etc/apache${MY_APACHE_VER}/conf doins ${T}/apache${MY_APACHE_VER}.conf fi It would help some users to maintain their apache configuration up to date. cheers SteveB
My experience with regular expressions is limited, but I'm guessing yours make the necessary updates to apache2.conf to deal with the moving of directories from the cgi-bin to htdocs? Also, I don't have enough experience with this, so I'm not sure if ebuilds should be trying to update the apache config file itself. I know you'd still need to run etc-update, but I haven't seen anything else do that, so I'm not sure? Lastly, since those directories are being moved to htdocs. I guess a warning message should be printed that the layout of the package has been changed, you updating the apache config file is necessary?
*** Bug 75248 has been marked as a duplicate of this bug. ***
Hi Tom the update to the apache configuration is not necessary at all. It just helps do deploy/maintain awstats. cheers SteveB
Can we include the following patch into awstats-6.2.diff (see bug http://bugs.gentoo.org/show_bug.cgi?id=77963): --- awstats-6.2.org/tools/awstats_buildstaticpages.pl 2004-01-25 16:19:48.000000000 +0100 +++ awstats-6.2/tools/awstats_buildstaticpages.pl 2005-01-20 18:47:13.881813728 +0100 @@ -240,7 +240,7 @@ if ($QueryString =~ /(^|-|&)month=(year)/i) { error("month=year is a deprecated option. Use month=all instead."); } if ($QueryString =~ /(^|-|&)debug=(\d+)/i) { $Debug=$2; } -if ($QueryString =~ /(^|-|&)configdir=([^&]+)/i) { $DirConfig="$2"; } +if ($QueryString =~ /(^|-|&)configdir=([^&]+)/i) { $DirConfig="$2";$DirConfig=~tr/a-z0-9_\-\/\./a-z0-9_\-\/\./cd; } if ($QueryString =~ /(^|-|&)config=([^&]+)/i) { $SiteConfig="$2"; } if ($QueryString =~ /(^|-|&)awstatsprog=([^&]+)/i) { $Awstats="$2"; } if ($QueryString =~ /(^|-|&)buildpdf/i) { $BuildPDF=1; } --- awstats-6.2.org/wwwroot/cgi-bin/awstats.pl 2004-10-30 20:02:24.000000000 +0200 +++ awstats-6.2/wwwroot/cgi-bin/awstats.pl 2005-01-20 18:46:52.280097688 +0100 @@ -5334,7 +5334,7 @@ if ($QueryString =~ /config=([^&]+)/i) { $SiteConfig=&DecodeEncodedString("$1"); } if ($QueryString =~ /diricons=([^&]+)/i) { $DirIcons=&DecodeEncodedString("$1"); } if ($QueryString =~ /pluginmode=([^&]+)/i) { $PluginMode=&DecodeEncodedString("$1"); } - if ($QueryString =~ /configdir=([^&]+)/i) { $DirConfig=&DecodeEncodedString("$1"); } + if ($QueryString =~ /configdir=([^&]+)/i) { $DirConfig=&DecodeEncodedString("$1");$DirConfig=~tr/a-z0-9_\-\/\./a-z0-9_\-\/\./cd; } # All filters if ($QueryString =~ /hostfilter=([^&]+)/i) { $FilterIn{'host'}=&DecodeEncodedString("$1"); } # Filter on host list can also be defined with hostfilter=filter if ($QueryString =~ /hostfilterex=([^&]+)/i) { $FilterEx{'host'}=&DecodeEncodedString("$1"); } # @@ -5382,7 +5382,7 @@ if ($QueryString =~ /config=([^&]+)/i) { $SiteConfig="$1"; } if ($QueryString =~ /diricons=([^&]+)/i) { $DirIcons="$1"; } if ($QueryString =~ /pluginmode=([^&]+)/i) { $PluginMode="$1"; } - if ($QueryString =~ /configdir=([^&]+)/i) { $DirConfig="$1"; } + if ($QueryString =~ /configdir=([^&]+)/i) { $DirConfig="$1";$DirConfig=~tr/a-z0-9_\-\/\./a-z0-9_\-\/\./cd; } # All filters if ($QueryString =~ /hostfilter=([^&]+)/i) { $FilterIn{'host'}="$1"; } # Filter on host list can also be defined with hostfilter=filter if ($QueryString =~ /hostfilterex=([^&]+)/i) { $FilterEx{'host'}="$1"; } #
6.3 is in CVS and fixes security bug #77963. For any other stuff you have posted here, please open separate bugs.