Gentoo Archives: gentoo-commits

From: "Jorge Manuel B. S. Vicetto" <jmbsvicetto@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: www-misc/awstats/files/, www-misc/awstats/
Date: Wed, 13 May 2020 09:47:49
Message-Id: 1589363255.4d4f49ad2dc855a31f482ba521c05f15a1753d61.jmbsvicetto@gentoo
1 commit: 4d4f49ad2dc855a31f482ba521c05f15a1753d61
2 Author: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 13 09:47:35 2020 +0000
4 Commit: Jorge Manuel B. S. Vicetto <jmbsvicetto <AT> gentoo <DOT> org>
5 CommitDate: Wed May 13 09:47:35 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d4f49ad
7
8 www-misc/awstats: Fix mime.pm - thanks to Tobias Sager.
9
10 Bug: https://bugs.gentoo.org/646786
11 Package-Manager: Portage-2.3.96, Repoman-2.3.22
12 Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo.org>
13
14 www-misc/awstats/awstats-7.8-r1.ebuild | 112 ++++++++++++++++++++++++++
15 www-misc/awstats/files/awstats-7.8-mime.patch | 12 +++
16 2 files changed, 124 insertions(+)
17
18 diff --git a/www-misc/awstats/awstats-7.8-r1.ebuild b/www-misc/awstats/awstats-7.8-r1.ebuild
19 new file mode 100644
20 index 00000000000..66748aa8bf7
21 --- /dev/null
22 +++ b/www-misc/awstats/awstats-7.8-r1.ebuild
23 @@ -0,0 +1,112 @@
24 +# Copyright 1999-2020 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=7
28 +
29 +inherit eutils
30 +
31 +MY_P=${PN}-${PV%_p*}
32 +
33 +DESCRIPTION="AWStats is short for Advanced Web Statistics"
34 +HOMEPAGE="https://www.awstats.org/"
35 +SRC_URI="https://www.awstats.org/files/${P}.tar.gz"
36 +S=${WORKDIR}/${MY_P}
37 +LICENSE="GPL-3"
38 +KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~sparc ~x86"
39 +IUSE="geoip ipv6"
40 +
41 +SLOT="0"
42 +
43 +RDEPEND="
44 + >=dev-lang/perl-5.6.1
45 + dev-perl/URI
46 + virtual/perl-Time-Local
47 + geoip? (
48 + dev-perl/Geo-IP
49 + )
50 + ipv6? (
51 + dev-perl/Net-DNS
52 + dev-perl/Net-IP
53 + )
54 +"
55 +DEPEND=""
56 +
57 +src_prepare() {
58 + eapply "${FILESDIR}"/${PN}-7.1-gentoo.diff
59 + eapply "${FILESDIR}"/${P}-mime.patch
60 +
61 + # change default installation directory
62 + find . -type f -exec sed \
63 + -e "s#/usr/local/awstats/wwwroot#/usr/share/awstats/wwwroot#g" \
64 + -e '/PossibleLibDir/s:(.*):("/usr/share/awstats/wwwroot/cgi-bin/lib"):' \
65 + -i {} + || die "find/sed failed"
66 +
67 + # set default values for directories; use apache log as an example
68 + sed \
69 + -e "s|^\(LogFile=\).*$|\1\"/var/log/apache2/access_log\"|" \
70 + -e "s|^\(SiteDomain=\).*$|\1\"localhost\"|" \
71 + -e "s|^\(DirIcons=\).*$|\1\"/awstats/icon\"|" \
72 + -i "${S}"/wwwroot/cgi-bin/awstats.model.conf || die "sed failed"
73 +
74 + # enable plugins
75 +
76 + if use ipv6; then
77 + sed -e "s|^#\(LoadPlugin=\"ipv6\"\)$|\1|" \
78 + -i "${S}"/wwwroot/cgi-bin/awstats.model.conf || die "sed failed"
79 + fi
80 +
81 + if use geoip; then
82 + sed -e '/LoadPlugin="geoip /aLoadPlugin="geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat"' \
83 + -i "${S}"/wwwroot/cgi-bin/awstats.model.conf || die "sed failed"
84 + fi
85 +
86 + find "${S}" '(' -type f -not -name '*.pl' ')' -exec chmod -x {} + || die
87 +
88 + eapply_user
89 +}
90 +
91 +HTML_DOCS="docs/"
92 +DOCS="README.md"
93 +
94 +src_install() {
95 + einstalldocs
96 +
97 + newdoc wwwroot/cgi-bin/plugins/example/example.pm example_plugin.pm
98 + dodoc -r tools/xslt
99 +
100 + keepdir /var/lib/awstats
101 +
102 + insinto /etc/awstats
103 + doins "${S}"/wwwroot/cgi-bin/awstats.model.conf
104 +
105 + # remove extra content that we don't want to install
106 + rm -r "${S}"/wwwroot/cgi-bin/awstats.model.conf \
107 + "${S}"/wwwroot/classes/src || die
108 +
109 + insinto /usr/share/awstats
110 + doins -r wwwroot
111 + chmod +x "${D}"/usr/share/awstats/wwwroot/cgi-bin/*.pl
112 +
113 + cd "${S}"/tools
114 + dobin awstats_buildstaticpages.pl awstats_exportlib.pl \
115 + awstats_updateall.pl
116 + newbin logresolvemerge.pl awstats_logresolvemerge.pl
117 + newbin maillogconvert.pl awstats_maillogconvert.pl
118 + newbin urlaliasbuilder.pl awstats_urlaliasbuilder.pl
119 +
120 + dosym ../share/awstats/wwwroot/cgi-bin/awstats.pl /usr/bin/awstats.pl
121 +}
122 +
123 +pkg_postinst() {
124 + elog "The AWStats-Manual is available either inside"
125 + elog "the /usr/share/doc/${PF} - folder, or at"
126 + elog "https://awstats.sourceforge.net/docs/index.html ."
127 + elog
128 + elog "Copy the /etc/awstats/awstats.model.conf to"
129 + elog "/etc/awstats/awstats.<yourdomain>.conf and edit it."
130 + elog ""
131 + ewarn "This ebuild does no longer use webapp-config to install"
132 + ewarn "instead you should point your configuration to the stable"
133 + ewarn "directory tree in the following path:"
134 + ewarn " /usr/share/awstats"
135 +}
136
137 diff --git a/www-misc/awstats/files/awstats-7.8-mime.patch b/www-misc/awstats/files/awstats-7.8-mime.patch
138 new file mode 100644
139 index 00000000000..a8d7f6d122a
140 --- /dev/null
141 +++ b/www-misc/awstats/files/awstats-7.8-mime.patch
142 @@ -0,0 +1,12 @@
143 +diff -ur awstats-7.8-old/wwwroot/cgi-bin/lib/mime.pm awstats-7.8/wwwroot/cgi-bin/lib/mime.pm
144 +--- awstats-7.8-old/wwwroot/cgi-bin/lib/mime.pm 2020-04-16 09:18:35.000000000 +0000
145 ++++ awstats-7.8/wwwroot/cgi-bin/lib/mime.pm 2020-05-13 09:38:30.654537576 +0000
146 +@@ -56,7 +56,7 @@
147 + 'diskimage', 'Disc and media file extensions',
148 + 'vm', 'Virtual Machine image',
149 + 'torrent', 'BitTorrent File',
150 +-'gis', 'GIS File'
151 ++'gis', 'GIS File',
152 + 'ebook', 'Ebook File'
153 + );
154 +