# $Id: Portfile 85196 2011-10-10 23:00:11Z jmr@macports.org $

PortSystem 1.0

name                redland-bindings
version             1.0.13.1
description         Redland RDF Language Bindings
long_description    Redland is a set of free software libraries that provide \
                    support for the Resource Description Framework (RDF). \
                    This package provides higher-level language APIs to \
                    Redland for multiple popular scripting languages.
maintainers         gmail.com:arto.bendiken
categories          www
platforms           darwin
homepage            http://librdf.org/bindings/
master_sites        http://download.librdf.org/source/

checksums           sha1    a3dee2bcd5961917a951544654e147b49bf17434 \
                    rmd160  e07edd593c6e16d399b384268f99231b3c89026a
 
depends_lib         port:redland

pre-configure {
    if {![variant_isset perl5] && ![variant_isset php5] && ![variant_isset python24] && ![variant_isset python25] && ![variant_isset python26] && ![variant_isset ruby] && ![variant_isset tcl] && ![variant_isset lua]} {
        ui_error "You must select at least one variant."
        return -code error "no variant selected"
    }

    foreach {badport badfile} "raptor ${prefix}/include/raptor.h" {
        if {[file exists ${badfile}]} {
            ui_error "${name} cannot be built while ${badport} is active."
            ui_error "Please deactivate ${badport} and try again."
            ui_error "You can reactivate ${badport} again later."
            return -code error "${badport} is installed"
        }
    }
}

variant perl5 {
	depends_lib-append path:bin/perl:perl5
	configure.args-append --with-perl
	configure.perl ${prefix}/bin/perl
}

variant php5 {
	configure.args-append --with-php
	depends_lib-append path:bin/php:php5
}

variant python24 conflicts python25 python26 {
	configure.args-append --with-python --with-python-ldflags="-Wl,-F. -Wl,-F. -bundle ${prefix}/Library/Frameworks/Python.framework/Versions/2.4/Python"
	depends_lib-append port:python24
}

variant python25 conflicts python24 python26 {
	configure.args-append --with-python --with-python-ldflags="-Wl,-F. -Wl,-F. -bundle ${prefix}/Library/Frameworks/Python.framework/Versions/2.5/Python"
	depends_lib-append port:python25
}

variant python26 conflicts python24 python25 {
	configure.args-append --with-python --with-python-ldflags="-Wl,-F. -Wl,-F. -bundle ${prefix}/Library/Frameworks/Python.framework/Versions/2.6/Python"
	depends_lib-append port:python26
}

variant ruby {
	configure.args-append --with-ruby
	depends_lib-append port:ruby
}

variant tcl {
	configure.args-append --with-tcl
	depends_lib-append port:tcl
}

variant lua description {Include Lua binding} {
    configure.args-append --with-lua
    depends_lib-append port:lua
}

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
