# $Id: Portfile 75159 2011-01-17 02:00:53Z rmstonecipher@macports.org $

PortSystem          1.0

name                fvwm2
conflicts           fvwm
version             2.5.31
revision            1
description         Version 2.x of FVWM, an X11 window manager.
long_description    FVWM 2.x is an extremely powerful ICCCM-compliant multiple \
                    virtual desktop window manager for the X Window system.
homepage            http://www.fvwm.org/
maintainers         nomaintainer
categories          x11 x11-wm
platforms           darwin
master_sites        ftp://ftp.fvwm.org/pub/fvwm/version-2/ \
                    ftp://ftp.hpc.uh.edu/pub/fvwm/version-2/
distname            fvwm-${version}
use_bzip2           yes

checksums           md5     bc0a64cee2b76a91b1b3f1aa716f564d \
                    sha1    0a59ac1c17f37dbfb1e042f4df3f86a5eb2d719c \
                    rmd160  1361aec9b2738f8f00d3a8a2798d6535b41e8c39

depends_build       port:pkgconfig \
                    port:libxslt

depends_lib         port:xorg-libsm \
                    port:xorg-libXinerama \
                    port:xorg-libXcursor \
                    port:xpm \
                    port:Xft2 \
                    port:libpng \
                    port:librsvg \
                    port:readline

configure.args      --x-includes=${prefix}/include \
                    --x-libraries=${prefix}/lib \
                    --disable-gtk \
                    --without-gnome \
                    --disable-bidi \
                    --disable-nls \
                    --with-ncurses-library=yes \
                    --without-rplay-library \
                    --without-stroke-library

use_autoreconf      yes
autoreconf.args     -fv

# port:gtk1 is not universal

if {[variant_isset gtk] || [variant_isset gnome]} {
        universal_variant   no
}

variant gtk description {Enable support for outdated GTK+ 1.x} {
    configure.args-delete --disable-gtk
    configure.args-append --enable-gtk
    depends_lib-append port:gtk1
}

variant gnome requires gtk description {Enable support for outdated GNOME 1.x} {
    configure.args-delete --without-gnome
    configure.args-append --with-gnome
    depends_lib-append port:gnome-libs
}

variant bidi description {Enable support for bidirection text handling} {
    configure.args-delete --disable-bidi
    depends_lib-append port:fribidi
}

livecheck.type      regexm
livecheck.url       ${homepage}
livecheck.regex     {Latest Unstable Release: &nbsp; </td>\s+.*?<a href="download" >([^<]*)</a>}
