Skip site navigation (1)Skip section navigation (2)
Date:      Mon,  3 Dec 2001 22:35:47 +0100 (CET)
From:      Thierry Thomas <thierry@thomas.as>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/32479: Maintainer-update: better handling of httpd.conf in horde-devel & turba
Message-ID:  <20011203213547.CA5897525@graf.pompo.net>

next in thread | raw e-mail | index | archive | help

>Number:         32479
>Category:       ports
>Synopsis:       Maintainer-update: better handling of httpd.conf in horde-devel & turba
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 03 13:40:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Thierry Thomas
>Release:        FreeBSD 4.4-STABLE i386
>Organization:
Kabbale Eros
>Environment:
System: FreeBSD graf.pompo.net 4.4-STABLE FreeBSD 4.4-STABLE #0: Sun Nov 25 07:49:02 CET 2001 root@graf.pompo.net:/usr/obj/mntsrc/src/sys/GRAF010429 i386


	
>Description:
	Better way of updating httpd.conf to support new applications (e.g.
devel/chora) + some minor improvements.

>How-To-Repeat:
	Apply the enclosed patches.

>Fix:

	This first patch is for www/horde-devel:


diff -ruN www/horde-devel.orig/Makefile www/horde-devel/Makefile
--- www/horde-devel.orig/Makefile	Mon Dec  3 03:36:06 2001
+++ www/horde-devel/Makefile	Mon Dec  3 21:28:55 2001
@@ -36,6 +36,8 @@
 NO_BUILD=	yes
 DOCS=		COPYING README docs/CHANGES docs/CREDITS docs/CODING_STANDARDS \
 		docs/HELP docs/INSTALL docs/RELEASE
+CONFFILE=	html.php lang.php mime_drivers.php mime_mapping.php \
+		motd.php registry.php
 
 LHORDEDIR?=	www/horde
 LHORDESBIN?=	sbin
@@ -44,10 +46,12 @@
 
 HORDEDIR=	${PREFIX}/${LHORDEDIR}
 HORDESBIN=	${PREFIX}/${LHORDESBIN}
+CONFDIR=	${HORDEDIR}/config
 
 APACHE_CNFDIR?=	${LOCALBASE}/etc/apache
 APACHE_CONF=	${APACHE_CNFDIR}/httpd.conf
 PHP_LIB?=	${LOCALBASE}/lib/php
+HORDE_INC=	${PREFIX}/etc/horde
 LOG_FILE?=	/var/log/horde.log
 
 pre-everything::
@@ -59,8 +63,8 @@
 .endif
 	@${ECHO_MSG} ""
 	@${ECHO_MSG} "If you plan to install IMP, it is better to configure"
-	@${ECHO_MSG} "PHP with IMAP, OpenLDAP, OpenSSL, mcrypt, XML, FTP,"
-	@${ECHO_MSG} "gettext, pspell, zlib, MCAL and"
+	@${ECHO_MSG} "PHP with IMAP / IMAP-SSL, OpenLDAP, OpenSSL, mcrypt, XML,"
+	@${ECHO_MSG} "FTP, gettext, pspell, zlib, MCAL and"
 	@${ECHO_MSG} "a database (like MySQL or PostgreSQL)."
 	@${ECHO_MSG} ""
 
@@ -79,63 +83,47 @@
 	fi
 
 do-install:
-	${MKDIR}  ${HORDEDIR}
-	${CP} -Rp ${WRKSRC}/config ${WRKSRC}/graphics ${WRKSRC}/lib ${HORDEDIR}
-	${CP} -Rp ${WRKSRC}/locale ${WRKSRC}/scripts ${WRKSRC}/templates ${HORDEDIR}
-	${CP} -Rp ${WRKSRC}/po ${WRKSRC}/admin ${WRKSRC}/util ${HORDEDIR}
-	${CP} -p  ${WRKSRC}/*.php ${HORDEDIR}
-	@if [ ! -f ${HORDEDIR}/config/horde.php ]; then \
-		${CP} ${HORDEDIR}/config/horde.php.dist ${HORDEDIR}/config/horde.php ; \
+	@${MKDIR}  ${HORDEDIR}
+	@${CP} -Rp ${WRKSRC}/config ${WRKSRC}/graphics ${WRKSRC}/lib ${HORDEDIR}
+	@${CP} -Rp ${WRKSRC}/locale ${WRKSRC}/scripts ${WRKSRC}/templates ${HORDEDIR}
+	@${CP} -Rp ${WRKSRC}/po ${WRKSRC}/admin ${WRKSRC}/util ${HORDEDIR}
+	@${CP} -p  ${WRKSRC}/*.php ${HORDEDIR}
+	@if [ ! -f ${CONFDIR}/horde.php ]; then \
+		${CP} ${CONFDIR}/horde.php.dist ${CONFDIR}/horde.php ; \
 		${PERL} -pi -e "s:/var/www/htdocs/horde/templates:${HORDEDIR}/templates:g" \
-			${HORDEDIR}/config/horde.php ; \
-		${PERL} -pi -e "s:/tmp/horde.log:${LOG_FILE}:g" ${HORDEDIR}/config/horde.php ; \
+			${CONFDIR}/horde.php ; \
+		${PERL} -pi -e "s:/tmp/horde.log:${LOG_FILE}:g" ${CONFDIR}/horde.php ; \
 	fi
-	@if [ ! -f ${HORDEDIR}/config/html.php ]; then \
-		${CP} ${HORDEDIR}/config/html.php.dist ${HORDEDIR}/config/html.php ; \
+.for FILE in ${CONFFILE}
+	@if [ ! -f ${CONFDIR}/${FILE} ]; then \
+	  ${CP} ${CONFDIR}/${FILE}.dist ${CONFDIR}/${FILE} ; \
 	fi
-	@if [ ! -f ${HORDEDIR}/config/lang.php ]; then \
-		${CP} ${HORDEDIR}/config/lang.php.dist ${HORDEDIR}/config/lang.php ; \
-	fi
-	@if [ ! -f ${HORDEDIR}/config/mime_drivers.php ]; then \
-		${CP} ${HORDEDIR}/config/mime_drivers.php.dist ${HORDEDIR}/config/mime_drivers.php ; \
-	fi
-	@if [ ! -f ${HORDEDIR}/config/mime_mapping.php ]; then \
-		${CP} ${HORDEDIR}/config/mime_mapping.php.dist ${HORDEDIR}/config/mime_mapping.php ; \
-	fi
-	@if [ ! -f ${HORDEDIR}/config/motd.php ]; then \
-		${CP} ${HORDEDIR}/config/motd.php.dist ${HORDEDIR}/config/motd.php ; \
-	fi
-	@if [ ! -f ${HORDEDIR}/config/registry.php ]; then \
-		${CP} ${HORDEDIR}/config/registry.php.dist ${HORDEDIR}/config/registry.php ; \
-	fi
-	${CP} ${WRKSRC}/scripts/set_perms.sh ${HORDESBIN}/horde_set_perms.sh
-	${PERL} -pi -e "s:UPDATED_BY_THE_PORT:${HORDEDIR}/:g" ${HORDESBIN}/horde_set_perms.sh
-	 (if [ -f ${APACHE_CONF} ] ; then \
-	    (if [ ! -f ${APACHE_CONF}.beforeHorde ] ; then \
-		${ECHO} "===> Updating ${APACHE_CONF}..." ; \
-		${CP} -p ${FILESDIR}/httpd.conf.horde ${WRKDIR}/httpd.conf.horde ; \
-		${PERL} -pi -e "s:/home/httpd/html/horde:${HORDEDIR}:g" ${WRKDIR}/httpd.conf.horde ; \
-		${PERL} -pi -e "s:/home/httpd/phplib:${PHP_LIB}:g" ${WRKDIR}/httpd.conf.horde ; \
-		${CP} -p ${APACHE_CONF} ${APACHE_CONF}.beforeHorde ; \
-		${GREP} -qw 'Added for Horde' ${APACHE_CONF} || ${CAT} ${WRKDIR}/httpd.conf.horde >> ${APACHE_CONF} ; \
-	    else \
-		${ECHO} "===> Updating ${APACHE_CONF}..." ; \
-		${CP} -p ${APACHE_CONF} ${APACHE_CONF}.reinstHorde ; \
-		${PERL} -pi -e "s:php_value auto_prepend_file:# php_value auto_prepend_file:g" ${APACHE_CONF} ; \
-		${PERL} -pi -e "s:${HORDEDIR}/phplib:${PHP_LIB}:g" ${APACHE_CONF} ; \
-	    fi) ; \
+.endfor
+	@${CP} ${WRKSRC}/scripts/set_perms.sh ${HORDESBIN}/horde_set_perms.sh
+	@${PERL} -pi -e "s:UPDATED_BY_THE_PORT:${HORDEDIR}/:g" ${HORDESBIN}/horde_set_perms.sh
+	@(if [ -f ${APACHE_CONF} ] ; then \
+	    ${MKDIR} ${HORDE_INC} ; \
+	    ${CP} -p ${FILESDIR}/httpd.conf.horde ${HORDE_INC} ; \
+	    ${PERL} -pi -e "s:/home/httpd/html/horde:${HORDEDIR}:g" ${HORDE_INC}/httpd.conf.horde ; \
+	    ${PERL} -pi -e "s:/home/httpd/phplib:${PHP_LIB}:g" ${HORDE_INC}/httpd.conf.horde ; \
+	    ${ECHO_MSG} "===> Updating ${APACHE_CONF}..." ; \
+	    ${CP} -p ${APACHE_CONF} ${APACHE_CONF}.beforeHorde ; \
+	    ${PERL} -pi -e "s:php_value auto_prepend_file:# php_value auto_prepend_file:g" ${APACHE_CONF} ; \
+	    ${PERL} -pi -e "s:${HORDEDIR}/phplib:${PHP_LIB}:g" ${APACHE_CONF} ; \
+	    ${ECHO} "# Horde's include directory" >> ${APACHE_CONF} ; \
+	    ${ECHO} "Include ${HORDE_INC}" >> ${APACHE_CONF} ; \
 	fi)
-	${CHOWN} -R www:www ${HORDEDIR}
-	${CHMOD} -R o-rwx ${HORDEDIR}/config
-	${TOUCH} ${LOG_FILE}
-	${CHOWN} www:www ${LOG_FILE}
+	@${CHOWN} -R www:www ${HORDEDIR}
+	@${CHMOD} -R o-rwx ${CONFDIR}
+	@${TOUCH} ${LOG_FILE}
+	@${CHOWN} www:www ${LOG_FILE}
 .if !defined(NOPORTDOCS)
-	${MKDIR} ${DOCSDIR}
+	@${MKDIR} ${DOCSDIR}
 .for FILE in ${DOCS}
-	${INSTALL_DATA} ${WRKSRC}/${FILE} ${DOCSDIR}
+	@${INSTALL_DATA} ${WRKSRC}/${FILE} ${DOCSDIR}
 .endfor
-	${PERL} -pi -e "s:/usr/local/apache/htdocs/horde:${DOCSDIR}:g" ${DOCSDIR}/INSTALL
-	@${ECHO} "Documentation installed in ${DOCSDIR}."
+	@${PERL} -pi -e "s:/usr/local/apache/htdocs/horde:${DOCSDIR}:g" ${DOCSDIR}/INSTALL
+	@${ECHO_MSG} "===> Documentation installed in ${DOCSDIR}."
 .endif
 
 post-install:
diff -ruN www/horde-devel.orig/files/httpd.conf.horde www/horde-devel/files/httpd.conf.horde
--- www/horde-devel.orig/files/httpd.conf.horde	Mon Dec  3 03:36:06 2001
+++ www/horde-devel/files/httpd.conf.horde	Sun Nov 25 18:11:27 2001
@@ -1,5 +1,5 @@
+# This is included in Apache's httpd.conf for Horde   
 
-# Added for Horde   
 <Directory /home/httpd/html/horde>  
     Options Indexes FollowSymLinks
     AllowOverride None
diff -ruN www/horde-devel.orig/pkg-deinstall www/horde-devel/pkg-deinstall
--- www/horde-devel.orig/pkg-deinstall	Mon Dec  3 03:36:06 2001
+++ www/horde-devel/pkg-deinstall	Sun Nov 25 17:06:56 2001
@@ -8,5 +8,6 @@
 if [ -f ${PKG_PREFIX}/etc/apache/httpd.conf.beforeHorde ] ; then
 	echo "Restoring httpd.conf..."
 	cp ${PKG_PREFIX}/etc/apache/httpd.conf ${PKG_PREFIX}/etc/apache/httpd.conf.deinstHorde
-	mv ${PKG_PREFIX}/etc/apache/httpd.conf.beforeHorde ${PKG_PREFIX}/etc/apache/httpd.conf
+	perl -pi -e "s:Include ${PKG_PREFIX}/etc/horde:# Include ${PKG_PREFIX}/etc/horde:g" \
+		${PKG_PREFIX}/etc/apache/httpd.conf
 fi
diff -ruN www/horde-devel.orig/pkg-descr www/horde-devel/pkg-descr
--- www/horde-devel.orig/pkg-descr	Mon Dec  3 03:36:06 2001
+++ www/horde-devel/pkg-descr	Tue Nov 27 23:55:15 2001
@@ -5,4 +5,6 @@
 included, the preferences system supports global or application scope
 for preferences, and assorted bugs have been fixed.
 
+Horde is used by these ports: mail/imp, mail/turba and devel/chora.
+
 WWW: http://www.horde.org/
diff -ruN www/horde-devel.orig/pkg-message www/horde-devel/pkg-message
--- www/horde-devel.orig/pkg-message	Mon Dec  3 03:36:06 2001
+++ www/horde-devel/pkg-message	Sun Nov 25 18:07:37 2001
@@ -18,7 +18,7 @@
 user used to connect to the horde database.
 Horde is setup by default to access MySQL.
 
-If %%APACHE_CONF%% has been updated,
+Your %%APACHE_CONF%% has been updated,
 you have to restart Apache.
 
 When everything is OK, you should be able to access Horde from
diff -ruN www/horde-devel.orig/pkg-plist www/horde-devel/pkg-plist
--- www/horde-devel.orig/pkg-plist	Mon Dec  3 03:36:06 2001
+++ www/horde-devel/pkg-plist	Sun Nov 25 17:01:40 2001
@@ -233,6 +233,7 @@
 %%HORDEDIR%%/po/zh_CN.po
 %%HORDEDIR%%/po/zh_TW.po
 %%HORDESBIN%%/horde_set_perms.sh
+etc/horde/httpd.conf.horde
 %%PORTDOCS%%share/doc/horde/CHANGES
 %%PORTDOCS%%share/doc/horde/CODING_STANDARDS
 %%PORTDOCS%%share/doc/horde/COPYING
@@ -312,3 +313,4 @@
 @dirrm %%HORDEDIR%%/admin
 @dirrm %%HORDEDIR%%/po
 @dirrm %%HORDEDIR%%
+@dirrm etc/horde




	This second patch is for mail/turba:
N.B.: there is no more pkg-deinstall.


diff -ruN mail/turba.orig/Makefile mail/turba/Makefile
--- mail/turba.orig/Makefile	Mon Dec  3 03:40:11 2001
+++ mail/turba/Makefile	Mon Dec  3 21:46:08 2001
@@ -52,8 +52,7 @@
 TURBADIR=	${PREFIX}/${LTURBADIR}
 CONFDIR=	${TURBADIR}/config
 
-APACHE_CNFDIR?=	${LOCALBASE}/etc/apache
-APACHE_CONF=	${APACHE_CNFDIR}/httpd.conf
+HORDE_INC=	${LOCALBASE}/etc/horde
 
 pre-install:
 # N.B.: database dependencies are binded with mod_php#, neither by Horde nor Turba.
@@ -95,39 +94,32 @@
 .endif
 
 do-install:
-	${MKDIR}  ${TURBADIR}
-	${CP} -Rp ${WRKSRC}/config ${WRKSRC}/graphics ${WRKSRC}/lib ${TURBADIR}
-	${CP} -Rp ${WRKSRC}/locale ${WRKSRC}/scripts ${WRKSRC}/templates ${TURBADIR}
-	${CP} -Rp ${WRKSRC}/po ${TURBADIR}
-	${CP} -p  ${WRKSRC}/*.php ${TURBADIR}
+	@${MKDIR}  ${TURBADIR}
+	@${CP} -Rp ${WRKSRC}/config ${WRKSRC}/graphics ${WRKSRC}/lib ${TURBADIR}
+	@${CP} -Rp ${WRKSRC}/locale ${WRKSRC}/scripts ${WRKSRC}/templates ${TURBADIR}
+	@${CP} -Rp ${WRKSRC}/po ${TURBADIR}
+	@${CP} -p  ${WRKSRC}/*.php ${TURBADIR}
 .for FILE in ${CONFFILE}
 	@if [ ! -f ${CONFDIR}/${FILE} ]; then \
 	  ${CP} ${CONFDIR}/${FILE}.dist ${CONFDIR}/${FILE} ; \
 	fi
 .endfor
-	${CHOWN} -R www:www ${TURBADIR}
-	${CHMOD} -R o-rwx ${CONFDIR}
-	@(if [ -f ${APACHE_CONF} ] ; then \
-	    (if [ ! -f ${APACHE_CONF}.beforeTurba ] ; then \
-		${ECHO} "===> Updating ${APACHE_CONF}..." ; \
-		${CP} -p ${FILESDIR}/httpd.conf.turba ${WRKDIR}/httpd.conf.turba ; \
-		${PERL} -pi -e "s:/home/httpd/html/horde/turba:${TURBADIR}:g" ${WRKDIR}/httpd.conf.turba ; \
-		${CP} -p ${APACHE_CONF} ${APACHE_CONF}.beforeTurba ; \
-		${GREP} -qw 'Added for Turba' ${APACHE_CONF} || ${CAT} ${WRKDIR}/httpd.conf.turba >> ${APACHE_CONF} ; \
-	    fi) ; \
-	fi)
+	@${CHOWN} -R www:www ${TURBADIR}
+	@${CHMOD} -R o-rwx ${CONFDIR}
+	@${CP} -p ${FILESDIR}/httpd.conf.turba ${HORDE_INC}
+	@${PERL} -pi -e "s:/home/httpd/html/horde/turba:${TURBADIR}:g" ${HORDE_INC}/httpd.conf.turba
 .if !defined(NOPORTDOCS)
-	${MKDIR} ${DOCSDIR}
+	@${MKDIR} ${DOCSDIR}
 .for FILE in ${DOCS}
-	${INSTALL_DATA} ${WRKSRC}/${FILE} ${DOCSDIR}
+	@${INSTALL_DATA} ${WRKSRC}/${FILE} ${DOCSDIR}
 .endfor
-	@${ECHO} "Documentation installed in ${DOCSDIR}."
+	@${ECHO_MSG} "===> Documentation installed in ${DOCSDIR}."
 .endif
 
 post-install:
-	@${ECHO}
+	@${ECHO_MSG}
 	@${CAT} ${PKGMESSAGE} | \
-	${SED} -e "s:%%TURBADIR%%:${TURBADIR}:g;s:%%PORTSDIR%%:${PORTSDIR}:g;s:%%CONFDIR%%:${CONFDIR}:g;s:%%APACHE_CONF%%:${APACHE_CONF}:g"
-	@${ECHO}
+	${SED} -e "s:%%TURBADIR%%:${TURBADIR}:g;s:%%PORTSDIR%%:${PORTSDIR}:g;s:%%CONFDIR%%:${CONFDIR}:g"
+	@${ECHO_MSG}
 
 .include <bsd.port.mk>
diff -ruN mail/turba.orig/files/httpd.conf.turba mail/turba/files/httpd.conf.turba
--- mail/turba.orig/files/httpd.conf.turba	Mon Dec  3 03:40:12 2001
+++ mail/turba/files/httpd.conf.turba	Sun Nov 25 18:27:36 2001
@@ -1,5 +1,4 @@
-
-# Added for Turba
+# This is included in Apache's httpd.conf for Turba
 #
 # For security, don't serve pages from the Turba configuration and
 # library directories.
diff -ruN mail/turba.orig/pkg-deinstall mail/turba/pkg-deinstall
--- mail/turba.orig/pkg-deinstall	Mon Dec  3 03:40:11 2001
+++ mail/turba/pkg-deinstall	Thu Jan  1 01:00:00 1970
@@ -1,12 +0,0 @@
-#!/bin/sh
-# Try to restore httpd.conf when deinstalling Turba
-
-if [ x$2 != xDEINSTALL ]; then
-    exit
-fi
-
-if [ -f ${PKG_PREFIX}/etc/apache/httpd.conf.beforeTurba ] ; then
-	echo "Restoring httpd.conf..."
-	cp ${PKG_PREFIX}/etc/apache/httpd.conf ${PKG_PREFIX}/etc/apache/httpd.conf.deinstTurba
-	mv ${PKG_PREFIX}/etc/apache/httpd.conf.beforeTurba ${PKG_PREFIX}/etc/apache/httpd.conf
-fi
diff -ruN mail/turba.orig/pkg-message mail/turba/pkg-message
--- mail/turba.orig/pkg-message	Mon Dec  3 03:40:11 2001
+++ mail/turba/pkg-message	Sun Nov 25 19:04:08 2001
@@ -12,6 +12,5 @@
 You have to create a table in your database; please see
 %%TURBADIR%%/scripts/drivers.
 
-If %%APACHE_CONF%% has been updated,
-you have to restart Apache.
+To protect your configuration files, you have to restart Apache.
 ************************************************************************
diff -ruN mail/turba.orig/pkg-plist mail/turba/pkg-plist
--- mail/turba.orig/pkg-plist	Mon Dec  3 03:40:11 2001
+++ mail/turba/pkg-plist	Sun Nov 25 18:49:06 2001
@@ -119,6 +119,7 @@
 %%TURBADIR%%/templates/wml/search/foot.inc
 %%TURBADIR%%/templates/wml/search/head.inc
 %%TURBADIR%%/templates/wml/search/row.inc
+etc/horde/httpd.conf.turba
 %%PORTDOCS%%@dirrm share/doc/turba
 @dirrm %%TURBADIR%%/config
 @dirrm %%TURBADIR%%/graphics
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011203213547.CA5897525>