[154202] trunk/dports/textproc/extractopinion

mojca at macports.org mojca at macports.org
Mon Oct 24 13:53:58 CEST 2016


Revision: 154202
          https://trac.macports.org/changeset/154202
Author:   mojca at macports.org
Date:     2016-10-24 13:53:58 +0200 (Mon, 24 Oct 2016)
Log Message:
-----------
extractopinion: properly patch paths to perl

Modified Paths:
--------------
    trunk/dports/textproc/extractopinion/Portfile
    trunk/dports/textproc/extractopinion/files/patch-crftrain.sh.diff
    trunk/dports/textproc/extractopinion/files/patch-extract.sh.diff
    trunk/dports/textproc/extractopinion/files/patch-lib_tsv.pm.diff
    trunk/dports/textproc/extractopinion/files/patch-makemdl.sh.diff
    trunk/dports/textproc/extractopinion/files/patch-perl.diff

Modified: trunk/dports/textproc/extractopinion/Portfile
===================================================================
--- trunk/dports/textproc/extractopinion/Portfile	2016-10-24 08:24:17 UTC (rev 154201)
+++ trunk/dports/textproc/extractopinion/Portfile	2016-10-24 11:53:58 UTC (rev 154202)
@@ -2,6 +2,7 @@
 # $Id$
 
 PortSystem          1.0
+PortGroup           perl5 1.0
 
 name                extractopinion
 version             1.2
@@ -26,10 +27,12 @@
                     patch-lib_tsv.pm.diff \
                     patch-perl.diff
 
+perl5.branches      5.24
+
 depends_lib         port:crfpp \
                     port:libiconv \
                     port:gawk \
-                    port:p5.24-text-csv_xs \
+                    port:p${perl5.major}-text-csv_xs \
                     port:juman6 \
                     port:knp3
 
@@ -41,6 +44,13 @@
     copy ${filespath}/Makefile ${worksrcpath}
 }
 
+post-patch {
+    foreach script {extract.sh makemdl.sh lib/in2tsv.pl lib/tsv2out.pl \
+                    makemodel/csv/csv2tsv.pl makemodel/csv/csv2tsv.sh} {
+        reinplace "s|@PERL@|${perl5.bin}|" ${worksrcpath}/${script}
+    }
+}
+
 build.args          CC=${configure.cc} CFLAGS="${configure.cflags} [get_canonical_archflags]"
 
 destroot {
@@ -55,10 +65,6 @@
                         xpr/otag2tsv xpr/tsv2tag} {
         reinplace -locale C "s|/usr/bin/gawk|${prefix}/bin/gawk|" ${worksrcpath}/${script}.awk
     }
-    foreach script {extract.sh lib/in2tsv.pl lib/tsv2out.pl makemdl.sh \
-                        makemodel/csv/csv2tsv.pl makemodel/csv/csv2tsv.sh} {
-        reinplace -locale C "s|@prefix@|${prefix}|" ${worksrcpath}/${script}
-    }
     copy ${worksrcpath}/extract.sh ${destroot}${prefix}/bin/extractopinion.sh
     copy ${worksrcpath}/makemdl.sh ${destroot}${prefix}/bin/extractopinion-makemdl.sh
     copy ${worksrcpath}            ${destroot}${prefix}/share

Modified: trunk/dports/textproc/extractopinion/files/patch-crftrain.sh.diff
===================================================================
--- trunk/dports/textproc/extractopinion/files/patch-crftrain.sh.diff	2016-10-24 08:24:17 UTC (rev 154201)
+++ trunk/dports/textproc/extractopinion/files/patch-crftrain.sh.diff	2016-10-24 11:53:58 UTC (rev 154202)
@@ -1,5 +1,5 @@
---- src/crftrain.sh.orig	2012-03-01 09:38:37.000000000 +0900
-+++ src/crftrain.sh	2012-03-07 01:36:37.000000000 +0900
+--- src/crftrain.sh.orig
++++ src/crftrain.sh
 @@ -21,6 +21,6 @@
  tagfile=$tmp/crftrain.$$.tag
  

Modified: trunk/dports/textproc/extractopinion/files/patch-extract.sh.diff
===================================================================
--- trunk/dports/textproc/extractopinion/files/patch-extract.sh.diff	2016-10-24 08:24:17 UTC (rev 154201)
+++ trunk/dports/textproc/extractopinion/files/patch-extract.sh.diff	2016-10-24 11:53:58 UTC (rev 154202)
@@ -1,6 +1,12 @@
---- extract.sh.orig	2012-03-01 09:38:37.000000000 +0900
-+++ extract.sh	2012-03-07 01:30:02.000000000 +0900
-@@ -20,13 +20,35 @@
+--- extract.sh.orig
++++ extract.sh
+@@ -15,18 +15,41 @@ fi
+ dir=`cd $(dirname $0) && pwd`
+ . $dir/conf.sh
+ 
++PERL=@PERL@
+ export LANG=C
+ export LC_ALL=C
  export EXOPLIB=$dir/lib
  export EXOPDIC=$dir/dic
  
@@ -33,8 +39,9 @@
  # $B;XDjJ8;z%3!<%I$O4D6-$K$h$C$FI=5-$,0c$&$?$a(Biconv -l$B$G3NG'(B
 -iconv -c -f UTF-8 -t EUC-JP < $1 > $1.euc
 -perl -I $EXOPLIB $EXOPLIB/in2tsv.pl $1.euc $2 > $tsvfile
+-$dir/_extract.sh $model $tsvfile | perl -I $EXOPLIB $EXOPLIB/tsv2out.pl
 +iconv -c -f UTF-8 -t EUC-JP < $file_name > $euc_file
-+perl -I $EXOPLIB $EXOPLIB/in2tsv.pl $euc_file $topic_str > $tsvfile
- $dir/_extract.sh $model $tsvfile | perl -I $EXOPLIB $EXOPLIB/tsv2out.pl
++$PERL -I $EXOPLIB $EXOPLIB/in2tsv.pl $euc_file $topic_str > $tsvfile
++$dir/_extract.sh $model $tsvfile | $PERL -I $EXOPLIB $EXOPLIB/tsv2out.pl
  
  rm -f $tsvfile

Modified: trunk/dports/textproc/extractopinion/files/patch-lib_tsv.pm.diff
===================================================================
--- trunk/dports/textproc/extractopinion/files/patch-lib_tsv.pm.diff	2016-10-24 08:24:17 UTC (rev 154201)
+++ trunk/dports/textproc/extractopinion/files/patch-lib_tsv.pm.diff	2016-10-24 11:53:58 UTC (rev 154202)
@@ -1,5 +1,5 @@
---- lib/tsv.pm.orig	2012-03-01 09:38:37.000000000 +0900
-+++ lib/tsv.pm	2012-03-07 01:40:10.000000000 +0900
+--- lib/tsv.pm.orig
++++ lib/tsv.pm
 @@ -11,7 +11,7 @@
  use utf8;
  binmode STDOUT, ":encoding(utf8)";

Modified: trunk/dports/textproc/extractopinion/files/patch-makemdl.sh.diff
===================================================================
--- trunk/dports/textproc/extractopinion/files/patch-makemdl.sh.diff	2016-10-24 08:24:17 UTC (rev 154201)
+++ trunk/dports/textproc/extractopinion/files/patch-makemdl.sh.diff	2016-10-24 11:53:58 UTC (rev 154202)
@@ -1,5 +1,5 @@
---- makemdl.sh.orig	2012-03-01 09:38:37.000000000 +0900
-+++ makemdl.sh	2012-03-07 01:36:42.000000000 +0900
+--- makemdl.sh.orig
++++ makemdl.sh
 @@ -6,19 +6,48 @@
  
  export LANG=C
@@ -49,7 +49,7 @@
 +for file in $csvfiles
 +do
 +  f=`basename $file .csv`
-+  perl -I $dir/lib $dir/makemodel/csv/csv2tsv.pl $file > $workdir/tsv/$f.tsv
++  @PERL@ -I $dir/lib $dir/makemodel/csv/csv2tsv.pl $file > $workdir/tsv/$f.tsv
 +done
 +
 +cat $workdir/tsv/*.tsv > $workdir/data.tsv

Modified: trunk/dports/textproc/extractopinion/files/patch-perl.diff
===================================================================
--- trunk/dports/textproc/extractopinion/files/patch-perl.diff	2016-10-24 08:24:17 UTC (rev 154201)
+++ trunk/dports/textproc/extractopinion/files/patch-perl.diff	2016-10-24 11:53:58 UTC (rev 154202)
@@ -1,96 +1,35 @@
-*** extract.sh.orig	Mon Jul  9 21:55:38 2012
---- extract.sh	Sat Jul 14 10:18:41 2012
-***************
-*** 48,54 ****
-  #nkf -e -W --fb-skip < $1 > $1.euc
-  # $B;XDjJ8;z%3!<%I$O4D6-$K$h$C$FI=5-$,0c$&$?$a(Biconv -l$B$G3NG'(B
-  iconv -c -f UTF-8 -t EUC-JP < $file_name > $euc_file
-! perl -I $EXOPLIB $EXOPLIB/in2tsv.pl $euc_file $topic_str > $tsvfile
-! $dir/_extract.sh $model $tsvfile | perl -I $EXOPLIB $EXOPLIB/tsv2out.pl
-  
-  rm -f $tsvfile
---- 48,54 ----
-  #nkf -e -W --fb-skip < $1 > $1.euc
-  # $B;XDjJ8;z%3!<%I$O4D6-$K$h$C$FI=5-$,0c$&$?$a(Biconv -l$B$G3NG'(B
-  iconv -c -f UTF-8 -t EUC-JP < $file_name > $euc_file
-! @prefix@/bin/perl5.12 -I $EXOPLIB $EXOPLIB/in2tsv.pl $euc_file $topic_str > $tsvfile
-! $dir/_extract.sh $model $tsvfile | @prefix@/bin/perl5.12 -I $EXOPLIB $EXOPLIB/tsv2out.pl
-  
-  rm -f $tsvfile
-*** lib/in2tsv.pl.orig	Thu Mar  1 09:38:37 2012
---- lib/in2tsv.pl	Sat Jul 14 10:17:49 2012
-***************
-*** 1,4 ****
-! #!/bin/env perl
-  
-  #
-  # Copyright(C) 2007-2012 National Institute of Information and Communications Technology
---- 1,4 ----
-! #!@prefix@/bin/perl5.12
-  
-  #
-  # Copyright(C) 2007-2012 National Institute of Information and Communications Technology
-*** lib/tsv2out.pl.orig	Thu Mar  1 09:38:37 2012
---- lib/tsv2out.pl	Sat Jul 14 10:18:02 2012
-***************
-*** 1,4 ****
-! #!/bin/env perl
-  
-  #
-  # Copyright(C) 2007-2012 National Institute of Information and Communications Technology
---- 1,4 ----
-! #!@prefix@/bin/perl5.12
-  
-  #
-  # Copyright(C) 2007-2012 National Institute of Information and Communications Technology
-*** makemdl.sh.orig	Mon Jul  9 21:55:38 2012
---- makemdl.sh	Sat Jul 14 10:19:14 2012
-***************
-*** 42,48 ****
-  for file in $csvfiles
-  do
-    f=`basename $file .csv`
-!   perl -I $dir/lib $dir/makemodel/csv/csv2tsv.pl $file > $workdir/tsv/$f.tsv
-  done
-  
-  cat $workdir/tsv/*.tsv > $workdir/data.tsv
---- 42,48 ----
-  for file in $csvfiles
-  do
-    f=`basename $file .csv`
-!   @prefix@/bin/perl5.12 -I $dir/lib $dir/makemodel/csv/csv2tsv.pl $file > $workdir/tsv/$f.tsv
-  done
-  
-  cat $workdir/tsv/*.tsv > $workdir/data.tsv
-*** makemodel/csv/csv2tsv.pl.orig	Thu Mar  1 09:38:37 2012
---- makemodel/csv/csv2tsv.pl	Sat Jul 14 10:16:06 2012
-***************
-*** 1,4 ****
-! #!/bin/env perl
-  
-  #
-  # Copyright(C) 2007-2012 National Institute of Information and Communications Technology
---- 1,4 ----
-! #!@prefix@/bin/perl5.12
-  
-  #
-  # Copyright(C) 2007-2012 National Institute of Information and Communications Technology
-*** makemodel/csv/csv2tsv.sh.orig	Thu Mar  1 09:38:37 2012
---- makemodel/csv/csv2tsv.sh	Sat Jul 14 10:15:35 2012
-***************
-*** 8,14 ****
-  for f in *.csv
-  do
-    f=`basename $f .csv`
-!   perl -I ../../lib ./csv2tsv.pl $f.csv > ../tsv/$f.tsv
-  done
-  
-  
---- 8,14 ----
-  for f in *.csv
-  do
-    f=`basename $f .csv`
-!   @prefix@/bin/perl5.12 -I ../../lib ./csv2tsv.pl $f.csv > ../tsv/$f.tsv
-  done
-  
-  
+--- lib/in2tsv.pl.orig
++++ lib/in2tsv.pl
+@@ -1,4 +1,4 @@
+-#!/bin/env perl
++#!@PERL@
+ 
+ #
+ # Copyright(C) 2007-2012 National Institute of Information and Communications Technology
+--- lib/tsv2out.pl.orig
++++ lib/tsv2out.pl
+@@ -1,4 +1,4 @@
+-#!/bin/env perl
++#!@PERL@
+ 
+ #
+ # Copyright(C) 2007-2012 National Institute of Information and Communications Technology
+--- makemodel/csv/csv2tsv.pl.orig
++++ makemodel/csv/csv2tsv.pl
+@@ -1,4 +1,4 @@
+-#!/bin/env perl
++#!@PERL@
+ 
+ #
+ # Copyright(C) 2007-2012 National Institute of Information and Communications Technology
+--- makemodel/csv/csv2tsv.sh.orig
++++ makemodel/csv/csv2tsv.sh
+@@ -8,7 +8,7 @@
+ for f in *.csv
+ do
+   f=`basename $f .csv`
+-  perl -I ../../lib ./csv2tsv.pl $f.csv > ../tsv/$f.tsv
++  @PERL@ -I ../../lib ./csv2tsv.pl $f.csv > ../tsv/$f.tsv
+ done
+ 
+ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-changes/attachments/20161024/8739e593/attachment-0002.html>


More information about the macports-changes mailing list