# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 65434 2010-03-26 06:47:36Z pguyot@kallisys.net $

PortSystem 1.0

name		        	aspell
version		            0.60.6
revision                3
categories	            textproc
maintainers	            openmaintainer jochen
description	            Spell checker with better logic than ispell
homepage	            http://aspell.net/
platforms	            darwin
use_parallel_build      yes

long_description        Aspell is a spell checker designed to eventually replace ispell. \
                        Aspell's main feature is that it  does a much better job of coming up with \
                        possible suggestions than ispell.

master_sites	        gnu freebsd

checksums	            md5 bc80f0198773d5c05086522be67334eb \
		                sha1 335bcb560e00f59d89ec9e4c4114c325fb0e65f4 \
		                rmd160 315638cc7cc4ce9d3dc09c7e15faf637855d504e

depends_build           port:texinfo
depends_lib             port:gettext

patchfiles              patch-mk-static-filter.pl.diff

configure.env	        LIBS="-L${prefix}/lib"
configure.cflags-append "-I${prefix}/include"
configure.args	        --enable-dict-dir="${prefix}/share/aspell" \
                        --infodir="${prefix}/share/info" \
                        --enable-compile-in-filters
test.run                yes
test.target             check


post-destroot { 
    file copy ${filespath}/u-deva.cmap ${destroot}${prefix}/lib/aspell-0.60/
    file copy ${filespath}/u-deva.cset ${destroot}${prefix}/lib/aspell-0.60/
	file delete -force ${destroot}${prefix}/share/info/dir
}

post-activate {
    system "${prefix}/bin/install-info ${prefix}/share/info/aspell.info ${prefix}/share/info/dir"
    system "${prefix}/bin/install-info ${prefix}/share/info/aspell-dev.info ${prefix}/share/info/dir"
}

notes \
"You must install (at least) one of the language dictionaries after 
installing this port in order for it to work."

variant nls conflicts nonls {
    configure.args-delete --disable-nls
    configure.args-append --enable-nls
}

variant nonls conflicts nls description {Don't include natural language support (default on Mac OS X)} {
    configure.args-delete --enable-nls
    configure.args-append --disable-nls
}

platform macosx {
# gnustep-gui uses aspell and will not work if aspell is linked to gettext because
# gettext is linked to CoreFoundation which is itself linked to the Apple objc runtime
    if { ![variant_isset nls] } {
        default_variants        +nonls
    }
}
