Fixup fromcvs/togit conversion
[pkgsrcv2.git] / www / awstats / Makefile
1 # $NetBSD: Makefile,v 1.47 2012/02/13 22:34:38 gls Exp $
2
3 DISTNAME=       awstats-7.1
4 CATEGORIES=     www
5 MASTER_SITES=   http://www.awstats.org/files/
6
7 MAINTAINER=     minskim@NetBSD.org
8 HOMEPAGE=       http://www.awstats.org/
9 COMMENT=        Free real-time logfile analyzer to get advanced web statistics
10 LICENSE=        gnu-gpl-v2
11
12 PKG_DESTDIR_SUPPORT=    user-destdir
13
14 DIST_SUBDIR=            ${PKGNAME_NOREV}
15
16 NO_BUILD=               yes
17
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
23
24 .include "../../mk/bsd.prefs.mk"
25 .include "options.mk"
26
27 APACHE_USER?=   www
28 APACHE_GROUP?=  www
29
30 PKG_GROUPS_VARS+=       APACHE_GROUP
31 PKG_USERS_VARS=         APACHE_USER
32 BUILD_DEFS+=            VARBASE
33
34 #OWN_DIRS=              ${VARBASE}/awstats
35 OWN_DIRS_PERMS+=        ${VARBASE}/awstats ${APACHE_USER} ${APACHE_GROUP} 0700
36 PKG_SYSCONFSUBDIR=      awstats
37
38 SUBST_CLASSES+=         conf
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.
52
53 CONF_FILES+=    ${PREFIX}/share/examples/awstats/awstats.conf \
54                 ${PKG_SYSCONFDIR}/awstats.model.conf
55
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
62
63 post-extract:
64         find ${WRKSRC} -name .cvsignore -exec rm {} \;
65
66 do-install:
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
77 .for d in lang lib
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}
85 .endfor
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}
93 .endfor
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}
100
101 .include "../../mk/bsd.pkg.mk"