source: trunk/dports/math/crfsuite/Portfile

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

crfsuite: update to 0.12.2; install doc and examples according to the standard file hierarchy; install bench scripts.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.5 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 112687 2013-10-29 14:14:05Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           github 1.0
6
7github.setup        chokkan crfsuite 961809adc379148892022276fc9367dfcb2b680f
8version             0.12.2
9categories          math textproc
10maintainers         hum openmaintainer
11
12description         A fast implementation of Conditional Random Fields (CRFs)
13long_description    CRFsuite is an implementation of Conditional Random Fields (CRFs) \
14                    for labeling sequential data.
15
16homepage            http://www.chokkan.org/software/crfsuite/
17platforms           darwin
18license             BSD
19
20checksums           rmd160  ba5e127e3d8e5d1bb2a344e7e96259bb328f9bb7 \
21                    sha256  8931f215e6f9b230cc2dc440fcd890c37afa3b1df3e8da512c7e74cafba8f0c5
22
23depends_build       port:libtool  \
24                    port:autoconf \
25                    port:automake
26depends_lib         port:liblbfgs
27
28patchfiles          patch-autogen.sh.diff \
29                    patch-configure.in.diff \
30                    patch-bench.diff
31
32pre-configure {
33    system -W ${worksrcpath} "./autogen.sh"
34}
35
36configure.args      --with-liblbfgs=${prefix}
37
38post-destroot {
39    # install additional documents.
40    set dest_doc ${destroot}${prefix}/share/doc/${name}
41    xinstall -d ${dest_doc}
42    xinstall -m 644 -W ${worksrcpath} \
43        AUTHORS COPYING ChangeLog README \
44        ${dest_doc}
45    # install example scripts.
46    xinstall -d ${destroot}${prefix}/share/examples
47    set ex                 ${prefix}/share/examples/${name}
48    copy ${worksrcpath}/example ${destroot}/${ex}
49    # install benchmark scripts.
50    set bench ${ex}/bench
51    copy ${worksrcpath}/bench ${destroot}/${bench}
52    foreach py {bench_crfpp.py bench_crfsgd.py bench_crfsuite.py bench_wapiti.py collect.py} {
53        reinplace "s|@PREFIX@|${prefix}|g" ${destroot}/${bench}/${py}
54        reinplace "s|@BENCH@|${bench}|g"   ${destroot}/${bench}/${py}
55    }
56    reinplace "s|@TEMPLATE_CRFPP@|${prefix}/share/examples/crfpp/chunking/template|g" \
57        ${destroot}/${bench}/bench_crfpp.py
58    reinplace "s|@TEMPLATE_CRFPP@|${prefix}/share/examples/sgd/crf/template|g" \
59        ${destroot}/${bench}/bench_crfsgd.py
60    reinplace "s|@TEMPLATE_WAPITI@|${prefix}/share/examples/wapiti/chpattern.txt|g" \
61        ${destroot}/${bench}/bench_wapiti.py
62}
63
64# Note:
65# To run benchmark scripts in ${prefix}/share/examples/${name}/bench,
66# please install the following ports: wapiti, sgd, crfpp, mallet.
Note: See TracBrowser for help on using the repository browser.