From 68944859264d1169fdc6c9793ad550054de6c517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20F=C3=B6rster?= Date: Sun, 30 Apr 2023 22:23:02 +0200 Subject: [PATCH] [www-misc/awstats] bump --- www-misc/awstats/Manifest | 1 + www-misc/awstats/awstats-7.9.ebuild | 109 ++++++++++++++++++ .../awstats/files/awstats-7.1-gentoo.diff | 21 ++++ www-misc/awstats/metadata.xml | 8 ++ 4 files changed, 139 insertions(+) create mode 100644 www-misc/awstats/Manifest create mode 100644 www-misc/awstats/awstats-7.9.ebuild create mode 100644 www-misc/awstats/files/awstats-7.1-gentoo.diff create mode 100644 www-misc/awstats/metadata.xml diff --git a/www-misc/awstats/Manifest b/www-misc/awstats/Manifest new file mode 100644 index 0000000..a571ec9 --- /dev/null +++ b/www-misc/awstats/Manifest @@ -0,0 +1 @@ +DIST awstats-7.9.tar.gz 2948602 BLAKE2B becee5c19ca761ff306abe10906af84e53cb04f774721194df17b2d88326d7dbfdc19da29cf7c510384fc15026be7b29cdcd66b976afead5e1dda3ab59b73ce6 SHA512 1270c7486a5558a54abc7b43cd92ffcea356ff4c00271bb824758ef4f5736eff559dd38eb7bc7bff8d45efa970a60ddcc5771762a3c3a32f003b0e39c55814d9 diff --git a/www-misc/awstats/awstats-7.9.ebuild b/www-misc/awstats/awstats-7.9.ebuild new file mode 100644 index 0000000..931cbe6 --- /dev/null +++ b/www-misc/awstats/awstats-7.9.ebuild @@ -0,0 +1,109 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MY_P=${PN}-${PV%_p*} + +DESCRIPTION="AWStats is short for Advanced Web Statistics" +HOMEPAGE="https://www.awstats.org/" +SRC_URI="https://www.awstats.org/files/${P}.tar.gz" +S=${WORKDIR}/${MY_P} +LICENSE="GPL-3" +KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86" +IUSE="geoip ipv6" + +SLOT="0" + +RDEPEND=" + >=dev-lang/perl-5.6.1 + dev-perl/URI + virtual/perl-Time-Local + geoip? ( + dev-perl/Geo-IP + ) + ipv6? ( + dev-perl/Net-DNS + dev-perl/Net-IP + ) +" +DEPEND="" + +src_prepare() { + eapply "${FILESDIR}"/${PN}-7.1-gentoo.diff + + # change default installation directory + find . -type f -exec sed \ + -e "s#/usr/local/awstats/wwwroot#/usr/share/awstats/wwwroot#g" \ + -e '/PossibleLibDir/s:(.*):("/usr/share/awstats/wwwroot/cgi-bin/lib"):' \ + -i {} + || die "find/sed failed" + + # set default values for directories; use apache log as an example + sed \ + -e "s|^\(LogFile=\).*$|\1\"/var/log/apache2/access_log\"|" \ + -e "s|^\(SiteDomain=\).*$|\1\"localhost\"|" \ + -e "s|^\(DirIcons=\).*$|\1\"/awstats/icon\"|" \ + -i "${S}"/wwwroot/cgi-bin/awstats.model.conf || die "sed failed" + + # enable plugins + + if use ipv6; then + sed -e "s|^#\(LoadPlugin=\"ipv6\"\)$|\1|" \ + -i "${S}"/wwwroot/cgi-bin/awstats.model.conf || die "sed failed" + fi + + if use geoip; then + sed -e '/LoadPlugin="geoip /aLoadPlugin="geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat"' \ + -i "${S}"/wwwroot/cgi-bin/awstats.model.conf || die "sed failed" + fi + + find "${S}" '(' -type f -not -name '*.pl' ')' -exec chmod -x {} + || die + + eapply_user +} + +HTML_DOCS="docs/" +DOCS="README.md" + +src_install() { + einstalldocs + + newdoc wwwroot/cgi-bin/plugins/example/example.pm example_plugin.pm + dodoc -r tools/xslt + + keepdir /var/lib/awstats + + insinto /etc/awstats + doins "${S}"/wwwroot/cgi-bin/awstats.model.conf + + # remove extra content that we don't want to install + rm -r "${S}"/wwwroot/cgi-bin/awstats.model.conf \ + "${S}"/wwwroot/classes/src || die + + insinto /usr/share/awstats + doins -r wwwroot + chmod +x "${D}"/usr/share/awstats/wwwroot/cgi-bin/*.pl + + cd "${S}"/tools + dobin awstats_buildstaticpages.pl awstats_exportlib.pl \ + awstats_updateall.pl + newbin logresolvemerge.pl awstats_logresolvemerge.pl + newbin maillogconvert.pl awstats_maillogconvert.pl + newbin urlaliasbuilder.pl awstats_urlaliasbuilder.pl + + dosym ../share/awstats/wwwroot/cgi-bin/awstats.pl /usr/bin/awstats.pl +} + +pkg_postinst() { + elog "The AWStats-Manual is available either inside" + elog "the /usr/share/doc/${PF} - folder, or at" + elog "https://awstats.sourceforge.net/docs/index.html ." + elog + elog "Copy the /etc/awstats/awstats.model.conf to" + elog "/etc/awstats/awstats..conf and edit it." + elog "" + ewarn "This ebuild does no longer use webapp-config to install" + ewarn "instead you should point your configuration to the stable" + ewarn "directory tree in the following path:" + ewarn " /usr/share/awstats" +} diff --git a/www-misc/awstats/files/awstats-7.1-gentoo.diff b/www-misc/awstats/files/awstats-7.1-gentoo.diff new file mode 100644 index 0000000..a58ed48 --- /dev/null +++ b/www-misc/awstats/files/awstats-7.1-gentoo.diff @@ -0,0 +1,21 @@ +--- awstats-6.3.orig/tools/awstats_configure.pl 2005-01-24 09:28:43.980923725 -0500 ++++ awstats-6.3/tools/awstats_configure.pl 2005-01-24 09:28:52.034571769 -0500 +@@ -658,6 +658,18 @@ + print "\n-----> Restart Web server with '$command'\n"; + my $ret=`$command`; + print "$ret"; ++ } elsif (-f "/etc/gentoo-release") { ++ my $command; ++ if (-x "/etc/init.d/apache2") { ++ $command="/etc/init.d/apache2 graceful"; ++ } else { ++ print "\n-----> Don't forget to restart manually your web server\n"; ++ } ++ if ($command != "") { ++ print "\n-----> Restart Web server with '$command'\n"; ++ my $ret=`$command`; ++ print "$ret"; ++ } + } elsif (-x "/sbin/service") { + # We are not on debian + my $command="/sbin/service httpd restart"; diff --git a/www-misc/awstats/metadata.xml b/www-misc/awstats/metadata.xml new file mode 100644 index 0000000..067a8a7 --- /dev/null +++ b/www-misc/awstats/metadata.xml @@ -0,0 +1,8 @@ + + + + + web-apps@gentoo.org + Gentoo Webapps + +