# $Id: Portfile 67900 2010-05-21 09:19:45Z ryandesign@macports.org $

PortSystem 1.0

name			subversion-perlbindings
version			1.6.11
categories		devel perl
platforms		darwin
maintainers		geeklair.net:dluke
description		Perl bindings for the subversion version control system (svn)

long_description	Subversion (svn) is a version control system designed to be \
			as similar to cvs(1) as possible, while fixing many \
			outstanding problems with cvs(1). The perl bindings \
			provide access to subversion API from perl.

homepage		http://subversion.tigris.org/
master_sites		${homepage}/downloads/
use_bzip2		yes
checksums	md5	75419159b50661092c4137449940b5cc \
		sha1	36cf9d39c14e5bd8d713302ac770c3964fe196b3 \
		rmd160	fbd41610f1044916a84c39bf786332e864d0e6d4

distname		subversion-${version}
dist_subdir		subversion

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

use_parallel_build	no

depends_lib		port:expat port:neon \
			port:apr port:apr-util \
			port:db46 port:subversion \
			path:bin/perl:perl5 \
			port:gettext port:libiconv \
			port:serf port:cyrus-sasl2 \
			port:sqlite3

configure.args		--with-berkeley-db=:${prefix}/include/db46:${prefix}/lib/db46:db-4.6 \
			--with-neon=${prefix} --with-apr=${prefix}/bin/apr-1-config \
			--with-apr-util=${prefix}/bin/apu-1-config --without-apxs \
			--mandir=\\\${prefix}/share/man \
			--disable-neon-version-check --with-serf=${prefix} \
			--with-sasl=${prefix}

configure.env		ac_cv_path_PERL=${prefix}/bin/perl

build.target		swig-pl
destroot.target		install-swig-pl-lib DESTDIR=${destroot} && \
        		cd "${worksrcpath}/subversion/bindings/swig/perl/native" &&\
			make pure_install

destroot.args		INSTALLDIRS=vendor

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 description {Build without support for BerkeleyDB repositories} {
		        depends_lib-delete      port:db46 port:py-bsddb
                        configure.args-delete   --with-berkeley-db=:${prefix}/include/db46:${prefix}/lib/db46:db-4.6
                        configure.args-append   --without-berkeley-db
                        }

variant no_neon description {Build without neon (http/https) support)} {
			depends_lib-delete      port:neon
                        configure.args-append   --without-neon
                        configure.args-delete   --with-neon=${prefix}
                        }

post-destroot {
                foreach packlist [exec find ${destroot} -name .packlist] {
                        ui_info "Fixing packlist ${packlist}"
                        reinplace "s|${destroot}||" ${packlist}
                }
        }

# 10.3 says -> CarbonCore/MacTypes.h: No such file or directory
platform darwin 7 {		configure.args-append \
					--disable-keychain
				}

platform puredarwin {		configure.args-append \
					--disable-keychain
				}

livecheck.type  regex
livecheck.regex {Subversion is (\d+(?:\.\d+)*)}
