aboutsummaryrefslogtreecommitdiffstats
path: root/www/atutor/Makefile
blob: a243f555a506d61f82dac0ebbedb7d0f83fda0f4 (plain) (blame)
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
# New ports collection makefile for:    atutor
# Date created:     11 Feb 2008
# Whom:         Wen heping <wenheping@gmail.com>
#
# $FreeBSD$
#

PORTNAME=   atutor
PORTVERSION=    1.6
CATEGORIES= www
MASTER_SITES=   http://superb-west.dl.sourceforge.net/sourceforge/atutor/
DISTNAME=   ATutor-${DISTVERSION}

MAINTAINER= wenheping@gmail.com
COMMENT=    An Open Source Web-based Learning Content Management System (LCMS)

USE_PHP=    session mbstring zlib mysql
WRKSRC=     ${WRKDIR}/ATutor

.include <bsd.port.pre.mk>

NO_BUILD=   yes
PLIST=      ${WRKDIR}/plist
SUB_FILES=  pkg-message
SUB_LIST=   ATUTDIR=${ATUTDIR} \
        ATUTDATDIR=${ATUTDATDIR}

ATUTDIR?=   www/atutor
ATUTDATDIR?=    ${ATUTDIR}/content
ATUTCONFIG?=    include/config.inc.php

pre-install:
    @${FIND} -s -d ${WRKSRC} -type f | ${SED} "s?${WRKSRC}?${ATUTDIR}?g" >${PLIST}
    @${ECHO_CMD} @dirrm ${ATUTDATDIR} >> ${PLIST}
    @${FIND} -s -d ${WRKSRC} -type d  | ${SED} "s?${WRKSRC}?@dirrm ${ATUTDIR}?g" >> ${PLIST}

do-install:
    @cd ${WRKSRC} && ${COPYTREE_SHARE} . ${PREFIX}/${ATUTDIR}
    @${CHOWN} ${WWWOWN}:${WWWGRP} ${PREFIX}/${ATUTDIR}
    @${ECHO_CMD} '@exec ${CHOWN} -R ${WWWOWN}:${WWWGRP} \
        ${PREFIX}/${ATUTDIR}' >> ${TMPPLIST}
    @${FIND} ${PREFIX}/${ATUTDIR} -type d -exec ${CHMOD} a+x {} \;
    @${INSTALL} -d ${PREFIX}/${ATUTDATDIR}
    @${CHOWN} ${WWWOWN}:${WWWGRP} ${PREFIX}/${ATUTDATDIR}
    @${ECHO_CMD} '@exec ${INSTALL} -d \
        ${PREFIX}/${ATUTDATDIR}' >> ${TMPPLIST}
    @${ECHO_CMD} '@exec ${CHOWN} -R ${WWWOWN}:${WWWGRP} \
        ${PREFIX}/${ATUTDATDIR}' >> ${TMPPLIST}
    @${CHMOD} 755 ${PREFIX}/${ATUTDATDIR}
    @${ECHO_CMD} '@exec ${CHMOD} 755 ${PREFIX}/${ATUTDATDIR}' >> ${TMPPLIST}
    @${CHMOD} 666 ${PREFIX}/${ATUTDIR}/${ATUTCONFIG}
    @${ECHO_CMD} '@exec ${CHMOD} 666 \
        ${PREFIX}/${ATUTDIR}/${ATUTCONFIG}' >> ${TMPPLIST}
    @${ECHO_CMD} '@exec ${INSTALL} -d \
        ${PREFIX}/${ATUTDIR}/themes/blumin/users' >> ${TMPPLIST}
    @${ECHO_CMD} '@exec ${INSTALL} -d \
        ${PREFIX}/${ATUTDIR}/themes/greenmin/users' >> ${TMPPLIST}

post-install:
    @${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>