# Contributor: Valery Kartel # Maintainer: Natanael Copa pkgname=awstats pkgver=7.6 pkgrel=2 pkgdesc="Free real-time logfile analyzer to get advanced statistics" url="http://awstats.sourceforge.net/" arch="noarch" license="GPL-3.0-or-later" depends="perl perl-uri" subpackages="$pkgname-doc" options="!check" # no testsuite 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.6-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/$pkgname/wwwroot:/usr/lib/$pkgname:g" \ -i "$file" done for file in wwwroot/cgi-bin/*; do [ -f "${file}" ] || continue sed -e "s:/usr/share/$pkgname:/usr/lib/$pkgname/cgi-bin:g" \ -i "$file" done } package() { cd "$builddir" install -d "$pkgdir"/usr/share/doc/$pkgname \ "$pkgdir"/var/lib/$pkgname \ "$pkgdir"/usr/lib/$pkgname \ "$pkgdir"/etc/$pkgname \ "$pkgdir"/usr/bin # docs cp -a docs tools/xslt "$pkgdir"/usr/share/doc/$pkgname || return 1 # cgi-bin cp -a wwwroot/* "$pkgdir"/usr/lib/$pkgname mv "$pkgdir"/usr/lib/$pkgname/cgi-bin/$pkgname.model.conf \ "$pkgdir"/etc/awstats/ ln -s /etc/$pkgname/$pkgname.model.conf \ "$pkgdir"/usr/lib/$pkgname/cgi-bin/$pkgname.model.conf # tools cp tools/*.pl "$pkgdir"/usr/bin/ || return 1 ln -s /usr/lib/$pkgname/cgi-bin/$pkgname.pl "$pkgdir"/usr/bin/ # remove java sources and example plugin rm -fr "$pkgdir"/usr/lib/$pkgname/classes/src \ "$pkgdir"/usr/lib/$pkgname/cgi-bin/plugins/example } sha512sums="ebce29dcbdc1f0eef68f1faf6a511212daba3e3621db682dce692dffa584e0c456fb260b9f8e1b7ac25a2a7d5d2bea5034692d2395d4e56a16fa5a36844c79d5 awstats-7.6.tar.gz 0f5c3f3581c1ca2731f65180d898cf15ffd8fc21d490d54c773efdf310f87dd0dde83be4c3892474924e7c77bad5f0981d15be9ba740ecf146b1d8e6c8091544 CVE-2017-1000501-1.patch 7230907b6184bdcc6f1c971236a91a7053d7340dad848daea82ff2bdaf78c1e1ef882c706955e93221036dca0faf9aa333a9f0231d6b20ad65df915c72900a4d CVE-2017-1000501-2.patch"