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