source: trunk/dports/perl/p5-termextract/Portfile

Last change on this file was 154393, checked in by mojca@…, 9 months ago

p5-*: remove subports for perl5.22 (#52081)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.8 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 154393 2016-10-28 22:10:07Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           perl5 1.0
6
7perl5.branches      5.24
8perl5.setup         TermExtract 4.11
9categories-append   textproc japanese
10maintainers         hum openmaintainer
11
12description         a Perl module to extract technical terms from texts
13long_description    ${name} is ${description}.
14
15homepage            http://gensen.dl.itc.u-tokyo.ac.jp/termextract.html
16platforms           darwin
17license             Permissive
18
19master_sites        http://gensen.dl.itc.u-tokyo.ac.jp/soft/
20checksums           rmd160  3e0a959facb94021f6c02deb87759097773c2ce5 \
21                    sha256  5810ac304cd646efd39b5a4db2b52090fb7f300160589373afc091dbacd3285b
22
23distname            ${perl5.module}-[strsed ${perl5.moduleversion} {g/\./_/}]
24
25depends_build       port:nkf
26
27if {${perl5.major} != ""} {
28    post-extract {
29        # create TermExtract/JapanesePlainText.pm and SampleScripts/UNIX/ex_JPT.pl for UTF-8.
30        copy ${worksrcpath}/TermExtract/JapanesePlainTextEUC.pm \
31             ${worksrcpath}/TermExtract/JapanesePlainText.pm
32        copy ${worksrcpath}/SampleScripts/UNIX/ex_JPTE.pl \
33             ${worksrcpath}/SampleScripts/UNIX/ex_JPT.pl
34    }
35   
36    patchfiles-append patch-utf8.diff
37
38    post-patch {
39        # convert SampleScripts/UNIX/ex_{chasen,mecab,JPT}.pl for UTF-8.
40        foreach f {ex_chasen.pl ex_mecab.pl ex_JPT.pl} {
41            system -W ${worksrcpath}/SampleScripts/UNIX "nkf --in-place -w ${f}"
42        }
43        # fix perl path.
44        foreach f [glob ${worksrcpath}/TermExtract/*] {
45            reinplace -locale C "s|/usr/local/bin/perl|${perl5.bin}|g" ${f}
46        }
47    }
48
49    post-destroot {
50        # install sample scripts.
51        set scripts_dir ${destroot}${prefix}/share/termextract
52        copy ${worksrcpath}/SampleScripts/UNIX ${scripts_dir}
53        foreach f [glob ${scripts_dir}/*] {
54            reinplace -locale C "s|/usr/local/bin/perl|${perl5.bin}|g" ${f}
55            file attributes ${f} -permissions 0755
56        }
57        # install documents.
58        xinstall -d ${destroot}${prefix}/share/doc
59        set doc_dir ${destroot}${prefix}/share/doc/termextract
60        copy ${worksrcpath}/HTML ${doc_dir}
61        foreach f [glob ${doc_dir}/*] {
62            system -W ${scripts_dir} "nkf --in-place -w ${f}"
63            reinplace -locale C \
64                "s|<head>|<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />|" \
65                ${f}
66        }
67    }
68    livecheck.type      none
69} else {
70    livecheck.type      regex
71    livecheck.url       ${homepage}
72    livecheck.version   [strsed ${perl5.moduleversion} {g/\./_/}]
73    livecheck.regex     ${perl5.module}-(\[0-9_\]+)\\.
74}
Note: See TracBrowser for help on using the repository browser.