わいえむねっと

Contents
Categories
Calendar
2009/03
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Monthly Archives
~2000/01
Recent Entries
RSS1.0
Templates
Information
Processed: 0.062 sec
Chashed: -
2009/03/10 Tue
インスタント味噌汁の賞味期限が1/27だったのを見なかったことにする。
そして飲む。(飲むな)
まだあります。 PARをインストール。
バージョンあわせる必要があったりとか割と面倒だったのでメモ。
まず、ppmでPAR 0.988をインストール。
ppがないので、


から PAR-Packer-0.982.tar.gz をダウンロードして、

>Makefile.PL
Fetching 'PAR-Packer-0.982-MSWin32-x86-multi-thread-5.8.8.par' from www.cpan.org... Fetching failed:
No compiler found, won't generate 'script/parl.exe'!
Checking if your kit is complete...
Looks good
Warning: prerequisite Getopt::ArgvFile 1.07 not found.
Warning: prerequisite Module::ScanDeps 0.78 not found. We have 0.77.
Warning: prerequisite Parse::Binary 0.04 not found.
Warning: prerequisite Win32::Exe 0.04 not found.
Writing Makefile for PAR::Packer

Makefileを生成して、Warning のでたパッケージをppmでインストールして、

>nmake

Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

         C:\Perl\bin\perl.exe "-Minc::Module::Install" -e "extract_par(q(PAR-Packer-0.982-MSWin32-x86-multi-thread-5.8.8.par))"
cp lib/App/Packer/PAR.pm blib\lib\App\Packer\PAR.pm
cp lib/PAR/Packer.pm blib\lib\PAR\Packer.pm
cp lib/PAR/Filter/Obfuscate.pm blib\lib\PAR\Filter\Obfuscate.pm
cp lib/PAR/Filter/PodStrip.pm blib\lib\PAR\Filter\PodStrip.pm
cp lib/PAR/StrippedPARL/Base.pm blib\lib\PAR\StrippedPARL\Base.pm
cp lib/PAR/Filter.pm blib\lib\PAR\Filter.pm
cp lib/PAR/Filter/PatchContent.pm blib\lib\PAR\Filter\PatchContent.pm
cp lib/PAR/StrippedPARL/Dynamic.pm blib\lib\PAR\StrippedPARL\Dynamic.pm
cp lib/PAR/Filter/Bytecode.pm blib\lib\PAR\Filter\Bytecode.pm
cp lib/pp.pm blib\lib\pp.pm
cp lib/PAR/Filter/Bleach.pm blib\lib\PAR\Filter\Bleach.pm
cp lib/PAR/StrippedPARL/Static.pm blib\lib\PAR\StrippedPARL\Static.pm
        C:\Perl\bin\perl.exe "-Iinc" -MExtUtils::Command -e cp script/tkpp blib\script\tkpp
        pl2bat.bat blib\script\tkpp
        C:\Perl\bin\perl.exe "-Iinc" -MExtUtils::Command -e cp script/pp blib\script\pp
        pl2bat.bat blib\script\pp
        C:\Perl\bin\perl.exe "-Iinc" -MExtUtils::Command -e cp script/par.pl blib\script\par.pl
        pl2bat.bat blib\script\par.pl

>nmake install

Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

         C:\Perl\bin\perl.exe "-Minc::Module::Install" -e "extract_par(q(PAR-Packer-0.982-MSWin32-x86-multi-thread-5.8.8.par))"
        C:\Perl\bin\perl.exe "-Iinc" -MExtUtils::Command -e cp script/tkpp blib\script\tkpp
        pl2bat.bat blib\script\tkpp
        C:\Perl\bin\perl.exe "-Iinc" -MExtUtils::Command -e cp script/pp blib\script\pp
        pl2bat.bat blib\script\pp
        C:\Perl\bin\perl.exe "-Iinc" -MExtUtils::Command -e cp script/par.pl blib\script\par.pl
        pl2bat.bat blib\script\par.pl
Installing C:\Perl\html\bin\par.html
Installing C:\Perl\html\bin\tkpp.html
Installing C:\Perl\html\site\lib\pp.html
Installing C:\Perl\html\site\lib\App\Packer\PAR.html
Installing C:\Perl\html\site\lib\PAR\Filter.html
Installing C:\Perl\html\site\lib\PAR\Packer.html
Installing C:\Perl\html\site\lib\PAR\Filter\Bleach.html
Installing C:\Perl\html\site\lib\PAR\Filter\Bytecode.html
Installing C:\Perl\html\site\lib\PAR\Filter\Obfuscate.html
Installing C:\Perl\html\site\lib\PAR\Filter\PatchContent.html
Installing C:\Perl\html\site\lib\PAR\Filter\PodStrip.html
Installing C:\Perl\html\site\lib\PAR\StrippedPARL\Base.html
Installing C:\Perl\html\site\lib\PAR\StrippedPARL\Dynamic.html
Installing C:\Perl\html\site\lib\PAR\StrippedPARL\Static.html
Installing C:\Perl\site\lib\pp.pm
Installing C:\Perl\site\lib\App\Packer\PAR.pm
Installing C:\Perl\site\lib\PAR\Filter.pm
Installing C:\Perl\site\lib\PAR\Packer.pm
Installing C:\Perl\site\lib\PAR\Filter\Bleach.pm
Installing C:\Perl\site\lib\PAR\Filter\Bytecode.pm
Installing C:\Perl\site\lib\PAR\Filter\Obfuscate.pm
Installing C:\Perl\site\lib\PAR\Filter\PatchContent.pm
Installing C:\Perl\site\lib\PAR\Filter\PodStrip.pm
Installing C:\Perl\site\lib\PAR\StrippedPARL\Base.pm
Installing C:\Perl\site\lib\PAR\StrippedPARL\Dynamic.pm
Installing C:\Perl\site\lib\PAR\StrippedPARL\Static.pm
Installing C:\Perl\site\bin\par.bat
Installing C:\Perl\site\bin\par.pl
Installing C:\Perl\site\bin\pp
Installing C:\Perl\site\bin\pp.bat
Installing C:\Perl\site\bin\tkpp
Installing C:\Perl\site\bin\tkpp.bat
Appending installation info to C:\Perl\lib/perllocal.pod

make installして、

>pp -V
PAR Packager, version 0.982 (PAR version 0.988)
Copyright 2002-2008 by Audrey Tang <cpan@audreyt.org>

Neither this program nor the associated "parl" program impose any
licensing restrictions on files generated by their execution, in
accordance with the 8th article of the Artistic License:

        "Aggregation of this Package with a commercial distribution is
        always permitted provided that the use of this Package is embedded;
        that is, when no overt attempt is made to make this Package's
        interfaces visible to the end user of the commercial distribution.
        Such use shall not be construed as a distribution of this Package."

Therefore, you are absolutely free to place any license on the resulting
executable, as long as the packed 3rd-party libraries are also available
under the Artistic License.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.  There is NO warranty; not even for
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

とりあえず完了。

>pp foo.pl
PAR::StrippedPARL::Static->get_raw() did not return the raw binary data for a PAR loader at C:/Perl/site/lib/PAR/StrippedPARL/Base.pm line 141, <DATA> line 1.
Could not write temporary parl (class PAR::StrippedPARL::Static) to file 'C:\DOCUME~1\foo\LOCALS~1\Temp\parl2nQT.exe' at C:/Perl/site/lib/PAR/StrippedPARL/Base.pm line 65, <DATA> line 1.
C:\Perl\site\bin/pp: Failed to extract a parl from 'PAR::StrippedPARL::Static' to file 'parlbkvuwtT.exe' at C:/Perl/site/lib/PAR/Packer.pm line 1157, <DATA> line 1.

しかし動かず。
ログを見返してみると、PAR-Packer-0.982-MSWin32-x86-multi-thread-5.8.8.par がないとかなんとか。


を確認したところ PAR-Packer-0.982-MSWin32-x86-multi-thread-5.10.0.par はあるようなので、ActivePerlのほうを更新してみる。
ActivePerl-5.10.0.1004-MSWin32-x86-287188.msi をインストールして再試行。

>Makefile.PL
Fetching 'PAR-Packer-0.982-MSWin32-x86-multi-thread-5.10.0.par' from www.cpan.org... done!
Checking if your kit is complete...
Looks good
Warning: prerequisite Getopt::ArgvFile 1.07 not found.
Warning: prerequisite Module::ScanDeps 0.78 not found.
Warning: prerequisite Parse::Binary 0.04 not found.
Warning: prerequisite Win32::Exe 0.04 not found.
Writing Makefile for PAR::Packer

今度はうまくいっている模様。
Warning のでたパッケージをppmでインストールして、

>nmake

Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

         C:\Perl\bin\perl.exe "-Minc::Module::Install" -e "extract_par(q(PAR-Packer-0.982-MSWin32-x86-multi-thread-5.10.0.par))"
        C:\Perl\bin\perl.exe "-Iinc" -MExtUtils::Command -e cp script/tkpp blib\script\tkpp
        pl2bat.bat blib\script\tkpp
        C:\Perl\bin\perl.exe "-Iinc" -MExtUtils::Command -e cp script/pp blib\script\pp
        pl2bat.bat blib\script\pp
        C:\Perl\bin\perl.exe "-Iinc" -MExtUtils::Command -e cp script/par.pl blib\script\par.pl
        pl2bat.bat blib\script\par.pl

>nmake install

Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

         C:\Perl\bin\perl.exe "-Minc::Module::Install" -e "extract_par(q(PAR-Packer-0.982-MSWin32-x86-multi-thread-5.10.0.par))"
        C:\Perl\bin\perl.exe "-Iinc" -MExtUtils::Command -e cp script/tkpp blib\script\tkpp
        pl2bat.bat blib\script\tkpp
        C:\Perl\bin\perl.exe "-Iinc" -MExtUtils::Command -e cp script/pp blib\script\pp
        pl2bat.bat blib\script\pp
        C:\Perl\bin\perl.exe "-Iinc" -MExtUtils::Command -e cp script/par.pl blib\script\par.pl
        pl2bat.bat blib\script\par.pl
Installing C:\Perl\html\bin\par.html
Installing C:\Perl\html\bin\tkpp.html
Installing C:\Perl\html\site\lib\pp.html
Installing C:\Perl\html\site\lib\App\Packer\PAR.html
Installing C:\Perl\html\site\lib\PAR\Filter.html
Installing C:\Perl\html\site\lib\PAR\Packer.html
Installing C:\Perl\html\site\lib\PAR\Filter\Bleach.html
Installing C:\Perl\html\site\lib\PAR\Filter\Bytecode.html
Installing C:\Perl\html\site\lib\PAR\Filter\Obfuscate.html
Installing C:\Perl\html\site\lib\PAR\Filter\PatchContent.html
Installing C:\Perl\html\site\lib\PAR\Filter\PodStrip.html
Installing C:\Perl\html\site\lib\PAR\StrippedPARL\Base.html
Installing C:\Perl\html\site\lib\PAR\StrippedPARL\Dynamic.html
Installing C:\Perl\html\site\lib\PAR\StrippedPARL\Static.html
Installing C:\Perl\site\lib\pp.pm
Installing C:\Perl\site\lib\App\Packer\PAR.pm
Installing C:\Perl\site\lib\PAR\Filter.pm
Installing C:\Perl\site\lib\PAR\Packer.pm
Installing C:\Perl\site\lib\PAR\Filter\Bleach.pm
Installing C:\Perl\site\lib\PAR\Filter\Bytecode.pm
Installing C:\Perl\site\lib\PAR\Filter\Obfuscate.pm
Installing C:\Perl\site\lib\PAR\Filter\PatchContent.pm
Installing C:\Perl\site\lib\PAR\Filter\PodStrip.pm
Installing C:\Perl\site\lib\PAR\StrippedPARL\Base.pm
Installing C:\Perl\site\lib\PAR\StrippedPARL\Dynamic.pm
Installing C:\Perl\site\lib\PAR\StrippedPARL\Static.pm
Installing C:\Perl\site\bin\par.bat
Installing C:\Perl\site\bin\par.pl
Installing C:\Perl\site\bin\parl.exe
Installing C:\Perl\site\bin\parldyn.exe
Installing C:\Perl\site\bin\pp
Installing C:\Perl\site\bin\pp.bat
Installing C:\Perl\site\bin\tkpp
Installing C:\Perl\site\bin\tkpp.bat
Appending installation info to C:\Perl\lib/perllocal.pod

>pp -V
PAR Packager, version 0.982 (PAR version 0.988)
Copyright 2002-2008 by Audrey Tang <cpan@audreyt.org>

Neither this program nor the associated "parl" program impose any
licensing restrictions on files generated by their execution, in
accordance with the 8th article of the Artistic License:

        "Aggregation of this Package with a commercial distribution is
        always permitted provided that the use of this Package is embedded;
        that is, when no overt attempt is made to make this Package's
        interfaces visible to the end user of the commercial distribution.
        Such use shall not be construed as a distribution of this Package."

Therefore, you are absolutely free to place any license on the resulting
executable, as long as the packed 3rd-party libraries are also available
under the Artistic License.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.  There is NO warranty; not even for
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

とりあえず完了。

>pp foo.pl
指定されたプログラムは実行できません。
C:\Perl\site\bin/pp: Failed to extract a parl from 'PAR::StrippedPARL::Static' to file 'parlPSLRgfF.exe' at C:/Perl/site/lib/PAR/Packer.pm line 1157, <DATA> line 1.

しかし動かず。
「指定されたプログラムは実行できません」?
試しにparl.exeを直接叩いてみたところ、「指定されたプログラムは実行できません」。
作業ディレクトリ内の PAR-Packer-0.982-MSWin32-x86-multi-thread-5.10.0.par から直接取り出したparl.exeを実行してみても、「指定されたプログラムは実行できません」。
なんで!
と思ったら、他の環境だと動いた。
なんで!ああ!


これか!

>pp -e "print 'Hello world'"

>a.exe
Hello world
PAR-Packer-0.980-MSWin32-x86-multi-thread-5.8.8.par はあるようなので、Perlが5.8.8の場合は PAR-Packer-0.980.tar.gz を使えばよさそうかなと。 そしてタコの唐揚げ食う。