From e5e3f3c4030b3266b6db1d28ada7eeda354b5ac1 Mon Sep 17 00:00:00 2001
From: Jun Kuriyama <kuriyama@FreeBSD.org>
Date: Sat, 3 Jan 2004 05:38:28 +0000
Subject: o Though this port does not support packaging, but fixed pkg-plist  
 while I'm here. o Install mt.cfg as mt.cfg.dist and not overwrite / deinstall
 modified   mt.cfg file.

---
 www/MT/Makefile  | 4 +++-
 www/MT/pkg-plist | 9 ++++++---
 2 files changed, 9 insertions(+), 4 deletions(-)

(limited to 'www')

diff --git a/www/MT/Makefile b/www/MT/Makefile
index 3d8993377cff..c8f4e3a7aaa3 100644
--- a/www/MT/Makefile
+++ b/www/MT/Makefile
@@ -7,6 +7,7 @@
 
 PORTNAME=	MT
 PORTVERSION=	2.65
+PORTREVISION=	1
 CATEGORIES=	www
 
 MAINTAINER=	ports@FreeBSD.org
@@ -57,7 +58,8 @@ do-install:
 	  -e 's/# StaticWebPath/StaticWebPath/g' \
 	  -e 's#path/to/static-files#mt#g' \
 	  -e 's/# NoHTMLEntities 1/NoHTMLEntities 1/g' \
-	  ${WRKSRC}/mt.cfg > ${PREFIX}/${CGIDIR}/mt.cfg
+	  ${WRKSRC}/mt.cfg > ${PREFIX}/${CGIDIR}/mt.cfg.dist
+	[ -e ${PREFIX}/${CGIDIR}/mt.cfg ] || ${CP} ${PREFIX}/${CGIDIR}/mt.cfg.dist ${PREFIX}/${CGIDIR}/mt.cfg
 	${SED} -e 's#$$MT_DIR, .schemas.#"${PREFIX}/${DATADIR}/schemas"#' \
 	  ${WRKSRC}/mt-load.cgi > ${PREFIX}/${CGIDIR}/mt-load.cgi
 	@${ECHO_MSG} "Installing data ${PREFIX}/${DATADIR}"
diff --git a/www/MT/pkg-plist b/www/MT/pkg-plist
index 49893d291b1f..9a5a6c58c678 100644
--- a/www/MT/pkg-plist
+++ b/www/MT/pkg-plist
@@ -189,7 +189,9 @@
 %%CGIDIR%%/mt-tb.cgi
 %%CGIDIR%%/mt-view.cgi
 %%CGIDIR%%/mt-xmlrpc.cgi
-%%CGIDIR%%/mt.cfg
+@unexec cmp %D/%%CGIDIR%%/mt.cfg.dist %D/%%CGIDIR%%/mt.cfg && rm %D/%%CGIDIR%%/mt.cfg || true 2>/dev/null
+%%CGIDIR%%/mt.cfg.dist
+@exec [ -e %D/%%CGIDIR%%/mt.cfg ] || cp %D/%%CGIDIR%%/mt.cfg.dist %D/%%CGIDIR%%/mt.cfg
 %%CGIDIR%%/mt.cgi
 %%CGIDIR%%/search_templates/comments.tmpl
 %%CGIDIR%%/search_templates/default.tmpl
@@ -320,6 +322,8 @@
 %%DATADIR%%/schemas/postgres.dump
 %%DATADIR%%/schemas/sqlite.dump
 %%DATADIR%%/styles.css
+@exec mkdir %D/%%CGIDIR%%/plugins
+@exec chown -R www:www %D/%%CGIDIR%% %D/%%DATADIR%%
 @dirrm %%CGIDIR%%/extlib/Apache/XMLRPC
 @dirrm %%CGIDIR%%/extlib/Apache
 @dirrm %%CGIDIR%%/extlib/CGI
@@ -371,7 +375,6 @@
 @dirrm %%DATADIR%%/images/lang-en-us
 @dirrm %%DATADIR%%/images
 @dirrm %%DATADIR%%/schemas
-@unexec rmdir %D/%%CGIDIR%%/mt/db 2>/dev/null || true
-@unexec rmdir %D/%%CGIDIR%%/mt 2>/dev/null || true
+@unexec rmdir %D/%%CGIDIR%%/db 2>/dev/null || true
 @unexec rmdir %D/%%CGIDIR%% 2>/dev/null || true
 @unexec rmdir %D/%%DATADIR%% 2>/dev/null || true
-- 
cgit v1.2.3