# $Id: Portfile,v 1.16 2006/06/01 17:35:09 dluke Exp $

PortSystem 1.0
name			subversion-pythonbindings
version			1.3.2
categories		devel python
maintainers		dluke@geeklair.net
description		Python 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 python bindings \
			provide access to subversion API from python.

homepage		http://subversion.tigris.org/
master_sites		http://subversion.tigris.org/tarballs/
use_bzip2		yes
checksums 		md5 34aaac35a8326eba1c8076ee9e93fb6c
distname		subversion-${version}
dist_subdir		subversion

depends_lib		port:expat port:neon \
			port:apr port:apr-util \
			port:db4 port:subversion \
			path:${prefix}/bin/python:python24 \
			port:py-bsddb

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 \
			--with-python=${prefix}/bin/python 

build.target		swig-py
destroot.target		install-swig-py DESTDIR=${destroot} 

test.run		yes
test.target		check-swig-py

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 {
		set PYTHON_PATH [exec ${prefix}/bin/python -c "import sys; print (sys.prefix or sys.exec_prefix) + '/lib/python' + sys.version\[0:3\]"]

		xinstall -m 755 -d ${destroot}${PYTHON_PATH}/site-packages
		xinstall -m 755 ${portpath}/${filesdir}/svn-python.pth \
			${destroot}${PYTHON_PATH}/site-packages
		reinplace "s|@PREFIX@|${prefix}|g" \
			${destroot}${PYTHON_PATH}/site-packages/svn-python.pth	

		file delete "${destroot}/${prefix}/lib/libsvn_client-1.0.0.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_fs-1.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_ra_dav-1.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_repos-1.la"
		file delete "${destroot}/${prefix}/lib/libsvn_client-1.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_fs-1.la"
		file delete "${destroot}/${prefix}/lib/libsvn_ra_dav-1.a"
		file delete "${destroot}/${prefix}/lib/libsvn_subr-1.0.0.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_client-1.a"
		file delete "${destroot}/${prefix}/lib/libsvn_fs_base-1.0.0.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_ra_dav-1.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_subr-1.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_client-1.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_fs_base-1.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_ra_dav-1.la"
		file delete "${destroot}/${prefix}/lib/libsvn_subr-1.a"
		file delete "${destroot}/${prefix}/lib/libsvn_client-1.la"
		file delete "${destroot}/${prefix}/lib/libsvn_fs_base-1.a"
		file delete "${destroot}/${prefix}/lib/libsvn_ra_local-1.0.0.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_subr-1.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_delta-1.0.0.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_fs_base-1.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_ra_local-1.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_subr-1.la"
		file delete "${destroot}/${prefix}/lib/libsvn_delta-1.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_fs_base-1.la"
		file delete "${destroot}/${prefix}/lib/libsvn_ra_local-1.a"
		file delete "${destroot}/${prefix}/lib/libsvn_delta-1.a"
		file delete "${destroot}/${prefix}/lib/libsvn_fs_fs-1.0.0.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_ra_local-1.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_delta-1.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_fs_fs-1.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_ra_local-1.la"
		file delete "${destroot}/${prefix}/lib/libsvn_delta-1.la"
		file delete "${destroot}/${prefix}/lib/libsvn_fs_fs-1.a"
		file delete "${destroot}/${prefix}/lib/libsvn_ra_svn-1.0.0.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_diff-1.0.0.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_fs_fs-1.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_ra_svn-1.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_diff-1.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_fs_fs-1.la"
		file delete "${destroot}/${prefix}/lib/libsvn_ra_svn-1.a"
		file delete "${destroot}/${prefix}/lib/libsvn_wc-1.0.0.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_diff-1.a"
		file delete "${destroot}/${prefix}/lib/libsvn_ra-1.0.0.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_ra_svn-1.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_wc-1.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_diff-1.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_ra-1.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_ra_svn-1.la"
		file delete "${destroot}/${prefix}/lib/libsvn_wc-1.a"
		file delete "${destroot}/${prefix}/lib/libsvn_diff-1.la"
		file delete "${destroot}/${prefix}/lib/libsvn_ra-1.a"
		file delete "${destroot}/${prefix}/lib/libsvn_repos-1.0.0.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_wc-1.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_fs-1.0.0.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_ra-1.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_repos-1.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_wc-1.la"
		file delete "${destroot}/${prefix}/lib/libsvn_fs-1.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_ra-1.la"
		file delete "${destroot}/${prefix}/lib/libsvn_repos-1.a"
		file delete "${destroot}/${prefix}/lib/libsvn_fs-1.a"
		file delete "${destroot}/${prefix}/lib/libsvn_ra_dav-1.0.0.0.dylib"
		file delete "${destroot}/${prefix}/lib/libsvn_repos-1.dylib"
		}
