diff options
author | mnag <mnag@FreeBSD.org> | 2006-01-24 19:28:47 +0000 |
---|---|---|
committer | mnag <mnag@FreeBSD.org> | 2006-01-24 19:28:47 +0000 |
commit | 2c8d1997f81e9048243e047cd058d389fc79506a (patch) | |
tree | 5b92d1957fe08715e9a55bee7efe51e66b64554b /deskutils/plans | |
parent | 2573bdd414c42b2f5ddafa0d41a5592182b73df5 (diff) | |
download | FreeBSD-ports-2c8d1997f81e9048243e047cd058d389fc79506a.zip FreeBSD-ports-2c8d1997f81e9048243e047cd058d389fc79506a.tar.gz |
- Preserve config files
- Default installation dir are now ${PREFIX}/www/plans instead of ${PREFIX}/www/data/plans
- Bump PORTREVISION
PR: 92280
Submitted by: infofarmer@gmail.com (maintainer)
Diffstat (limited to 'deskutils/plans')
-rw-r--r-- | deskutils/plans/Makefile | 30 | ||||
-rw-r--r-- | deskutils/plans/files/pkg-message.in | 10 | ||||
-rw-r--r-- | deskutils/plans/pkg-plist | 31 |
3 files changed, 55 insertions, 16 deletions
diff --git a/deskutils/plans/Makefile b/deskutils/plans/Makefile index ba279843..437d97a 100644 --- a/deskutils/plans/Makefile +++ b/deskutils/plans/Makefile @@ -8,6 +8,7 @@ PORTNAME= plans PORTVERSION= 7.5.4 +PORTREVISION= 1 CATEGORIES= deskutils www MASTER_SITES= http://www.planscalendar.com/release/:plans \ http://www.planscalendar.com/addons/:addons \ @@ -31,7 +32,7 @@ USE_PERL5_RUN= yes WRKSRC= ${WRKDIR}/${PORTNAME}_${PORTVERSION} -WWWDOCROOT?= www/data +WWWDOCROOT?= www PLANSSUBDIR?= plans PLANSDIR?= ${WWWDOCROOT}/${PLANSSUBDIR} PLIST_SUB+= DIR=${PLANSDIR} @@ -40,9 +41,28 @@ PKGMESSAGE= ${WRKDIR}/pkg-message DIR= ${PREFIX}/${PLANSDIR} SUB_LIST+= DIR=${DIR} +.include <bsd.port.pre.mk> # Need to exists() work + +pre-fetch: +.if exists(${PREFIX}/www/data/plans) + @${ECHO_CMD} "" + @${ECHO_CMD} "*** WARNING ***" + @${ECHO_CMD} "" + @${ECHO_CMD} "Previous version don't preserve config files." + @${ECHO_CMD} "If you need this files, press CTRL+C and" + @${ECHO_CMD} "copy manually your configuration files." + @${ECHO_CMD} "" + @${ECHO_CMD} "" + @sleep 10 +.endif + post-extract: - ${CP} ${_DISTDIR}/powerani.gif ${WRKSRC}/theme/graphics/freebsd.gif - ${CP} ${_DISTDIR}/*.pl ${WRKSRC}/ + @${CP} ${_DISTDIR}/powerani.gif ${WRKSRC}/theme/graphics/freebsd.gif + @${CP} ${_DISTDIR}/*.pl ${WRKSRC}/ + @(for i in ${WRKSRC}/data/*xml ${WRKSRC}/*config.pl; \ + do ${MV} $$i $$i.default; done) + @${SED} -e 's/iso-8859-1/utf-8/' ${WRKSRC}/us_english.pl \ + > ${WRKSRC}/us_english_utf8.pl post-patch: @${RM} -f ${WRKSRC}/theme/plans.template.orig @@ -56,6 +76,8 @@ do-install: @${FIND} ${DIR} -name '*.xml' -exec ${CHMOD} 664 {} \; post-install: + @(for i in ${DIR}/data/*default ${DIR}/*default; \ + do ${CP} -np $$i $${i%.default}; done) @${CAT} ${PKGMESSAGE} -.include <bsd.port.mk> +.include <bsd.port.post.mk> diff --git a/deskutils/plans/files/pkg-message.in b/deskutils/plans/files/pkg-message.in index 680c161..f144066 100644 --- a/deskutils/plans/files/pkg-message.in +++ b/deskutils/plans/files/pkg-message.in @@ -1,4 +1,6 @@ -Plans is now available via http://localhost/plans/ -Please make sure that your webserver is configured to accept -CGI scripts in %%DIR%% -Plans can be configured by editing %%DIR%%/plans_config.pl +=========================================================== +Plans is now installed at %%DIR%% +You'll need to configure your server to accept CGI scripts +in the directory. Plans can be configured by editing +%%DIR%%/plans_config.pl +=========================================================== diff --git a/deskutils/plans/pkg-plist b/deskutils/plans/pkg-plist index 2d0dc37..2b3ae0b 100644 --- a/deskutils/plans/pkg-plist +++ b/deskutils/plans/pkg-plist @@ -1,13 +1,27 @@ -%%DIR%%/data/calendars.xml -%%DIR%%/data/email_reminders.xml -%%DIR%%/data/events.xml -%%DIR%%/data/new_calendars.xml -%%DIR%%/data/pending_actions.xml -%%DIR%%/data/users.xml +@unexec if cmp -s %D/%%DIR%%/data/calendars.xml.default %D/%%DIR%%/data/calendars.xml; then rm -f %D/%%DIR%%/data/calendars.xml; fi +%%DIR%%/data/calendars.xml.default +@exec if [ ! -f %D/%%DIR%%/data/calendars.xml ] ; then cp -p %D/%F %B/calendars.xml; fi +@unexec if cmp -s %D/%%DIR%%/data/email_reminders.xml.default %D/%%DIR%%/data/email_reminders.xml; then rm -f %D/%%DIR%%/data/email_reminders.xml; fi +%%DIR%%/data/email_reminders.xml.default +@exec if [ ! -f %D/%%DIR%%/data/email_reminders.xml ] ; then cp -p %D/%F %B/email_reminders.xml; fi +@unexec if cmp -s %D/%%DIR%%/data/events.xml.default %D/%%DIR%%/data/events.xml; then rm -f %D/%%DIR%%/data/events.xml; fi +%%DIR%%/data/events.xml.default +@exec if [ ! -f %D/%%DIR%%/data/events.xml ] ; then cp -p %D/%F %B/events.xml; fi +@unexec if cmp -s %D/%%DIR%%/data/new_calendars.xml.default %D/%%DIR%%/data/new_calendars.xml; then rm -f %D/%%DIR%%/data/new_calendars.xml; fi +%%DIR%%/data/new_calendars.xml.default +@exec if [ ! -f %D/%%DIR%%/data/new_calendars.xml ] ; then cp -p %D/%F %B/new_calendars.xml; fi +@unexec if cmp -s %D/%%DIR%%/data/pending_actions.xml.default %D/%%DIR%%/data/pending_actions.xml; then rm -f %D/%%DIR%%/data/pending_actions.xml; fi +%%DIR%%/data/pending_actions.xml.default +@exec if [ ! -f %D/%%DIR%%/data/pending_actions.xml ] ; then cp -p %D/%F %B/pending_actions.xml; fi +@unexec if cmp -s %D/%%DIR%%/data/users.xml.default %D/%%DIR%%/data/users.xml; then rm -f %D/%%DIR%%/data/users.xml; fi +%%DIR%%/data/users.xml.default +@exec if [ ! -f %D/%%DIR%%/data/users.xml ] ; then cp -p %D/%F %B/users.xml; fi +@unexec if cmp -s %D/%%DIR%%/plans_config.pl.default %D/%%DIR%%/plans_config.pl; then rm -f %D/%%DIR%%/plans_config.pl; fi +%%DIR%%/plans_config.pl.default +@exec if [ ! -f %D/%%DIR%%/plans_config.pl ] ; then cp -p %D/%F %B/plans_config.pl; fi %%DIR%%/email_reminders.cgi %%DIR%%/gpl.txt %%DIR%%/plans.cgi -%%DIR%%/plans_config.pl %%DIR%%/plans_lib.pl %%DIR%%/theme/color_select.css %%DIR%%/theme/color_select.js @@ -323,6 +337,7 @@ %%DIR%%/theme/upcoming_events.css %%DIR%%/theme/upcoming_events.js %%DIR%%/us_english.pl +%%DIR%%/us_english_utf8.pl %%DIR%%/danish.pl %%DIR%%/de_german.pl %%DIR%%/fr_french.pl @@ -333,4 +348,4 @@ @dirrmtry %%DIR%%/theme @dirrmtry %%DIR%%/sessions @dirrmtry %%DIR%%/data -@unexec rmdir %D/%%DIR%% 2>/dev/null || echo "Note: %D/%%DIR%% not empty -- not deleted!" +@dirrmtry %%DIR%% |