summaryrefslogtreecommitdiffstats
path: root/awstats/PKGBUILD
blob: a98377ab95913bcec4319af8d5bec01feda65666 (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
62
63
64
65
# Maintainer: Phillip Smith <fukawi2@NOSPAM.gmail.com
# Contributor: Piotr Beling <qwak@w8.pl>

pkgname=awstats
pkgver=6.95
pkgrel=1
pkgdesc="tool that generates web, streaming, ftp and mail server statistics, graphically"
arch=('any')
license='GPL'
url="http://awstats.sourceforge.net/"
depends=('perl')
install="awstats.install"
backup=('etc/awstats/awstats.model.conf' 'etc/httpd/conf/extra/httpd-awstats.conf')
source=("http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.gz" "cron.awstats")
md5sums=('26a5b19fa9f395e9e7dafed37b795d7f'
         '2103e3d97f8b4ff31cd4022c4ee839f7')

build() {
	msg "Nothing to compile for $pkgname"
}

package() {
	_SYSCONFDIR='etc'
	_WWWROOT='srv/http/awstats'
	_INSTDIR="usr/share/${pkgname}"
	_DOCDIR="usr/share/doc/${pkgname}-${pkgver}"

	cd $srcdir/${pkgname}-${pkgver}

	mkdir -p $pkgdir/$_INSTDIR/tools/webmin/ || return 1
	mkdir -p $pkgdir/$_INSTDIR/tools/xslt/ || return 1
	mkdir -p $pkgdir/$_WWWROOT/ || return 1
	mkdir -p $pkgdir/$_DOCDIR/ || return 1
	mkdir -p $pkgdir/var/lib/$pkgname || return 1

	# Arch Linux specific path:
	install -Dm644 tools/httpd_conf $pkgdir/${_SYSCONFDIR}/httpd/conf/extra/httpd-awstats.conf || return 1
	install -Dm744 $srcdir/cron.awstats $pkgdir/${_SYSCONFDIR}/cron.hourly/awstats || return 1

	install -m 755 tools/logresolvemerge.pl $pkgdir/$_INSTDIR/tools/logresolvemerge.pl || return 1
	install -m 755 tools/maillogconvert.pl $pkgdir/$_INSTDIR/tools/maillogconvert.pl || return 1
	install -m 755 tools/urlaliasbuilder.pl $pkgdir/$_INSTDIR/tools/urlaliasbuilder.pl || return 1
	install -m 755 tools/awstats_buildstaticpages.pl $pkgdir/$_INSTDIR/tools/awstats_buildstaticpages.pl || return 1
	install -m 755 tools/awstats_configure.pl $pkgdir/$_INSTDIR/tools/awstats_configure.pl || return 1
	install -m 755 tools/awstats_exportlib.pl $pkgdir/$_INSTDIR/tools/awstats_exportlib.pl || return 1
	install -m 755 tools/awstats_updateall.pl $pkgdir/$_INSTDIR/tools/awstats_updateall.pl || return 1
	install -m 755 tools/webmin/* $pkgdir/$_INSTDIR/tools/webmin || return 1
	install -m 755 tools/xslt/* $pkgdir/$_INSTDIR/tools/xslt || return 1

	# install the documentation
	cp -ra docs/* $pkgdir/$_DOCDIR/ || return 1

	# www files
	cp -ra wwwroot/* $pkgdir/$_WWWROOT/ || return 1
	install -Dm444 README.TXT $pkgdir/$_INSTDIR/README.TXT || return 1

	# fix the default http config
	sed \
	-e "s|/usr/local/awstats/wwwroot|/$_WWWROOT|g" \
	-i $pkgdir/${_SYSCONFDIR}/httpd/conf/extra/httpd-awstats.conf || return 1

	echo "deny from all" > $pkgdir/.htaccess
}

# vim:set ts=2 sw=2 et: