From 7b040896425b848fec68c4c3ab03d957576a9d07 Mon Sep 17 00:00:00 2001 From: "Bruce A. Mah" Date: Fri, 23 May 2003 01:31:48 +0000 Subject: Enable building of the mod_dav_svn module if MOD_DAV_SVN is defined. This enables integration of subversion with the Apache 2.0 Web server. While here, remove an unnecessary dependency on an external gdiff program. (pkg_deinstall script snarfed from ports/www/mod_perl) Reviewed by: Craig Rodrigues , tom, Garrett Rooney Approved by: Craig Rodrigues (MAINTAINER) --- devel/subversion/Makefile | 33 ++++++++++++++++++++++-- devel/subversion/pkg-deinstall | 57 ++++++++++++++++++++++++++++++++++++++++++ devel/subversion/pkg-plist | 3 +++ 3 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 devel/subversion/pkg-deinstall (limited to 'devel/subversion') diff --git a/devel/subversion/Makefile b/devel/subversion/Makefile index b08ffe23db57..5404d5a5c113 100644 --- a/devel/subversion/Makefile +++ b/devel/subversion/Makefile @@ -6,6 +6,7 @@ PORTNAME= subversion PORTVERSION= 0.23.0 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= http://subversion.tigris.org/files/documents/15/4218/ MASTER_SITES+= ${MASTER_SITE_LOCAL} @@ -18,8 +19,6 @@ LIB_DEPENDS= db4:${PORTSDIR}/databases/db4 \ neon.23:${PORTSDIR}/www/neon \ expat.4:${PORTSDIR}/textproc/expat2 \ apr-0.9:${PORTSDIR}/devel/apr -RUN_DEPENDS= gdiff3:${PORTSDIR}/textproc/diffutils -BUILD_DEPENDS= gdiff3:${PORTSDIR}/textproc/diffutils INSTALLS_SHLIB= yes USE_LIBTOOL= yes @@ -37,6 +36,26 @@ CONFIGURE_ARGS= --with-ssl \ MAN1= svn.1 svnadmin.1 MANCOMPRESSED= no +.if defined(WITH_MOD_DAV_SVN) +APXS=${LOCALBASE}/sbin/apxs +BUILD_DEPENDS+= ${APXS}:${PORTSDIR}/www/apache2 +RUN_DEPENDS+= ${APXS}:${PORTSDIR}/www/apache2 +CONFIGURE_ARGS+= \ + --with-apxs=${APXS} +PLIST_SUB+= MOD_DAV_SVN="" +.else +PLIST_SUB+= MOD_DAV_SVN="@comment " +PKGDEINSTALL= NONEXISTENT +.endif + +pre-extract: +.if !defined(WITH_MOD_DAV_SVN) + @${ECHO_MSG} + @${ECHO_MSG} "You can enable the mod_dav_svn module for Apache 2.X by defining" + @${ECHO_MSG} "WITH_MOD_DAV_SVN." + @${ECHO_MSG} +.endif + post-extract: @${REINPLACE_CMD} 's/ldb/ldb4/g' ${WRKSRC}/configure @@ -48,6 +67,11 @@ post-configure: @${REINPLACE_CMD} 's/install-swig-py-lib//g' ${WRKSRC}/Makefile @${REINPLACE_CMD} 's/swig-py-lib//g' ${WRKSRC}/Makefile +.if defined(WITH_MOD_DAV_SVN) +pre-install: + ${APXS} -e -S LIBEXECDIR=${PREFIX}/libexec/apache2 -a -n dav libexec/apache2/mod_dav.so +.endif + post-install: install-info ${PREFIX}/info/svn-design.info ${PREFIX}/info/dir .if !defined(NOPORTDOCS) @@ -56,4 +80,9 @@ post-install: install-book-html install-book-pdf install-book-ps .endif +post-deinstall: +.if defined(WITH_MOD_DAV_SVN) + @PKG_PREFIX=${PREFIX} ${SH} ${PKGDEINSTALL} ${PKGNAME} POST-DEINSTALL +.endif + .include diff --git a/devel/subversion/pkg-deinstall b/devel/subversion/pkg-deinstall new file mode 100644 index 000000000000..ced36ce3c20b --- /dev/null +++ b/devel/subversion/pkg-deinstall @@ -0,0 +1,57 @@ +#!/bin/sh +# +# Try to de-activate mod_dav_svn in the installed httpd.conf and warn +# if this fails. +# +# $FreeBSD$ +# + +if [ "$2" != "POST-DEINSTALL" ]; then + exit 0 +fi + +TMPDIR=${TMPDIR:=/tmp} +PKG_TMPDIR=${PKG_TMPDIR:=${TMPDIR}} + +apxscmd=${PKG_PREFIX}/sbin/apxs +tmpdir=${PKG_TMPDIR}/deinstmod_dav_svn.$$ + +if [ ! -x ${apxscmd} ]; then + echo Can\'t find the apxs program: ${apxscmd}. + exit 1 +fi + +confdir=`${apxscmd} -q SYSCONFDIR` + +if [ ! -d ${confdir} ]; then + echo Can\'t find Apache conf dir: ${confdir} + exit 1 +fi + +if [ -f ${confdir}/httpd.conf ]; then + conffile=httpd.conf +fi +if [ -f ${confdir}/httpd.conf.default ]; then + conffile="${conffile} httpd.conf.default" +fi +if [ -z "${conffile}" ]; then + echo Can\'t find either of ${confdir}/httpd.conf or + echo ${confdir}/httpd.conf.default. + exit 1 +fi + +if ! mkdir ${tmpdir}; then + echo Can\'t create temporary directory: ${tmpdir} + exit 1 +fi + +for i in ${conffile}; do + awk '{if (!/^LoadModule dav_svn_module/ && !/^AddModule mod_dav_svn.c/) \ + print $0}' < ${confdir}/$i > ${tmpdir}/$i + echo Removing dav_svn_module from $i in config dir: ${confdir} + cat ${tmpdir}/$i > ${confdir}/$i +done + +rm -rf ${tmpdir} + +exit 0 diff --git a/devel/subversion/pkg-plist b/devel/subversion/pkg-plist index 30212d368781..42650224b487 100644 --- a/devel/subversion/pkg-plist +++ b/devel/subversion/pkg-plist @@ -87,6 +87,9 @@ lib/libsvn_wc-1.a lib/libsvn_wc-1.la lib/libsvn_wc-1.so lib/libsvn_wc-1.so.0 +%%MOD_DAV_SVN%%libexec/apache2/mod_dav_svn.so +%%MOD_DAV_SVN%%@exec %D/sbin/apxs -e -S LIBEXECDIR=%D/libexec/apache2 -a -n dav libexec/apache2/mod_dav.so +%%MOD_DAV_SVN%%@exec %D/sbin/apxs -e -S LIBEXECDIR=%D/libexec/apache2 -a -n dav_svn libexec/apache2/mod_dav_svn.so %%PORTDOCS%%share/doc/subversion/book/images/ch02dia1.png %%PORTDOCS%%share/doc/subversion/book/images/ch02dia2.png %%PORTDOCS%%share/doc/subversion/book/images/ch02dia3.png -- cgit v1.2.3