# $Id: Portfile,v 1.1 2006/04/21 19:17:09 dluke Exp $ 

PortSystem 1.0
name			subversion-rubybindings
version			1.3.1
categories		devel ruby
maintainers		dluke@geeklair.net
description		Ruby bindings for the subversion version control system.

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). The ruby bindings \
			provide access to subversion API from ruby.

homepage		http://subversion.tigris.org/
master_sites		http://subversion.tigris.org/downloads/
use_bzip2		yes
checksums 		md5 07b95963968ae345541ca99d0e7bf082
distname		subversion-${version}
dist_subdir		subversion

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

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

configure.env		RUBY=${prefix}/bin/ruby
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

build.target		swig-rb
destroot.target		install-swig-rb

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

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

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

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

post-destroot {
		file delete "${destroot}/${prefix}/lib/libsvn_delta-1.0.0.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_delta-1.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_delta-1.a"
		file delete "${destroot}/${prefix}/lib/libsvn_delta-1.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_delta-1.la"
		file delete "${destroot}/${prefix}/lib/libsvn_fs_fs-1.0.0.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_fs_fs-1.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_fs_fs-1.a"
		file delete "${destroot}/${prefix}/lib/libsvn_fs_fs-1.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_fs_fs-1.la"
		file delete "${destroot}/${prefix}/lib/libsvn_subr-1.0.0.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_subr-1.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_subr-1.a"
		file delete "${destroot}/${prefix}/lib/libsvn_subr-1.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_subr-1.la"
        }
