aboutsummaryrefslogtreecommitdiffstats
path: root/www/phpmyfaq/Makefile
blob: 977d574b0d2be2ed458510ea19975a00f19aa3e7 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# New ports collection makefile for:    phpmyfaq
# Date created:     2005-04-15
# Whom:         chinsan <chinsan@mail2000.com.tw>
#
# $FreeBSD$
#

PORTNAME=   phpmyfaq
PORTVERSION=    1.5.8
CATEGORIES= www
MASTER_SITES=   http://www.phpmyfaq.de/download/
DISTNAME=   ${PORTNAME}.${PORTVERSION}.full
EXTRACT_SUFX=   .zip

MAINTAINER= babak@farrokhi.net
COMMENT=    A multilingual, completely database-driven FAQ-system

WRKSRC=     ${WRKDIR}/${PORTNAME}.${PORTVERSION}
USE_ZIP=    YES

USE_PHP=    mysql pcre pdf session xml xmlrpc zlib
NO_BUILD=   YES
WANT_PHP_WEB=   YES

pre-fetch:
.if !defined(PHPMYFAQ_URL)
     @${ECHO_MSG} ""
     @${ECHO_MSG} "Define PHPMYFAQ_URL to override default of ${PREFIX}/'${PHPMYFAQ_URL}'."
     @${ECHO_MSG} ""
.endif

# Get HOSTNAME
.if exists(/sbin/sysctl)
HOSTNAME!=  /sbin/sysctl -n kern.hostname
.else
HOSTNAME!=  /usr/sbin/sysctl -n kern.hostname
.endif

WWWDOCROOT?=    www/data
PHPMYFAQ_URL?=  ${WWWDOCROOT}/faq
PLIST=      ${WRKDIR}/pkg-plist

.include <bsd.port.pre.mk>

pre-install:
    cd ${WRKSRC} && ${FIND} -s . \( ! -path "*CVS*" -and -type f \) | \
        ${SED} -e 's|^./||;s|^|${PHPMYFAQ_URL}/|' > ${PLIST} \
        && ${FIND} -d * \( ! -path "*CVS*" -and -type d \) | \
        ${SED} -e 's|^|@dirrm ${PHPMYFAQ_URL}/|' >> ${PLIST} \
        && ${ECHO_CMD} @dirrm ${PHPMYFAQ_URL}/attachments/ >> ${PLIST} \
        && ${ECHO_CMD} @dirrm ${PHPMYFAQ_URL}/data/ >> ${PLIST} \
        && ${ECHO_CMD} @dirrm ${PHPMYFAQ_URL}/pdf/ >> ${PLIST} \
        && ${ECHO_CMD} @dirrm ${PHPMYFAQ_URL}/xml/ >> ${PLIST} \
        && ${ECHO_CMD} @dirrm ${PHPMYFAQ_URL} >> ${PLIST}

do-install:
    # Data files
    -${MKDIR} ${PREFIX}/${PHPMYFAQ_URL}
    @${CHMOD} 755 ${PREFIX}/${PHPMYFAQ_URL}
    @${CP} -R ${WRKSRC}/ ${PREFIX}/${PHPMYFAQ_URL}
    @${MKDIR} ${PREFIX}/${PHPMYFAQ_URL}/attachments/
    @${MKDIR} ${PREFIX}/${PHPMYFAQ_URL}/data/
    @${MKDIR} ${PREFIX}/${PHPMYFAQ_URL}/pdf/
    @${MKDIR} ${PREFIX}/${PHPMYFAQ_URL}/xml/
    # set the correct permissions
    @${CHMOD} 777 ${PREFIX}/${PHPMYFAQ_URL}/inc/
    @${CHMOD} 777 ${PREFIX}/${PHPMYFAQ_URL}/attachments/
    @${CHMOD} 777 ${PREFIX}/${PHPMYFAQ_URL}/data/
    @${CHMOD} 777 ${PREFIX}/${PHPMYFAQ_URL}/images/
    @${CHMOD} 777 ${PREFIX}/${PHPMYFAQ_URL}/pdf/
    @${CHMOD} 777 ${PREFIX}/${PHPMYFAQ_URL}/xml/
    @${FIND} ${PREFIX}/${PHPMYFAQ_URL} \( -type f -and -path "*CVS*" \) | ${XARGS} ${RM}
    @${FIND} ${PREFIX}/${PHPMYFAQ_URL} \( -type d -and -path "*CVS*" \) | ${XARGS} ${RM} -r
    @${CHOWN} -R ${WWWOWN}:${WWWGRP} ${PREFIX}/${PHPMYFAQ_URL}

post-install:
    @${SED} \
     -e 's|%%HOSTNAME%%|${HOSTNAME}|' \
     -e 's|%%PHPMYFAQ_URL%%|${PREFIX}/${PHPMYFAQ_URL}|' ${PKGMESSAGE}

.include <bsd.port.post.mk>