summaryrefslogtreecommitdiffstats
path: root/main/awstats/APKBUILD
blob: 6e16a01c50309951e97fe99a3ffe4d4a09d59653 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=awstats
pkgver=7.3
pkgrel=0
pkgdesc="AWStats is short for Advanced Web Statistics."
url="http://awstats.sourceforge.net/"
arch="noarch"
license="GPL2+"
depends="perl perl-uri"
subpackages="$pkgname-doc"
source="http://www.awstats.org/files/$pkgname-$pkgver.tar.gz"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	local file
	cd "$_builddir"
	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="7706e1d1412ab4a7971c7f277ee5d4f7  awstats-7.3.tar.gz"
sha256sums="4fa0ff900b1665de1b7544ecf9d13219996af166cc50b558ee8f9626fad4588d  awstats-7.3.tar.gz"
sha512sums="7de2762123e886527e596e41d0e3709b0b26e1cfc83fd19da97e52bd0bbbbbac9223c90bfae5f78670f6aad09b48a5be888c71533eea8891b47ce158097f0d40  awstats-7.3.tar.gz"