# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 82574 2011-08-15 20:49:00Z ryandesign@macports.org $

PortSystem          1.0

name                pth
version             2.0.7
categories          devel
license             LGPL-2.1+
maintainers         nomaintainer
description         GNU Portable Threads
long_description \
    Pth is a very portable POSIX/ANSI-C based library for Unix platforms \
    which provides non-preemptive priority-based scheduling for multiple \
    threads of execution ("multithreading") inside server applications. All \
    threads run in the same address space of the server application, but \
    each thread has its own individual program-counter, run-time stack, \
    signal mask and errno variable.

platforms           darwin

homepage            http://www.gnu.org/software/pth/
master_sites        gnu

checksums           md5 9cb4a25331a4c4db866a31cbe507c793 \
                    sha1 9a71915c89ff2414de69fe104ae1016d513afeee

configure.args      --mandir=${prefix}/share/man

post-configure {
    reinplace "s|CC -dynamiclib|CC -dynamiclib [get_canonical_archflags]|g" ${worksrcpath}/libtool
}

use_parallel_build  no

post-destroot {
    reinplace -E {s|-arch [a-z0-9_]+||g} \
        ${destroot}${prefix}/bin/pth-config
    
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} ANNOUNCE AUTHORS ChangeLog COPYING \
        HACKING HISTORY INSTALL NEWS PORTING README SUPPORT TESTS THANKS \
        USERS ${destroot}${prefix}/share/doc/${name}
}
