diff options
Diffstat (limited to 'mail/squirrelmail/Makefile')
-rw-r--r-- | mail/squirrelmail/Makefile | 71 |
1 files changed, 66 insertions, 5 deletions
diff --git a/mail/squirrelmail/Makefile b/mail/squirrelmail/Makefile index 3e8fab5a4d07..2dd523628b2a 100644 --- a/mail/squirrelmail/Makefile +++ b/mail/squirrelmail/Makefile @@ -7,6 +7,7 @@ PORTNAME= squirrelmail PORTVERSION= 1.4.2 +PORTREVISION= 1 CATEGORIES?= mail www MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= squirrelmail @@ -23,18 +24,78 @@ RUN_DEPENDS+= ${LOCALBASE}/libexec/apache/libphp4.so:${PORTSDIR}/www/mod_php4 .endif USE_BZIP2= yes -NO_BUILD= yes + +.ifndef WITHOUT_WWWDIR +SQUIRRELDIR?= ${PREFIX}/www/squirrelmail +.else +SQUIRRELDIR?= ${PREFIX}/squirrelmail +.endif + +PKGDEINSTALL= ${WRKDIR}/pkg-deinstall +PKGINSTALL= ${WRKDIR}/pkg-install +PKGMESSAGE= ${WRKDIR}/pkg-message + +PLIST_SUB+= PORTVERSION=${PORTVERSION} \ + SQUIRRELDIR="${SQUIRRELDIR:S,^${PREFIX}/,,}" + +pre-everything:: + @${ECHO_CMD} "SquirrelMail is installed into ${SQUIRRELDIR}" + @${ECHO_CMD} "To use the old location ${PREFIX}/squirrelmail define" + @${ECHO_CMD} "WITHOUT_WWWDIR when patching or installing" + @${ECHO_CMD} + +post-patch: +.ifndef PATCH_DEBUG + @${RM} ${WRKSRC}/config/config_default.php.orig +.endif + @${SED} -e "s;%%SQUIRRELDIR%%;${SQUIRRELDIR};g" \ + ${.CURDIR}/pkg-install > ${PKGINSTALL} + @${SED} -e "s;%%SQUIRRELDIR%%;${SQUIRRELDIR};g" \ + ${.CURDIR}/pkg-deinstall > ${PKGDEINSTALL} + @${SED} -e "s;%%SQUIRRELDIR%%;${SQUIRRELDIR};g" \ + ${.CURDIR}/pkg-message > ${PKGMESSAGE} + +# Rearrange the documentation +do-build: +.for file in AUTHORS ChangeLog COPYING INSTALL README UPGRADE + @${MV} ${WRKSRC}/${file} ${WRKSRC}/doc/ +.endfor + @${MV} ${WRKSRC}/ReleaseNotes ${WRKSRC}/doc/ReleaseNotes-${PORTVERSION} + @${MV} ${WRKSRC}/themes/README.themes ${WRKSRC}/doc/ + @cd ${WRKSRC} ; for f in `find plugins -name "README*" -or \ + -name INSTALL -or -name CHANGES -or -name HISTORY`; \ + do \ + ${MKDIR} doc/`dirname $$f` ; \ + ${MV} $$f doc/`dirname $$f` ; \ + done; \ + ${MV} doc/plugins/squirrelspell/doc/README doc/plugins/squirrelspell ; \ + ${RM} -rf doc/plugins/squirrelspell/doc ; \ + ${MV} plugins/squirrelspell/doc/* doc/plugins/squirrelspell ; \ + ${RM} -f doc/plugins/squirrelspell/index.php ; \ + ${RM} -rf plugins/squirrelspell/doc + @${ECHO} "left_refresh=300" >> ${WRKSRC}/data/default_pref pre-install: @${ECHO} "Your umask should be lax while installing this. Like, 022 or something." @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL do-install: - ${MKDIR} ${PREFIX}/squirrelmail - ${CP} -R ${WRKSRC}/* ${PREFIX}/squirrelmail - ${CHOWN} -R www:www ${PREFIX}/squirrelmail/data + ${MKDIR} ${PREFIX}/etc/periodic/daily + ${INSTALL_SCRIPT} ${FILESDIR}/111.clean-squirrelmail ${PREFIX}/etc/periodic/daily + ${MKDIR} ${SQUIRRELDIR} + ${CP} -p ${WRKSRC}/index.php ${SQUIRRELDIR} + ${CP} -p ${WRKSRC}/configure ${SQUIRRELDIR} +.for DIR in class config data functions help images include locale plugins po src themes + ${CP} -rp ${WRKSRC}/${DIR} ${SQUIRRELDIR} +.endfor + ${CHOWN} -R ${WWWOWN}:${WWWGRP} ${SQUIRRELDIR}/data +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} + ${CP} -R ${WRKSRC}/doc/* ${DOCSDIR} +.endif post-install: - @${SED} -e 's,%%PREFIX%%,${PREFIX},g' ${PKGMESSAGE} + #@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL + @${CAT} ${PKGMESSAGE} .include <bsd.port.mk> |