# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 79352 2011-06-10 08:07:11Z ryandesign@macports.org $

PortSystem          1.0

name                miniupnpc
epoch               2
version             1.5
revision            2
categories          net
platforms           darwin
license             BSD
maintainers         singingwolfboy openmaintainer
description         Lightweight client for UPnP protocol
long_description    \
    ${description}
    
homepage            http://miniupnp.free.fr/
master_sites        http://miniupnp.free.fr/files/download.php?file=${distname}${extract.suffix}&dummy=
checksums           md5     0efa7498d27c82a56a0300b0c05c4f58 \
                    sha1    53ceae5515a547fed28b93bd5abba517586b0b3e \
                    rmd160  8989965305c56ac89011db7cdaf8955f4bb95eba

use_configure       no

variant universal {}
if {[variant_isset universal]} {
    set archflags ${configure.universal_cflags}
} else {
    set archflags ${configure.cc_archflags}
}

build.args-append   CC="${configure.cc} ${archflags}"

post-patch {
    reinplace "s|-Wl,-install_name,|-Wl,-install_name,${prefix}/lib/|" ${worksrcpath}/Makefile
}

destroot.destdir    PREFIX=${prefix} INSTALLPREFIX=${destroot}${prefix}

livecheck.type      regex
livecheck.url       http://miniupnp.free.fr/files/
livecheck.regex     ${name}-(\\d+(\\.\\d{1,4})+)${extract.suffix}
