source: trunk/dports/math/crfpp/Portfile

Last change on this file was 112683, checked in by hum@…, 4 years ago

crfpp: install doc and examples according to the standard file hierarchy; do not expand file pathes in example scripts.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.4 KB
Line 
1# -*- 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
2# $Id: Portfile 112683 2013-10-29 13:56:28Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                crfpp
7version             0.58
8revision            1
9epoch               1
10categories          math textproc
11maintainers         hum openmaintainer
12
13description         Yet Another CRF toolkit
14long_description    CRF++ is a simple, customizable, and open source implementation \
15                    of Conditional Random Fields (CRFs) for segmenting/labeling \
16                    sequential data. \
17                    CRF++ is designed for generic purpose and will be applied to \
18                    a variety of NLP tasks, such as Named Entity Recognition, \
19                    Information Extraction and Text Chunking.
20
21homepage            http://code.google.com/p/crfpp/
22platforms           darwin
23license             LGPL-3+ BSD
24
25master_sites        googlecode:crfpp
26distname            CRF++-${version}
27checksums           rmd160  3c70d129f06d88e13ece94d505dd417668f0a7bc \
28                    sha256  9d1c0a994f25a5025cede5e1d3a687ec98cd4949bfb2aae13f2a873a13259cb2
29
30patchfiles          patch-configure.diff \
31                    patch-example.diff
32
33conflicts           crfpp-devel
34
35depends_build       port:nkf
36
37post-destroot {
38    # install additional documents.
39    set dest_doc ${destroot}${prefix}/share/doc/${name}
40    xinstall -${dest_doc}
41    xinstall -m 644 -W ${worksrcpath} \
42        AUTHORS COPYING doc/index.html \
43        ${dest_doc}
44    # install examples.
45    xinstall -d ${destroot}${prefix}/share/examples
46    set ex                 ${prefix}/share/examples/${name}
47    set dest_ex ${destroot}${ex}
48    copy ${worksrcpath}/example ${dest_ex}
49    copy ${worksrcpath}/sdk     ${dest_ex}
50    # fix file pathes in exec.sh.
51    set model_dir /var/tmp
52    foreach task {JapaneseNE basenp chunking seg} {
53        set dir ${ex}/${task}
54        reinplace "s|@PREFIX@|${prefix}|g" ${destroot}${dir}/exec.sh
55        reinplace "s|@DIR@|${dir}|g"       ${destroot}${dir}/exec.sh
56        reinplace "s|@MODEL@|${model_dir}/${name}.model|g" \
57            ${destroot}${dir}/exec.sh
58    }
59    # convert to UTF-8
60    foreach file {train.data test.data} {
61        set path JapaneseNE/${file}
62        system -W ${worksrcpath}/example "nkf -w ${path} > ${dest_ex}/${path}"
63    }
64}
65
66livecheck.regex     CRF\\+\\+-(\[0-9.\]+)\\.
Note: See TracBrowser for help on using the repository browser.