# $Id: Portfile,v 1.65 2006/06/28 13:56:41 dluke Exp $

PortSystem 1.0
name			subversion
version			1.3.2
categories		devel
maintainers		dluke@geeklair.net
description		A cvs like version control system, but without the suck

long_description	Subversion is a version control system designed to be \
			as similar to cvs(1) as possible, while fixing many \
			outstanding problems with cvs(1).

homepage		http://subversion.tigris.org/
master_sites		http://subversion.tigris.org/downloads/
use_bzip2		yes
checksums		md5 34aaac35a8326eba1c8076ee9e93fb6c

depends_lib		port:expat port:neon \
			port:apr port:apr-util \
			port:db4

test.run		yes
test.target		check
test.env		DYLD_LIBRARY_PATH=`find ${worksrcpath}/subversion -type d -name .libs | xargs echo | sed -e 's/ /:/g'`

patchfiles		patch-Makefile.in

configure.args		--with-berkeley-db=${prefix}/include/db4:${prefix}/lib \
			--with-neon=${prefix} --with-apr=${prefix} \
			--with-apr-util=${prefix} --without-apxs \
			--mandir=\\\${prefix}/share/man \
			--disable-neon-version-check

pre-configure {		reinplace "s|hardcode_direct=yes|hardcode_direct=no|g" \
				${worksrcpath}/configure
			reinplace "s|@@DESTROOT@@|${destroot}|g" \
				${worksrcpath}/configure
			}

post-configure {	reinplace "s|need_relink=yes|need_relink=no|g" \
				${worksrcpath}/libtool
			}

variant mod_dav_svn {	depends_build path:${prefix}/apache2/bin/apxs:apache2
			configure.args-append \
				--with-apxs=${prefix}/apache2/bin/apxs \
				--disable-mod-activation
			configure.args-delete --without-apxs
			}

variant no_neon {	depends_lib-delete	port:neon
			configure.args-append	--without-neon
			configure.args-delete	--with-neon=${prefix}
			}

variant no_bdb {	depends_lib-delete	port:db4
			configure.args-delete	--with-berkeley-db=${prefix}/include/db4:${prefix}/lib
			configure.args-append	--without-berkeley-db
			}

variant mac_os_x_server_mod_dav_svn {	configure.args-append \
						--with-apxs=/opt/apache2/bin/apxs \
						--disable-mod-activation
					configure.args-delete --without-apxs

					post-install {
							ui_warn "This variant (+mac-os-x-server-mod_dav_svn builds against the Apple-supplied apache2 in /opt/apache2 and thus may have problems that the normal variant (+mod_dav_svn) which builds against the darwinports supplied apache2 will not have."
					    		 }      
                       	 		}

variant tools { post-destroot {
				xinstall -d -m 755 ${destroot}${prefix}/share/${name}
				file copy ${worksrcpath}/tools ${destroot}${prefix}/share/${name}/tools
				file copy ${worksrcpath}/contrib ${destroot}${prefix}/share/${name}/contrib
				}
		}
