# Maintainer: Natanael Copa pkgname=awstats pkgver=7.5 pkgrel=2 pkgdesc="Free real-time logfile analyzer to get advanced statistics" url="http://awstats.sourceforge.net/" arch="noarch" license="GPL2+" depends="perl perl-uri" subpackages="$pkgname-doc" source="https://prdownloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz CVE-2017-1000501-1.patch CVE-2017-1000501-2.patch " builddir="$srcdir/$pkgname-$pkgver" # secfixes: # 7.5-r2: # - CVE-2017-1000501 prepare() { local file default_prepare for file in tools/* wwwroot/cgi-bin/*; do [ -f "${file}" ] || continue sed -e "s:/usr/local/awstats/wwwroot:/usr/lib/awstats:g" \ -i "$file" done } build() { return 0 } package() { cd "$builddir" # logpath="awstats_log" # sed -e "s|^\(LogFile=\).*$|\1\"/var/log/${logpath}\"|" \ # -e "s|^\(SiteDomain=\).*$|\1\"localhost\"|" # -e "s|^\(DirIcons=\).*$|\1\"/awstats/icon\"|" # -e "s|^\(DirCgi=\).*$|\1\"/cgi-bin\"|" # -i "${S}"/wwwroot/cgi-bin/awstats.model.conf || die "sed failed" # if use ipv6; then # sed -e "s|^#\(LoadPlugin=\"ipv6\"\)$|\1|" -i "${S}"/wwwroot/cgi-bin/awstats.model.conf || die "sed failed" # fi install -d "$pkgdir"/usr/share/doc/awstats \ "$pkgdir"/var/lib/awstats \ "$pkgdir"/usr/lib/awstats \ "$pkgdir"/usr/bin \ "$pkgdir"/etc/awstats # docs cp -a docs tools/xslt "$pkgdir"/usr/share/doc/awstats || return 1 # cgi-bin cp -a wwwroot/* "$pkgdir"/usr/lib/awstats mv "$pkgdir"/usr/lib/awstats/cgi-bin/awstats.model.conf \ "$pkgdir"/etc/awstats/ ln -s /etc/aswtats/awstats \ "$pkgdir"/usr/lib/awstats/cgi-bin/awstats.model.conf # tools cp tools/*.pl "$pkgdir"/usr/bin/ || return 1 ln -s /usr/lib/awstats/cgi-bin/awstats.pl "$pkgdir"/usr/bin/ } md5sums="1b11916a0a369a014abeb128289bf6b9 awstats-7.5.tar.gz 845c69d65855b4b241223d72f11a7dff CVE-2017-1000501-1.patch 7d7d181cea0ea07aab72c1320ec0797d CVE-2017-1000501-2.patch" sha256sums="83c34bdeab9c277c14bea348c2d320f4a1e808388264139821c6bd6dfd1394f8 awstats-7.5.tar.gz 632a516c055c9bebfaa821b5b6f6d8ded258546e145579b002ba20f34e59036d CVE-2017-1000501-1.patch e854918db298847371f818814571549fe8b91e0286af2591b01fbed0ed88e423 CVE-2017-1000501-2.patch" sha512sums="d69a66b5ef94d8a7378ece0453a3617f71ad030d81c45cff926fae1319eacdcdcbe2e68513153cd7444d77cbb950827964b0157ce74c04be76781c071f016a35 awstats-7.5.tar.gz 0f5c3f3581c1ca2731f65180d898cf15ffd8fc21d490d54c773efdf310f87dd0dde83be4c3892474924e7c77bad5f0981d15be9ba740ecf146b1d8e6c8091544 CVE-2017-1000501-1.patch 7230907b6184bdcc6f1c971236a91a7053d7340dad848daea82ff2bdaf78c1e1ef882c706955e93221036dca0faf9aa333a9f0231d6b20ad65df915c72900a4d CVE-2017-1000501-2.patch"