# $Id: Portfile 80240 2011-07-07 15:38:42Z jmr@macports.org $

PortSystem 1.0
PortGroup  muniversal 1.0

name			ossp-uuid
version			1.6.2
categories		devel
license			MIT
platforms		darwin
maintainers		nomaintainer
description		ISO-C API and CLI for generating Universally Unique Identifiers
long_description	"${description}"

homepage		http://www.ossp.org/pkg/lib/uuid/
master_sites	ftp://ftp.ossp.org/pkg/lib/uuid/ freebsd
distname		uuid-${version}
checksums		md5     5db0d43a9022a6ebbbc25337ae28942f \
			sha1    3e22126f0842073f4ea6a50b1f59dcb9d094719f \
			rmd160  f9cd513577557c4f1d7de869f80035b8844b56d7

patchfiles		patch-Makefile.in.diff

configure.args	--without-perl \
		--without-php \
		--without-pgsql \
		--includedir=${prefix}/include/ossp

if {[variant_isset universal]} {
    if { ${os.arch} == "i386" } {
        if { ${os.major} >= 10 } {
            set merger_configure_env(ppc) ac_cv_va_copy=yes
        }
        set merger_configure_env(ppc64)   ac_cv_va_copy=yes
    } else {
        set merger_configure_env(i386)    ac_cv_va_copy=yes
        set merger_configure_env(x86_64)  ac_cv_va_copy=yes
    }

    post-configure {
        set all_archs ""
        foreach arch ${universal_archs_to_use} {
            lappend all_archs -arch ${arch}
        }

        # When uuid-config is asked about cflags and ldflags, have all architectures give the same answer.
        foreach arch ${universal_archs_to_use} {
            reinplace "s|-arch \[a-z0-9_\]*|${all_archs}|"  ${worksrcpath}-${arch}/uuid-config
            reinplace "s|-m32|${all_archs}|"                ${worksrcpath}-${arch}/uuid-config
            reinplace "s|-m64|${all_archs}|"                ${worksrcpath}-${arch}/uuid-config
        }
    }
}

test.run		yes
test.target		check

livecheck.type		regex
livecheck.regex		"Stable Version:\[^\\d]*(\\d+(?:\\.\\d+)*)"
