# $Id: Portfile 114324 2013-12-05 08:44:51Z ryandesign@macports.org $

PortSystem 1.0
PortGroup python 1.0

name			py-wordnet
version			1.4
revision		1
license			Artistic-1 MIT
platforms		darwin freebsd
supported_archs	noarch
maintainers		nomaintainer
description		Python interface to the (included) WordNet database
long_description	PyWordNet is a Python interface to the WordNet \
				database of word meanings and lexical relationships. \
				Version 1.7.1 or WordNet - the most recent version of \
				WordNet working with py-wordnet - is included.

homepage		http://pywordnet.sourceforge.net/
master_sites	sourceforge:pywordnet:source \
				http://wordnetcode.princeton.edu/1.7.1:data

python.versions	24

if {${name} ne ${subport}} {
    distfiles		pywordnet-${version}${extract.suffix}:source \
                    WordNet-1.7.1${extract.suffix}:data
    checksums		pywordnet-${version}${extract.suffix} \
                        md5 791c796699d4c2cd6bd37ec32a232561 \
                    WordNet-1.7.1${extract.suffix} \
                        md5 5c8e569339cf7d8e727d884234365508
    patchfiles		patch-wordnet.py.diff
    
    worksrcdir		pywordnet-${version}
    
    post-patch	{
        reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/wordnet.py
    }
    
    post-destroot	{
        xinstall -d -m 755 ${destroot}${prefix}/share/${subport}
        xinstall -m 644 -W ${workpath}/WordNet-1.7.1/dict adj.exc adv.exc \
            cntlist cntlist.rev data.adj data.adv data.noun data.verb \
            index.adj index.adv index.noun index.sense index.verb lexnames \
            noun.exc sentidx.vrb sents.vrb verb.exc \
            ${destroot}${prefix}/share/${subport}
        xinstall -m 644 -W ${build.dir} CHANGES.txt INSTALL.txt LICENSE.txt \
            README.txt index.html ${destroot}${prefix}/share/doc/${subport}
    }
}
