1 # $NetBSD: Makefile,v 1.47 2012/02/13 22:34:38 gls Exp $
5 MASTER_SITES= http://www.awstats.org/files/
7 MAINTAINER= minskim@NetBSD.org
8 HOMEPAGE= http://www.awstats.org/
9 COMMENT= Free real-time logfile analyzer to get advanced web statistics
12 PKG_DESTDIR_SUPPORT= user-destdir
14 DIST_SUBDIR= ${PKGNAME_NOREV}
18 USE_TOOLS+= perl:run pax
19 REPLACE_PERL+= tools/*.pl
20 REPLACE_PERL+= wwwroot/cgi-bin/*.pl
21 REPLACE_PERL+= wwwroot/cgi-bin/plugins/*.pm
22 REPLACE_PERL+= wwwroot/classes/src/*.pl
24 .include "../../mk/bsd.prefs.mk"
30 PKG_GROUPS_VARS+= APACHE_GROUP
31 PKG_USERS_VARS= APACHE_USER
34 #OWN_DIRS= ${VARBASE}/awstats
35 OWN_DIRS_PERMS+= ${VARBASE}/awstats ${APACHE_USER} ${APACHE_GROUP} 0700
36 PKG_SYSCONFSUBDIR= awstats
39 SUBST_STAGE.conf= pre-configure
40 SUBST_FILES.conf= tools/awstats_configure.pl \
41 tools/awstats_buildstaticpages.pl \
42 tools/awstats_updateall.pl \
43 wwwroot/cgi-bin/awstats.model.conf \
44 wwwroot/cgi-bin/awstats.pl
45 SUBST_SED.conf= -e "s|@PREFIX@|${PREFIX}|g"
46 SUBST_SED.conf+= -e "s|@VARBASE@|${VARBASE}|g"
47 SUBST_SED.conf+= -e "s|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g"
48 SUBST_SED.conf+= -e "s|\"/etc/awstats|\"${PKG_SYSCONFDIR}|g"
49 SUBST_SED.conf+= -e "s|\"/usr/local/awstats/wwwroot|\"${PREFIX}/awstats|g"
50 SUBST_SED.conf+= -e "s|/var/log/httpd/mylog.log|${VARBASE}/log/httpd/access_log|g"
51 SUBST_MESSAGE.conf= Fixing configuration files and scripts.
53 CONF_FILES+= ${PREFIX}/share/examples/awstats/awstats.conf \
54 ${PKG_SYSCONFDIR}/awstats.model.conf
56 INSTALLATION_DIRS+= awstats
57 INSTALLATION_DIRS+= awstats/bin
58 INSTALLATION_DIRS+= awstats/cgi-bin
59 INSTALLATION_DIRS+= awstats/cgi-bin/plugins
60 INSTALLATION_DIRS+= share/doc/awstats
61 INSTALLATION_DIRS+= share/examples/awstats
64 find ${WRKSRC} -name .cvsignore -exec rm {} \;
67 ${INSTALL_SCRIPT} ${WRKSRC}/tools/*.pl ${DESTDIR}${PREFIX}/awstats/bin
68 ${FIND} ${WRKSRC}/wwwroot/cgi-bin -name \*.orig -exec ${RM} {} \;
69 ${INSTALL_SCRIPT} ${WRKSRC}/wwwroot/cgi-bin/*.pl \
70 ${DESTDIR}${PREFIX}/awstats/cgi-bin
71 ${INSTALL_DATA} ${WRKSRC}/wwwroot/cgi-bin/awstats.model.conf \
72 ${DESTDIR}${PREFIX}/share/examples/awstats/awstats.conf
73 ${INSTALL_DATA} ${WRKSRC}/wwwroot/cgi-bin/plugins/example/example.pm \
74 ${DESTDIR}${PREFIX}/share/examples/awstats/example.pm
75 ${INSTALL_DATA} ${WRKSRC}/wwwroot/cgi-bin/plugins/*.pm \
76 ${DESTDIR}${PREFIX}/awstats/cgi-bin/plugins
78 cd ${WRKSRC}/wwwroot/cgi-bin \
79 && pax -rwpppm ${d} ${DESTDIR}${PREFIX}/awstats/cgi-bin/
80 chown -R ${SHAREOWN}:${SHAREGRP} ${DESTDIR}${PREFIX}/awstats/cgi-bin/${d}
81 find ${DESTDIR}${PREFIX}/awstats/cgi-bin/${d} -type d -print \
82 | xargs chmod ${PKGDIRMODE}
83 find ${DESTDIR}${PREFIX}/awstats/cgi-bin/${d} -type f -print \
84 | xargs chmod ${SHAREMODE}
86 .for d in classes css icon js
87 cd ${WRKSRC}/wwwroot && pax -rwpppm ${d} ${DESTDIR}${PREFIX}/awstats/
88 chown -R ${SHAREOWN}:${SHAREGRP} ${DESTDIR}${PREFIX}/awstats/${d}
89 find ${DESTDIR}${PREFIX}/awstats/${d} -type d -print \
90 | xargs chmod ${PKGDIRMODE}
91 find ${DESTDIR}${PREFIX}/awstats/${d} -type f -print \
92 | xargs chmod ${SHAREMODE}
94 cd ${WRKSRC}/docs && pax -rwpppm . ${DESTDIR}${PREFIX}/share/doc/awstats/
95 chown -R ${DOCOWN}:${DOCGRP} ${DESTDIR}${PREFIX}/share/doc/awstats/
96 find ${DESTDIR}${PREFIX}/share/doc/awstats/ -type d -print \
97 | xargs chmod ${PKGDIRMODE}
98 find ${DESTDIR}${PREFIX}/share/doc/awstats/ -type f -print \
99 | xargs chmod ${DOCMODE}
101 .include "../../mk/bsd.pkg.mk"