1 # Created by: janos.mohacsi@bsd.hu
8 MASTER_SITES= SF/${PORTNAME}/1._LimeSurvey_stable/${PORTVERSION}+/
9 DISTNAME= ${PORTNAME}${PORTVERSION:S^.^^}plus-build10232-20110608
11 MAINTAINER= jmohacsi@bsd.hu
12 COMMENT= PHP-based survey building and runing system
18 # http://docs.limesurvey.org/Installation&structure=English+Instructions+for+LimeSurvey
19 OPTIONS_DEFINE= PGSQL GD LDAP ZIP
22 PGSQL_DESC= Use PostgreSQL (instead of MySQL)
23 GD_DESC= Install PHP gd extension
24 LDAP_DESC= Install PHP LDAP extension
25 ZIP_DESC= Install PHP zip extension
27 .include <bsd.port.options.mk>
29 # http://docs.limesurvey.org/Installation&structure=English+Instructions+for+LimeSurvey#Make_sure_you_can_use_LimeSurvey_on_your_website
30 .if ${PORT_OPTIONS:MPGSQL}
34 # server is not necessary on this host.
39 .if ${PORT_OPTIONS:MGD}
42 .if ${PORT_OPTIONS:MLDAP}
45 .if ${PORT_OPTIONS:MZIP}
48 USE_PHP+= ctype dom iconv json mbstring pcre \
49 simplexml session xmlwriter
53 PHPSURVEYORURL?= ${PORTNAME}
55 WRKSRC= ${WRKDIR}/${PORTNAME}
57 SUB_FILES= pkg-message
58 SUB_LIST= PHPSURVEYORURL="${PHPSURVEYORURL}" \
59 PHPSURVEYORDIR="${PHPSURVEYORDIR}"
61 PHPSURVEYORDIR= ${WWWDOCROOT}/${PHPSURVEYORURL}
64 ${MKDIR} "${STAGEDIR}${WWWDIR}"
65 .if ${PORT_OPTIONS:MPGSQL}
67 -e 's/^(\$$databasetype[[:space:]]*=[[:space:]]*'"')mysql('"'.*)$$/\1postgres\2/' \
68 -e 's/^(\$$databaseuser[[:space:]]*=[[:space:]]*'"')root('"'.*)$$/\1pgsql\2/' \
69 "${WRKSRC}"/config.php >"${WRKSRC}"/config.php-dist
70 ${RM} "${WRKSRC}"/config.php
72 ${MV} "${WRKSRC}"/config.php "${WRKSRC}"/config.php-dist
74 @cd "${WRKSRC}" && ${COPYTREE_SHARE} . "${STAGEDIR}${WWWDIR}"
75 ${MKDIR} "${STAGEDIR}${WWWDIR}"/tmp
76 ${CHMOD} 755 "${STAGEDIR}${WWWDIR}"/tmp
77 ${CHMOD} 755 "${STAGEDIR}${WWWDIR}"/templates
78 ${CHMOD} 755 "${STAGEDIR}${WWWDIR}"/upload
79 ${CHMOD} -R go-w "${STAGEDIR}${WWWDIR}"/admin
82 @${ECHO_CMD} "@group ${WWWGRP}" >> ${TMPPLIST}
83 @${FIND} -s -d ${STAGEDIR}${WWWDIR}/admin -type f -print | \
84 ${SED} -e "s#${STAGEDIR}${PREFIX}/##g" >> ${TMPPLIST}
85 @${FIND} -s -d ${STAGEDIR}${WWWDIR}/admin -type d -print | \
86 ${SED} -E -e "s#${STAGEDIR}${PREFIX}/#@dir #g" >> ${TMPPLIST}
87 @${ECHO_CMD} "@owner ${WWWOWN}" >> ${TMPPLIST}
88 @${FIND} -s -d ${STAGEDIR}${WWWDIR} ! -path "${STAGEDIR}${WWWDIR}/admin/*" -type f -print | \
89 ${SED} -e "s#${STAGEDIR}${PREFIX}/##g" >> ${TMPPLIST}
90 @${FIND} -s -d ${STAGEDIR}${WWWDIR} -type d ! -path "${STAGEDIR}${WWWDIR}/admin*" -print | \
91 ${SED} -E -e "s#${STAGEDIR}${PREFIX}/#@dir #g" >> ${TMPPLIST}
92 @${ECHO_CMD} "@owner" >> ${TMPPLIST}
93 @${ECHO_CMD} "@group" >> ${TMPPLIST}
95 .include <bsd.port.mk>