Changeset 112683


Ignore:
Timestamp:
Oct 29, 2013, 1:56:28 PM (6 years ago)
Author:
hum@…
Message:

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

Location:
trunk/dports/math/crfpp
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/math/crfpp/Portfile

    r103266 r112683  
    66name                crfpp
    77version             0.58
     8revision            1
    89epoch               1
    910categories          math textproc
     
    2728                    sha256  9d1c0a994f25a5025cede5e1d3a687ec98cd4949bfb2aae13f2a873a13259cb2
    2829
    29 patchfiles          patch-configure.diff
     30patchfiles          patch-configure.diff \
     31                    patch-example.diff
    3032
    3133conflicts           crfpp-devel
     
    3436
    3537post-destroot {
    36     set sharedir ${prefix}/share/${name}
    37     xinstall -d ${destroot}${sharedir}
     38    # install additional documents.
     39    set dest_doc ${destroot}${prefix}/share/doc/${name}
     40    xinstall -d  ${dest_doc}
    3841    xinstall -m 644 -W ${worksrcpath} \
    39         AUTHORS COPYING ChangeLog NEWS README ${destroot}${sharedir}
    40     foreach dir {doc example sdk} {
    41         copy $dir ${destroot}${sharedir}
    42     }
    43     # fix file pathes in exec.sh
    44     set modeldir /tmp
    45     foreach ex {JapaneseNE basenp chunking seg} {
    46         set dir ${sharedir}/example/${ex}
    47         reinplace "s|\\.\\./\\.\\./|${prefix}/bin/|g"     ${destroot}${dir}/exec.sh
    48         foreach file {template train.data test.data} {
    49             reinplace "s| ${file}| ${dir}/${file}|g"      ${destroot}${dir}/exec.sh
    50         }
    51         reinplace "s| model| ${modeldir}/${name}.model|g" ${destroot}${dir}/exec.sh
     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
    5258    }
    5359    # convert to UTF-8
    5460    foreach file {train.data test.data} {
    55         set subdir example/JapaneseNE/${file}
    56         system "nkf -w ${worksrcpath}/${subdir} > ${destroot}${sharedir}/${subdir}"
     61        set path JapaneseNE/${file}
     62        system -W ${worksrcpath}/example "nkf -w ${path} > ${dest_ex}/${path}"
    5763    }
    5864}
Note: See TracChangeset for help on using the changeset viewer.