Improvements to mod_dav [patch]

Volker Stolz stolz at i2.informatik.rwth-aachen.de
Fri Aug 27 02:20:26 PDT 2004


Am 26. Aug 2004 um 14:23 CEST schrieb Clement Laforet:
> > - Remove pkg-plist in favour of PLIST_FILES (oh, yeah, great ;)
> > - Automatically follow instructions in apache.conf.mod_dav to setup
> >    the two files req'd for locking to work.
> 
> fine for me. But please use ${WWWOWN} and ${WWWGRP} instead of USER=www.

Okay, changed. I just noticed two more things: Installing from the port
behaves differently from the package since apxs isn't called. I revamped
the *-install-logic so that it does exactly the same in all cases.
Also, I moved the displayed advice from post-install to pkg-message
where everybody can see it and pointed out the already created lock db.
(Like in the previous version, the module is activated immediately)

Sorry for having to bother you again. Cheers,
  Volker
-- 
http://www-i2.informatik.rwth-aachen.de/stolz/ *** PGP *** S/MIME
L-Attriwutgrammatik
-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /usr/freebsdcvs/cvs-ports/ports/www/mod_dav/Makefile,v
retrieving revision 1.14
diff -u -r1.14 Makefile
--- Makefile	18 Aug 2004 16:21:49 -0000	1.14
+++ Makefile	27 Aug 2004 09:06:46 -0000
@@ -18,6 +18,10 @@
 # This port will work with the following version of Apache and anything newer.
 APACHE_VERSION=	1.3.6
 
+PKGDEINSTALL=	${PKGINSTALL}
+PKGMESSAGE=	${WRKSRC}/pkg-message
+PLIST_FILES=	etc/apache/apache.conf.mod_dav libexec/apache/libdav.so
+
 USE_APACHE=	yes
 HAS_CONFIGURE=	yes
 CONFIGURE_ARGS=	--prefix=${PREFIX} \
@@ -43,16 +47,17 @@
 	@/bin/sleep 5
 .endif
 
-post-install:
+do-install:
+	${INSTALL_DATA} ${WRKSRC}/libdav.so ${PREFIX}/libexec/apache
 	${INSTALL_DATA} ${FILESDIR}/apache.conf.mod_dav ${PREFIX}/etc/apache
-	@${ECHO_MSG} "*******************************************************"
-	@${ECHO_MSG} "* Please review the mod_dav configuration in the main"
-	@${ECHO_MSG} "* Apache configuration file."
-	@${ECHO_MSG} "* ${PREFIX}/etc/apache/httpd.conf"
-	@${ECHO_MSG} "*"
-	@${ECHO_MSG} "* Look at the file ${PREFIX}/etc/apache/apache.conf.mod_dav"
-	@${ECHO_MSG} "* for indications on what to do."
-	@${ECHO_MSG} "*"
-	@${ECHO_MSG} "*******************************************************"
+
+post-install:
+.if !defined(PACKAGE_BUILDING)
+	@${SETENV} WWWOWN=${WWWOWN} WWWGRP=${WWWGRP} PKG_PREFIX=${PREFIX} \
+	 ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+.endif
+	@${SED} -e 's+%%PREFIX%%+${PREFIX}+' ${FILESDIR}/pkg-message.in \
+	 > ${PKGMESSAGE}
+	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.mk>
Index: pkg-install
===================================================================
RCS file: pkg-install
diff -N pkg-install
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ pkg-install	27 Aug 2004 09:00:51 -0000
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+CHMOD=/bin/chmod
+CHOWN=/usr/sbin/chown
+TOUCH=/usr/bin/touch
+
+case $2 in
+POST-INSTALL)
+	${PKG_PREFIX}/sbin/apxs -e -a -n dav libdav.so
+	for i in DAVLock.dir DAVLock.pag ; do
+	  ${TOUCH} /var/db/$i
+	  ${CHOWN} ${WWWOWN}:${WWWGRP} /var/db/$i
+	  ${CHMOD} 640 /var/db/$i
+	done
+	;;
+POST-DEINSTALL)
+	${PKG_PREFIX}/sbin/apxs -e -A -n dav libdav.so
+	for i in DAVLock.dir DAVLock.pag ; do
+	  rm -f /var/db/$i
+	done
+	;;
+esac
+exit 0
Index: pkg-plist
===================================================================
RCS file: pkg-plist
diff -N pkg-plist
--- pkg-plist	26 Nov 1999 19:32:19 -0000	1.1.1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,2 +0,0 @@
-etc/apache/apache.conf.mod_dav
-libexec/apache/libdav.so
Index: files/pkg-message.in
===================================================================
RCS file: files/pkg-message.in
diff -N files/pkg-message.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/pkg-message.in	27 Aug 2004 09:07:16 -0000
@@ -0,0 +1,10 @@
+*******************************************************
+* Please review the mod_dav configuration in the main
+* Apache configuration file:
+* %%PREFIX%%/etc/apache/httpd.conf
+*
+* Look at the file %%PREFIX%%/etc/apache/apache.conf.mod_dav
+* for indications on what to do. The default lock database
+* has already been created in /var/db/DAVLock.{dir,pag}.
+*
+*******************************************************


More information about the freebsd-apache mailing list