summaryrefslogtreecommitdiff
path: root/www/awstats/Makefile
blob: b1fc8b6982de621a141d305d70c05ec03b3885a2 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# $NetBSD: Makefile,v 1.24 2006/04/22 09:22:16 rillig Exp $
#

DISTNAME=	awstats-6.4
PKGREVISION=	2
CATEGORIES=	www
MASTER_SITES=	http://awstats.sourceforge.net/files/
EXTRACT_SUFX=	.tgz

MAINTAINER=	minskim@NetBSD.org
HOMEPAGE=	http://awstats.sourceforge.net/
COMMENT=	Free real-time logfile analyzer to get advanced web statistics

DIST_SUBDIR=	${PKGNAME_NOREV}nb2
NO_BUILD=	YES

USE_TOOLS+=	perl:run
REPLACE_PERL=	tools/*.pl		\
		wwwroot/cgi-bin/*.pl

APACHE_USER?=	www
APACHE_GROUP?=	www

# OWN_DIRS=		${VARBASE}/awstats
OWN_DIRS_PERMS+= 	${VARBASE}/awstats ${APACHE_USER} ${APACHE_GROUP} 0700
PKG_SYSCONFSUBDIR=	awstats

SUBST_CLASSES+=		conf
SUBST_STAGE.conf=	post-patch
SUBST_FILES.conf=	tools/awstats_configure.pl \
			wwwroot/cgi-bin/awstats.model.conf \
			wwwroot/cgi-bin/awstats.pl
SUBST_SED.conf=		-e "s|@PREFIX@|${PREFIX}|g" \
			-e "s|@VARBASE@|${VARBASE}|g" \
			-e "s|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g" \
			-e "s|/var/log/httpd/mylog.log|${VARBASE}/log/httpd/access_log|g" \
			-e "s|\"/etc/opt/awstats\"|\"/etc/opt/awstats\",\"${PKG_SYSCONFDIR}\"|g"
SUBST_MESSAGE.conf=	Fixing configuration files and scripts.

CONF_FILES+=	${PREFIX}/share/examples/awstats/awstats.conf \
		${PKG_SYSCONFDIR}/awstats.model.conf

do-install:
	${INSTALL_DATA_DIR} ${PREFIX}/awstats
	${INSTALL_SCRIPT_DIR} ${PREFIX}/awstats/bin
	${INSTALL_SCRIPT_DIR} ${PREFIX}/awstats/cgi-bin
	${INSTALL_DATA_DIR} ${PREFIX}/awstats/cgi-bin/plugins
	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/html/awstats
	${INSTALL_DATA_DIR} ${PREFIX}/share/examples/awstats
	${INSTALL_SCRIPT} ${WRKSRC}/tools/*.pl ${PREFIX}/awstats/bin
	${INSTALL_SCRIPT} ${WRKSRC}/wwwroot/cgi-bin/*.pl		\
		${PREFIX}/awstats/cgi-bin
	${INSTALL_DATA} ${WRKSRC}/wwwroot/cgi-bin/awstats.model.conf	\
		${PREFIX}/share/examples/awstats/awstats.conf
	${INSTALL_DATA} ${WRKSRC}/wwwroot/cgi-bin/plugins/example/example.pm \
		${PREFIX}/share/examples/awstats/example.pm
	${INSTALL_DATA} ${WRKSRC}/wwwroot/cgi-bin/plugins/*.pm		\
		${PREFIX}/awstats/cgi-bin/plugins
.for d in lang lib
	cd ${WRKSRC}/wwwroot/cgi-bin					\
		&& ${PAX} -rwpppm ${d} ${PREFIX}/awstats/cgi-bin/
	${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/awstats/cgi-bin/${d}
	${FIND} ${PREFIX}/awstats/cgi-bin/${d} -type d -print	\
		| ${XARGS} ${CHMOD} ${PKGDIRMODE}
	${FIND} ${PREFIX}/awstats/cgi-bin/${d} -type f -print	\
		| ${XARGS} ${CHMOD} ${SHAREMODE}
.endfor
.for d in classes css icon js
	cd ${WRKSRC}/wwwroot && ${PAX} -rwpppm ${d} ${PREFIX}/awstats/
	${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${PREFIX}/awstats/${d}
	${FIND} ${PREFIX}/awstats/${d} -type d -print	\
		| ${XARGS} ${CHMOD} ${PKGDIRMODE}
	${FIND} ${PREFIX}/awstats/${d} -type f -print	\
		| ${XARGS} ${CHMOD} ${SHAREMODE}
.endfor
	cd ${WRKSRC}/docs && ${PAX} -rwpppm . ${PREFIX}/share/doc/html/awstats/
	${CHOWN} -R ${DOCOWN}:${DOCGRP} ${PREFIX}/share/doc/html/awstats/
	${FIND} ${PREFIX}/share/doc/html/awstats/ -type d -print	\
		| ${XARGS} ${CHMOD} ${PKGDIRMODE}
	${FIND} ${PREFIX}/share/doc/html/awstats/ -type f -print	\
		| ${XARGS} ${CHMOD} ${DOCMODE}

.include "../../mk/bsd.pkg.mk"