# -*- 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 56263 2009-08-25 21:44:19Z devans@macports.org $

PortSystem      1.0

name            libsigcxx2
set my_name     libsigc++
version         2.2.4
set branch      [join [lrange [split ${version} .] 0 1] .]
categories      devel
platforms       darwin
maintainers     nomaintainer
description     C++ signal callback system

long_description \
    libsigc++ implements a typesafe callback system for standard C++. It allows you to define signals and to \
    connect those signals to any callback function, either global or a member function, regardless of whether it is \
    static or virtual.

homepage        http://libsigc.sourceforge.net/
master_sites    gnome:sources/libsigc++/${branch}/
distname        libsigc++-${version}
use_bzip2       yes

checksums       md5     e41b3371bf4ebbbe5fc1be6c15c91a4c \
                sha1    cf150596169b038e4fb4fdaec40b7a212e34be03 \
                rmd160  55ce1882dd48ee569d3b953e694a5a7ab6fe0023

set docdir      ${prefix}/share/doc/${my_name}-${version}

post-patch {
    if {! [variant_isset doc]} {
        reinplace -E "/^SUBDIRS/s/docs//" ${worksrcpath}/Makefile.in
    }
}

post-destroot {
    if {! [variant_isset doc]} {
        xinstall -d ${destroot}${docdir}
    }
    xinstall -m 0644 -W ${worksrcpath} AUTHORS COPYING ChangeLog NEWS README TODO \
        ${destroot}${docdir}
}

variant doc description {Install extra documentation} {
    destroot.args  libsigc_docdir=${docdir}/html
}

livecheck.check regex
livecheck.url   http://ftp.gnome.org/pub/GNOME/sources/${my_name}/${branch}/?C=M&O=D
livecheck.regex {libsigc\+\+-(\d+(?:\.\d+)*)}

