# -*- 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 120295 2014-05-22 03:40:31Z devans@macports.org $

PortSystem 1.0

name            gutenprint
version         5.2.10
license         GPL-2+
set branch      [join [lrange [split ${version} .] 0 1] .]
categories      print
maintainers     devans
homepage        http://gimp-print.sourceforge.net/
platforms       darwin

description     Gimp Print Plugin
long_description \
    Gutenprint plugin for the Gimp.

universal_variant no

master_sites    sourceforge:gimp-print
use_bzip2       yes

checksums       sha256  431f352b412dfb9809d126a85a37a1fcd1c1826275ace8cdcd4fd9a6ee360e59 \
                rmd160  46d214b3371eaa8aa0fc746eba362068668211ab

depends_lib     path:lib/pkgconfig/gimp-2.0.pc:gimp2

pre-fetch {
    ui_msg "
            This port only installs the Gutenprint plugin for GIMP.
            You can get the complete Gutenprint drivers and utilities - except the gimp plugin - from
            http://gimp-print.sourceforge.net
            "
}

configure.args  --disable-escputil \
                --disable-samples \
                --disable-test \
                --without-cups \
                --without-readline \
                --with-gimp2-as-gutenprint

post-configure {
    foreach i {iconv intl} {
        reinplace "s|${prefix}/lib/lib${i}.dylib|-l${i}|g" \
            ${worksrcpath}/src/main/Makefile
    }
}

post-destroot {
    file delete -force ${destroot}/usr
}

livecheck.type          regex
livecheck.url           ${homepage}
livecheck.regex         >Gutenprint (\[0-9.\]+) is released!<

