[112683] trunk/dports/math/crfpp
hum at macports.org
hum at macports.org
Tue Oct 29 06:56:28 PDT 2013
Revision: 112683
https://trac.macports.org/changeset/112683
Author: hum at macports.org
Date: 2013-10-29 06:56:28 -0700 (Tue, 29 Oct 2013)
Log Message:
-----------
crfpp: install doc and examples according to the standard file hierarchy; do not expand file pathes in example scripts.
Modified Paths:
--------------
trunk/dports/math/crfpp/Portfile
Added Paths:
-----------
trunk/dports/math/crfpp/files/patch-example.diff
Modified: trunk/dports/math/crfpp/Portfile
===================================================================
--- trunk/dports/math/crfpp/Portfile 2013-10-29 13:53:30 UTC (rev 112682)
+++ trunk/dports/math/crfpp/Portfile 2013-10-29 13:56:28 UTC (rev 112683)
@@ -5,6 +5,7 @@
name crfpp
version 0.58
+revision 1
epoch 1
categories math textproc
maintainers hum openmaintainer
@@ -26,34 +27,39 @@
checksums rmd160 3c70d129f06d88e13ece94d505dd417668f0a7bc \
sha256 9d1c0a994f25a5025cede5e1d3a687ec98cd4949bfb2aae13f2a873a13259cb2
-patchfiles patch-configure.diff
+patchfiles patch-configure.diff \
+ patch-example.diff
conflicts crfpp-devel
depends_build port:nkf
post-destroot {
- set sharedir ${prefix}/share/${name}
- xinstall -d ${destroot}${sharedir}
+ # install additional documents.
+ set dest_doc ${destroot}${prefix}/share/doc/${name}
+ xinstall -d ${dest_doc}
xinstall -m 644 -W ${worksrcpath} \
- AUTHORS COPYING ChangeLog NEWS README ${destroot}${sharedir}
- foreach dir {doc example sdk} {
- copy $dir ${destroot}${sharedir}
+ AUTHORS COPYING doc/index.html \
+ ${dest_doc}
+ # install examples.
+ xinstall -d ${destroot}${prefix}/share/examples
+ set ex ${prefix}/share/examples/${name}
+ set dest_ex ${destroot}${ex}
+ copy ${worksrcpath}/example ${dest_ex}
+ copy ${worksrcpath}/sdk ${dest_ex}
+ # fix file pathes in exec.sh.
+ set model_dir /var/tmp
+ foreach task {JapaneseNE basenp chunking seg} {
+ set dir ${ex}/${task}
+ reinplace "s|@PREFIX@|${prefix}|g" ${destroot}${dir}/exec.sh
+ reinplace "s|@DIR@|${dir}|g" ${destroot}${dir}/exec.sh
+ reinplace "s|@MODEL@|${model_dir}/${name}.model|g" \
+ ${destroot}${dir}/exec.sh
}
- # fix file pathes in exec.sh
- set modeldir /tmp
- foreach ex {JapaneseNE basenp chunking seg} {
- set dir ${sharedir}/example/${ex}
- reinplace "s|\\.\\./\\.\\./|${prefix}/bin/|g" ${destroot}${dir}/exec.sh
- foreach file {template train.data test.data} {
- reinplace "s| ${file}| ${dir}/${file}|g" ${destroot}${dir}/exec.sh
- }
- reinplace "s| model| ${modeldir}/${name}.model|g" ${destroot}${dir}/exec.sh
- }
# convert to UTF-8
foreach file {train.data test.data} {
- set subdir example/JapaneseNE/${file}
- system "nkf -w ${worksrcpath}/${subdir} > ${destroot}${sharedir}/${subdir}"
+ set path JapaneseNE/${file}
+ system -W ${worksrcpath}/example "nkf -w ${path} > ${dest_ex}/${path}"
}
}
Added: trunk/dports/math/crfpp/files/patch-example.diff
===================================================================
--- trunk/dports/math/crfpp/files/patch-example.diff (rev 0)
+++ trunk/dports/math/crfpp/files/patch-example.diff 2013-10-29 13:56:28 UTC (rev 112683)
@@ -0,0 +1,82 @@
+--- example/basenp/exec.sh.orig 2012-09-30 01:44:37.000000000 +0900
++++ example/basenp/exec.sh 2013-10-28 00:06:33.000000000 +0900
+@@ -1,7 +1,11 @@
+ #!/bin/sh
+-../../crf_learn -c 10.0 template train.data model
+-../../crf_test -m model test.data
++bindir=@PREFIX@/bin
++dir=@DIR@
++model=@MODEL@
+
+-../../crf_learn -a MIRA template train.data model
+-../../crf_test -m model test.data
+-rm -f model
++$bindir/crf_learn -c 10.0 $dir/template $dir/train.data $model
++$bindir/crf_test -m $model $dir/test.data
++
++$bindir/crf_learn -a MIRA $dir/template $dir/train.data $model
++$bindir/crf_test -m $model $dir/test.data
++rm -f $model
+--- example/chunking/exec.sh.orig 2012-09-30 01:44:37.000000000 +0900
++++ example/chunking/exec.sh 2013-10-28 00:07:16.000000000 +0900
+@@ -1,11 +1,15 @@
+ #!/bin/sh
+-../../crf_learn -c 4.0 template train.data model
+-../../crf_test -m model test.data
++bindir=@PREFIX@/bin
++dir=@DIR@
++model=@MODEL@
+
+-../../crf_learn -a MIRA template train.data model
+-../../crf_test -m model test.data
++$bindir/crf_learn -c 4.0 $dir/template $dir/train.data $model
++$bindir/crf_test -m $model $dir/test.data
+
+-#../../crf_learn -a CRF-L1 template train.data model
+-#../../crf_test -m model test.data
++$bindir/crf_learn -a MIRA $dir/template $dir/train.data $model
++$bindir/crf_test -m $model $dir/test.data
+
+-rm -f model
++#$bindir/crf_learn -a CRF-L1 $dir/template $dir/train.data $model
++#$bindir/crf_test -m $model $dir/test.data
++
++rm -f $model
+--- example/JapaneseNE/exec.sh.orig 2012-09-30 01:44:37.000000000 +0900
++++ example/JapaneseNE/exec.sh 2013-10-28 00:05:39.000000000 +0900
+@@ -1,7 +1,11 @@
+ #!/bin/sh
+-../../crf_learn -p2 -f 3 -c 4.0 template train.data model
+-../../crf_test -m model test.data
++bindir=@PREFIX@/bin
++dir=@DIR@
++model=@MODEL@
+
+-../../crf_learn -a MIRA -f 3 template train.data model
+-../../crf_test -m model test.data
+-rm -f model
++$bindir/crf_learn -p2 -f 3 -c 4.0 $dir/template $dir/train.data $model
++$bindir/crf_test -m $model $dir/test.data
++
++$bindir/crf_learn -a MIRA -f 3 $dir/template $dir/train.data $model
++$bindir/crf_test -m $model $dir/test.data
++rm -f $model
+--- example/seg/exec.sh.orig 2012-09-30 01:44:37.000000000 +0900
++++ example/seg/exec.sh 2013-10-28 00:07:44.000000000 +0900
+@@ -1,7 +1,11 @@
+ #!/bin/sh
+-../../crf_learn -f 3 -c 4.0 template train.data model
+-../../crf_test -m model test.data
++bindir=@PREFIX@/bin
++dir=@DIR@
++model=@MODEL@
+
+-../../crf_learn -a MIRA -f 3 template train.data model
+-../../crf_test -m model test.data
+-rm -f model
++$bindir/crf_learn -f 3 -c 4.0 $dir/template $dir/train.data $model
++$bindir/crf_test -m $model $dir/test.data
++
++$bindir/crf_learn -a MIRA -f 3 $dir/template $dir/train.data $model
++$bindir/crf_test -m $model $dir/test.data
++rm -f $model
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20131029/5a53e1b9/attachment.html>
More information about the macports-changes
mailing list