PAR-1.020/0000755000175000017500000000000014571323312012317 5ustar roderichroderichPAR-1.020/META.yml0000664000175000017500000000150314571323312013571 0ustar roderichroderich--- abstract: 'Perl Archive Toolkit' author: - 'Audrey Tang ' build_requires: ExtUtils::MakeMaker: '0' Test::More: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 7.70, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: PAR no_index: directory: - t - inc requires: Archive::Zip: '1.00' AutoLoader: 5.66_02 Compress::Zlib: '1.30' Digest::SHA: '5.45' File::Temp: '0.05' PAR::Dist: '0.32' perl: '5.008009' resources: MailingList: mailto:par@perl.org bugtracker: https://github.com/rschupp/PAR/issues repository: git://github.com/rschupp/PAR.git version: '1.020' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' PAR-1.020/Makefile.PL0000644000175000017500000000503714562133030014272 0ustar roderichroderich#!/usr/bin/perl use strict; use warnings; use ExtUtils::MakeMaker; WriteMakefile1( NAME => 'PAR', VERSION_FROM => 'lib/PAR.pm', ABSTRACT_FROM => 'lib/PAR.pm', LICENSE => 'perl_5', AUTHOR => [ 'Audrey Tang ' ], MIN_PERL_VERSION => '5.008009', PREREQ_PM => { 'File::Temp' => '0.05', 'Compress::Zlib' => ($^O eq 'MSWin32') ? '1.16' : '1.30', 'Archive::Zip' => '1.00', 'PAR::Dist' => '0.32', 'AutoLoader' => '5.66_02', 'Digest::SHA' => '5.45', }, TEST_REQUIRES => { 'Test::More' => 0, }, META_MERGE => { 'meta-spec' => { version => 2 }, resources => { repository => { type => 'git', url => 'git://github.com/rschupp/PAR.git', web => 'https://github.com/rschupp/PAR', }, MailingList => 'mailto:par@perl.org', bugtracker => { web => 'https://github.com/rschupp/PAR/issues' }, }, }, clean => { FILES => 't/hello.par' }, ); sub MY::postamble { return <<'...'; pure_all :: t/hello.par t/hello.par: $(PERL) "t/gen-hello-par.pl" ... } sub WriteMakefile1 { #Compatibility code for old versions of EU::MM. Written by Alexandr Ciornii, version 2. Added by eumm-upgrade. my %params=@_; my $eumm_version=$ExtUtils::MakeMaker::VERSION; $eumm_version=eval $eumm_version; die "EXTRA_META is deprecated" if exists $params{EXTRA_META}; die "License not specified" if not exists $params{LICENSE}; if ($params{AUTHOR} and ref($params{AUTHOR}) eq 'ARRAY' and $eumm_version < 6.5705) { $params{META_ADD}->{author}=$params{AUTHOR}; $params{AUTHOR}=join(', ',@{$params{AUTHOR}}); } if ($params{TEST_REQUIRES} and $eumm_version < 6.64) { $params{BUILD_REQUIRES}={ %{$params{BUILD_REQUIRES} || {}} , %{$params{TEST_REQUIRES}} }; delete $params{TEST_REQUIRES}; } if ($params{BUILD_REQUIRES} and $eumm_version < 6.5503) { #EUMM 6.5502 has problems with BUILD_REQUIRES $params{PREREQ_PM}={ %{$params{PREREQ_PM} || {}} , %{$params{BUILD_REQUIRES}} }; delete $params{BUILD_REQUIRES}; } delete $params{CONFIGURE_REQUIRES} if $eumm_version < 6.52; delete $params{MIN_PERL_VERSION} if $eumm_version < 6.48; delete $params{META_MERGE} if $eumm_version < 6.46; delete $params{META_ADD} if $eumm_version < 6.46; delete $params{LICENSE} if $eumm_version < 6.31; WriteMakefile(%params); } PAR-1.020/META.json0000664000175000017500000000301014571323312013734 0ustar roderichroderich{ "abstract" : "Perl Archive Toolkit", "author" : [ "Audrey Tang " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 7.70, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "PAR", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Archive::Zip" : "1.00", "AutoLoader" : "5.66_02", "Compress::Zlib" : "1.30", "Digest::SHA" : "5.45", "File::Temp" : "0.05", "PAR::Dist" : "0.32", "perl" : "5.008009" } }, "test" : { "requires" : { "Test::More" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/rschupp/PAR/issues" }, "repository" : { "type" : "git", "url" : "git://github.com/rschupp/PAR.git", "web" : "https://github.com/rschupp/PAR" }, "x_MailingList" : "mailto:par@perl.org" }, "version" : "1.020", "x_serialization_backend" : "JSON::PP version 4.16" } PAR-1.020/README0000644000175000017500000000406314534626033013207 0ustar roderichroderichThis is the README file for PAR, a toolkit to create and use perl scripts and modules stored inside compressed .par files. Please type "perldoc PAR" after installation to see the module usage information, and "perldoc PAR::FAQ" for frequently answered questions. For running ".par" files directly, please install PAR-Packer and see "perldoc parl". To generate/execute self-contained perl scripts, install PAR-Packer and see "perldoc par.pl" or "perldoc pp". An extensive "Cross-Platform Packaging and Deployment with PAR" tutorial is available as "perldoc PAR::Tutorial". A slightly outdated version is also available online at . * Installation PAR uses the standard perl module install process: perl Makefile.PL make make test make install * Historic note With version 0.97 of PAR, the logic for generating stand-alone executables has been refactored into the PAR-Packer distribution. It should be available from the same source you got PAR from. Hence, for packing scripts with prerequisite modules into stand-alone scripts or executables (aka PerlApp, Perl2exe, or 'perlcc that works'), see "perldoc pp" and "perldoc tkpp". Since version 0.97 of PAR, you do not need a C compiler any more to build it. All logic that required a C compiler previously was moved into the PAR-Packer distribution. * Source Repository You can check out the most recent revision from PAR's GitHub repository: https://github.com/rschupp/PAR * Contact You can write to the mailing list at , or send an empty mail to to participate in the discussion. Archives of the mailing list are available at or . Please submit bug reports to . * Copyright Copyright 2002-2010 by Audrey Tang . Copyright 2006-2010 by Steffen Mueller . All rights reserved. You can redistribute and/or modify this bundle under the same terms as Perl itself. See LICENSE. PAR-1.020/LICENSE0000644000175000017500000004415012773751210013334 0ustar roderichroderichCopyright 2002-2010 by Audrey Tang . Copyright 2006-2010 by Steffen Mueller . This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- Copyright 2002-2010 by Audrey Tang . Copyright 2006-2010 by Steffen Mueller . This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- Copyright 2002-2010 by Audrey Tang . Copyright 2006-2010 by Steffen Mueller . This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End PAR-1.020/Changes0000644000175000017500000014054314571323163013625 0ustar roderichroderich1.020 2024-03-04 - restructure _extract_inc(): always add XS DLLs in PAR_TEMP/inc to PAR::Heavy::FullCache, ie. even if PAR_TEMP/inc already exists (hence we don't need to extract the zip), cf. #11 - bump minimum perl version to 5.8.9 everywhere 1.019 2023-11-01 - register XS DLLs extracted into $PAR_TEMP/inc with %PAR::Heavy::FullCache This solves the problems mentioned in GitHub PR #8 ("Special case Gtk related dlls to dl_load from the unpacked inc dir") with applications using modules Gtk2, Pango, Cairo and others (this is a Windows only problem) - Heavy.pm: use strict; use warnings Thanks @shawnlaffan 1.018 2022-09-28 - Fix #6: PAR fails to test its build on MSWin32 with Perl-5.36.0 Makefile.PL: Quote t/gen-hello-par.pl for Windows Merge PR #5 by Tim Hoke 1.017 2021-01-13 - change bugtracker to GitHub issues - remove obsolete stuff from tutorial 1.016 2019-05-20 - Fix #129312: Code signing for OSX Avoid Archive::Zip::Archive error "can't find EOCD signature" for pp'ed executables with lots of stuff appended (e.g. by OSX codesign): temporarily increase Archive::Zip::ChunkSize around the call to Archive::Zip::readFromFileHandle(). Note this is prerequisite for the corresponding fix in PAR::Packer. - Fix: Archive::Unzip::Burst::unzip result is ignored and _extract_inc does always the slow way, too PR from Vit Spinka , thanks! - Show debug messages if $ENV{PERL_DL_DEBUG} is true 1.015 2017-04-13 - Fix RT#120722 (Reason for Module::Signature dependency unclear since 2008) - "require" a non-broken version of Digest::SHA - remove other crypto related "recommends" - Switch from Module::Install to ExtUtils::MakeMaker - avoids the hassle with Module::Install for Perl without "." in @INC - add some resources cf META.json 1.014 2016-12-18 - Fix RT#119224: "Issue about Can't locate loadable object for module" drop "use" statements in PAR/Heavy.pm added in edf5f24d - Fix RT#119010: "Wrong license link" always refer to the included LICENSE file - generate hello.par in Makefile target "pure_all" 1.013 2016-11-27 - Fix a crucial typo, hopefully fixes RT#118981 "Tests fail (with PAR 1.012?)" - Build t/hello.par at "make" time 1.012 2016-11-25 - Guard against concurrent extraction attempts of zip into "inc" - use a file lock to protect the extraction of the complete zip into "inc" - _run_member_*(), _tempfile(), _dl_extract(): make the "persistent" filename only visible when the file has been completely written - Make build and test work if @INC does not include "." - Upgrade to Module::Install 1.17 1.011 2016-09-18 - Move to GitHub. Thanks, OpenFoundry, for years of service. - Suppress warning "Use of uninitialized value in do "file" ..." - Put a description of its purpose into the canary file - Remove all traces of Internals::PAR::CLEARSTACK - Remove all references to http://par.perl.org/, doesn't exist anymore 1.010 2015-07-13 - Fix #101800 "[PATCH] Reinstate files to inc dir if deleted by external process" Periodic temp directory cleaning programs (eg. "tmpwatch") may remove some (older) files from $PAR_TEMP/inc, but keep others. This causes the packed program to fail. - When extracting a .par file to $PAR_TEMP/inc do NOT restore the original modified timestamps of the file (so that the extracted files have the time of extraction as their modified time). - Add a "canary" file in $PAR_TEMP and back-date it 1 day. Hence any process removing files in $PAR_TEMP based on timestamps should remove the "canary" before others. - If the canary file is missing, extract the .par to $PAR_TEMP/inc as previously was done only when $PAR_TEMP/inc was missing. 1.009 2015-04-22 - Fix 103861 for PAR-Packer: Adding local directories to @INC for a pp executable fails - Get rid of included PerlIO.pm, parent.pm, obsolete Module::Install::Include and included Test::More. 1.008 2015-01-24 - Fix #101662: Prevent shared libs from being cached in memory on AIX applied patch from Thoke@northpeak.org, thanks. Note: this is one half of the fix, the other is in PAR::Packer - Fix #86178: dll files not extracted to shlib subfolder when using -l or to other folder when using -a extract all files from the zip, including all DLLs - Fix #86014: [PATCH] POD fix applied Debian patch from gregor herrmann , thanks! while we're at it fix two bad L<> hyperlinks reported by podchecker - Fix RT #86650: typo fixes - reformat ChangeLog file according to CPAN::Changes::Spec and rename it to Changes - Update to Module::Build 1.14 1.007 2012-10-22 - Hopefully fix "pp -C ..." for any modules that assume an actual tree of files, e.g. looking for all installed modules Foo::Bar::*; call _extract_inc even when $ENV{PAR_CLEAN} is true - update to Module::Install 1.06 1.006 2012-10-15 - Fix RT #78633: PAR::import ignores url => $repo_client_object applied patch from KENO, thanks! - Fix RT #73491: cache directory naming problem In PAR::SetupTemp::_get_par_user_tempdir (actually _find_username) we try to sanitize username (so that there are no problematic characters in the name of the per-user cache directory), but the strategy fails miserably for some charset encodings. E.g. for EUC-KR or CP949 (as in the bug report) we may produce an illegal sequence of bytes; in other cases we may cause collisions (different usernames mapping to the same directory name). Fix the problem once and for all by encoding the username (bytewise) as 2 hex digits. 1.005 2011-12-02 - bump Perl version requirement to 5.8.1 (Schwern: The End Of 5.6 Is Nigh!) - run all tests using a nonce PAR_TMPDIR (otherwise CPAN Testers goes crazy as top level /tmp/par-USER directories (or similar) from previous tests may now be considered "unsafe") 1.004 2011-11-30 - back out r1241: it causes errors in PAR::Packer's test suite - change "unsafe directory" error message to match the wording used by PAR::Packer - remove "debian" sub directory: it isn't released to CPAN and Debian will supply its own anyway - remove some cruft from MANIFEST.SKIP 1.003 2011-11-28 - RT #69560/CVE-2011-4114: PAR packed files are extracted to unsafe and predictable temporary directories (Note: this bug was originally reported against PAR::Packer, but it applies to PAR as well) - create parent of cache directory (i.e. /tmp/par-USER) with mode 0700 - if it already exists, make sure that (and bail out if not) - it's not a symlink - it's mode 0700 - it's owned by USER - Fix a problem packing XML::LibXSLT on Windows (see the thread starting with http://www.nntp.perl.org/group/perl.par/2011/02/msg4919.html) - Die (with a hopefully useful message) if any error is encountered during an Archive::Zip extract operation 1.002 2010-07-25 - Fixes to VERSIONs of PAR::Setup*. - No change in behaviour since 1.001 1.001 2010-07-25 - RT #57399: extract everything (including DLLs) in File::ShareDir directories. Module::ScanDeps classifies everything in File::ShareDir directories as "data", but PAR uses it's own heuristics what to extract from a .par. - Previous release was missing META.yml. - Upgrade Module::Install to 1.00 1.000 2010-04-10 - Fix defined(%hash) deprecation warning in PAR::Heavy 0.994 2009-07-23 - Fix for the PAR::Heavy fix to the INC priority handling. 0.993 2009-07-19 - The priority (fallback=>0) repositories should look at @PAR_INC for the loaded PARs instead of @PAR_INC_LAST. - Don't reload from a downloaded .par file after installing it via "upgrade". - Band-aid fix for the loading priority of shared librares from PAR files: Try PAR's first, the local stuff, then fallback-PARs. - Initial support for running external perl scripts from a packaged interpreter. 0.992 2009-04-05 - Support for non-fallback repositories. 0.991 2009-03-10 - Promote previous release to stable release. 0.989_01 2009-03-02 [Bug fixes, etc.] - Track the locations of all archives that have been extracted to $ENV{PAR_TEMP}/inc in this run. 0.988 2009-03-01 - Promote previous release to stable release. 0.987_01 2009-02-20 [New features] - Better cleanup of the $TMPDIR/par-$USER/temp-$$ directories that are typically used as caches in the "use PAR 'foo.par'" use case. [Bug fixes, etc.] - Very slightly more careful handling of PAR-specific environment variables. - Cleanup of PAR::SetupTemp 0.986 2009-02-19 - Promote to stable release. 0.985_01 2009-02-02 [New features] - Support for the brand new static dependency resolution of PAR::Repository::Client 0.23. [Bug fixes, etc.] - Fix issue with running scripts from repositories: The INC hooks used to be set up too late for this to automatically pick up dependencies. 0.984 2009-01-25 [New features] - Implemented the auto-upgrading option for loading and installing from PAR::Repositories. [Bug fixes, etc.] - Fix issue with PAR::Repository::Client development versions. 0.983 2008-09-12 [Dependencies] - Require AutoLoader 5.67 which contains a PAR-related bug-fix. - Require PAR::Dist 0.32. [Internal changes] - The full extraction process _extract_inc (which is triggered when a non--clean pp packaged executable is run) can now be forced to do the extraction (instead of doing if !-d). - That same extraction routine now accepts Archive::Zip handles or file names. - When, during the full extraction, the extracted paths are to be added to @INC, we now make sure they're not in @INC yet. 0.982 2008-08-10 [New features] - Moved the routines that setup the PAR_TEMP environment variable to a separate module in the distribution so it's possible to use PAR::Repository::Client without loading all of PAR. - Same for the function that sets up PAR_PROGNAME. [Bug fixes, etc.] - Upgrade to Module::Install 0.77 - Fix for running scripts from repositories. 0.980 2008-05-22 [Bug fixes, etc.] - The function PAR::get_filehandle() that was introduced in 0.979 is really broken because Archive::Zip is broken. Turns out calling Archive::Zip::Member->fh() returns a file handle to the zip file, not a virtual/tied/whatever file handle to the member file. Therefore, the get_filehandle() function has been removed again until we work around this issue. - Upgrade to Module::Install 0.73 0.979 2008-05-13 [New features] - New function PAR::get_filehandle() returns a file handle for a file in any open .par files. Similar to read_file(). 0.977 2007-10-19 [Bug fixes, etc.] - HPUX doesn't like shared libraries being unlinked while in use. So don't try to do this even in clean mode. (Workaround will be in par.pl) (Scott Stanton) - Fix DLL extraction file name matching in PAR::Heavy. - Save two system calls per DLL during DLL extraction in PAR::Heavy. 0.976 2007-07-29 [New features] - Use Archive::Unzip::Burst for unpacking binary executables if available. (This yields a significant startup speed-up.) [Bug fixes, etc.] - Removed the auto_install feature from Makefile.PL. auto_install is conceptually broken. 0.973 2007-02-03 [New features] - A new option for the "use PAR { ... };" use case: "no_shlib_unpack" signals that for this particular .par file, shared libraries that were added with the --lib option should not be extracted. This allows users to do their own cache handling for these libraries. - PAR no longer unpacks *all* shared libraries by default but only those in the shlib/ directory (i.e. added with --lib). The shared libraries in auto/ should be picked up by the DynaLoader hack. - If available, the prefork.pm module will be used to declare run-time dependencies for better memory use in forking environments. - PAR now uses a caching mechanism to speed up the extraction process. This should particularly impact users of the "use PAR {file =>...}" form. [Bug fixes, etc.] - Applied an optimization of the unpacking process on case insensitive file systems. 0.972 2007-01-16 [Bug fixes, etc.] - Removed PAR::AutoLoaderFix again. It wasn't working as expected all the time. - To fix the problem AutoLoaderFix was supposed to fix, we now require AutoLoader 5.62 or newer which was just recently released to CPAN. (Previously only available from blead perl.) 0.971 2007-01-12 [Bug fixes, etc.] - Fixed typo in the POD. (Jerrad Pierce) - Included fix for a bug in AutoLoader.pm as shipped with all perl versions up to and including 5.8.8 as PAR::AutoLoaderFix. This cures a problem of endless looping when the %INC entry of a module doesn't point to a file of the same name. This may happen during "use PAR 'foo.par'". 0.970 2006-12-03 [This release introduces some rather radical changes, so read carefully:] [All PAR::Packer related logic has been moved to a separate distribution,] PAR-Packer. This includes pp, parl and all packaging tools. This way, PAR becomes a pure-Perl distribution that can be most easily installed by users of software which requires PAR. Developers who want to use the PAR packager, pp, need to install the PAR-Packer distribution from CPAN. 0.961 2006-11-23 [Bug fixes, etc.] - PAR::StrippedPARL::Base->write_parl() failed to work if the @INC directories contained spaces in 0.960. (Steven Mackenzie) - Much improved documentation of the environment variables (Glenn Linderman) - Fix for a spaces-in-pathname problem on Windows for t/30-current_exec.t. (Malcolm Nooning) 0.960 2006-11-21 [Bug fixes, etc.] - myldr/Makefile.PL fix: Clean up myldr/usernamefrompwuid.h. - Silence warning in myldr/internals.c. - Silence warnings seen on Irix from myldr/env.c. - Skip most tests in 10-parl-generation.t if there is no parl. - Skip loading ActiveState Perl's "sitecustomize.pl" in par.pl. - Load modules via require and other files via do. - The parl-regeneration-for-every-pp-call addition of the 0.958 release should now also work for static perls. [New features] - Adressing RT ticket #6612: Now using getpwuid() to determine the user name if supported by the OS. 0.959 2006-11-12 [This is just a hotfix release because 0.958 lacked META.yml. One day, I will] switch from Module::Install to Module::Build... 0.958 2006-10-25 [Bug fixes, etc.] - myldr/Makefile.PL fix: make static.o depend on mktmpdir.c, my_perl.c, my_par.c. (Roderich Schupp) - Modules included with the -M option to pp were previously scanned for dependencies but not mapped through the %Module::ScanDeps::Preload hash for custom dependencies. That's fixed now. - $ENV{PAR_RUN} isn't set by PAR::Packer any more because nothing in the PAR sources uses it. $ENV{PAR_RUN} is no longer used by PAR at all. - Unified the environment variables which are looked at for finding the system's temporary directory. [New features] - During the build process, PAR appends stripped down copies of parl (and parldyn if applicable) to the data classes PAR::StrippedPARL::Static and ::Dynamic. These parls-without-embedded-modules are used for packaging so the formerly embedded modules are now packaged from the packaging system. (Instead of stemming from the system where PAR/parl was built.) - The "use PAR { repository => $url };" syntax now also supports the use of user-constructed PAR::Repository::Client objects instead of an URL. - The -F (module code filter) option now supports selective filtering of modules. The syntax is "-F FILTER=REGEX" or - as before - "-F FILTER". The regular expression is applied to the *file name*, of the module inside the PAR (e.g. Foo/Bar.pm). This behaviour was chosen over matching against the module name (e.g. Foo::Bar) because the filters can be applied to module-like and script files as well (.pl, .al, etc.). - Updated PAR/FAQ.pod with the new FAQ's from the PAR wiki. - Added a POD file PAR/Environment.pod which is intended to become an index of all environment variables PAR uses of its own or recognizes from its users. Still mostly a stub. 0.957 2006-10-24 [Bug fixes, etc.] - Fix executable PARs top properly detect embedded scripts named the same as the executable. (Jesse Vincent) - Comment out the call to par_current_exec_proc (in the C loader) which breaks the use of symlinks to pp-ed executables when not called with a path. (I.e. using a search in $PATH). 0.956 2006-10-03 [Bug fixes, etc.] - This is another hotfix release. Fixed a mindless bug introduced in 0.955. 0.955 2006-10-03 [Bug fixes, etc.] - 0.952 introduced removal of system module search paths if -B is in effect. This resulted in some valid PAR-related paths being removed as well. Fixed. Upgrading from 0.952 and 0.954 is suggested. - Changed the use of hard-coded '/' as path-separator to using File::Spec. 0.954 2006-09-26 - This release is equivalent to 0.953. The 0.953 CPAN upload is broken! 0.953 2006-09-18 [Bug fixes, etc.] - Added optional POD tests. - Modified -B so that if -B is in effect, all entries are stripped out of @INC except for the PAR hooks. This happens right before the script contained in the pp-ed binary is executed. 0.952 2006-08-22 [New features] - Added the "install" option to the PAR loading syntax. If specified, the contents of the PAR distribution are permanently installed. This requires PAR::Repository::Client 0.04. [Bug fixes, etc.] - Fixed broken META.yml in 0.951. 0.951 2006-08-12 (This includes any changes up to 0.950.) [New features] - Introduced new PAR loading syntax and semantics: use PAR { file => 'path/to/par/or/URL' }; ==> equivalent to "use PAR 'path/to/par/or/URL';" - Introduced the 'fallback' option: (default = 0) use PAR { file => 'foo.par', fallback => 1 }; ==> Loads modules from the PAR file only if loading them from @INC did not succeed. - Introduced the 'run' option which executes a script in a PAR archive just like perl -MPAR foo.par script.pl - If PAR::Repository::Client is installed, you can add a repository of .par distributions to your library search path as follows: use PAR { repository => 'http://foo' }; - Of course, 'run' also works with repositories: use PAR { repository => 'http://foo', run => 'my_app' }; (This searches the repository for any distributions that have a my_app script.) --> For details on repositories, have a look at the PAR::Repository::Client module. - Bug fixes, etc. - Commented a couple of the routines in PAR.pm. (Yay!) - New test script for the new fallback loading feature. - Fixed a bug in the Spreadsheet::ParseExcel handling in PatchContent.pm. 0.942 2006-07-22 [Bug fixes, etc.] - Better support for diagnostics.pm (in conjunction with Module::ScanDeps 0.62.) - Now requiring Module::ScanDeps 0.62. 0.941 2006-06-20 (No, PAR isn't stagnating. It's just that 1.00 would draw close if we continued with 0.01 increases.) [Bug fixes, etc.] - Version 0.94 of PAR would use the same cache area for all pp-ed applications due to a faulty hotfix for Digest::SHA. This applies to PAR 0.94 only. Think of 0.941 being PAR 0.94 done right. 0.94 2006-06-01 [New Features] - Added support for reading options to pp from a file using a '@filename' argument to pp: pp -o foo --gui @filename foo.pl [Bug fixes, etc.] - Workaround for a bug in Digest::SHA 5.38 and 5.39 that would prevent PAR from being built. - Fixed details in the 2-pp.t test file. - Now recognizes text files that aren't picked up by the -T operator but by the "file" tool. - Applied Roderich Schupp's patch to 30-current_exec.t to fix a path issue. - Now requiring Module::ScanDeps 0.60 which fixes a couple of bugs which might be observed as PAR bugs. - Now working well with Spreadsheet::ParseExcel which uses an invalid POD section to comment out a code block. This wasn't recognized by PAR::Filter::PodStrip as POD and hence partly left in... - If the output directory doesn't exist, we create it now and output a meaningful error message if that failed. 0.93 2006-05-19 [New Features] - Added support for PAR_TMPDIR (PAR_GLOBAL_TMPDIR) so that the temp directory can be controlled for just the PAR file bits. (Leolo) - Added par_current_exec_proc() which finds the file of the current executable in /proc, if possible. (Leolo) - Added par_current_exec() which finds he file of the current executable, if possible on this OS. (Leolo) - par_findprog() now uses par_current_exec() if possible. [Bug Fixes, etc.] - Upgraded to Module::Install 0.62+ (Audrey Tang, Steffen Mueller) - Document a strange interaction with chdir() and relative paths. (Chris Dolan) - Documented the bits that make up PAR_TEMP. (Leolo) - Fixed the call to par_findprog. path (aka val) was set to tmpdir. (Leolo) - Documented the CACHE name at the end of a self-executing PAR. (Leolo) - myldr/Makefile.PL now generates some dependencies for main.c (Leolo) - Applied patch from RT ticket. (tsee) https://rt.cpan.org/Ticket/Display.html?id=13959 - Applied Ivan Kudryavtsev's patch that fixes a couple of calls to PAR subroutines in PatchContent filtered code. (tsee) 0.92 2006-02-22 [Bug Fixes] - Now requiring Module::ScanDeps 0.56 which handles autouse correctly. - Now shipping with a correct SIGNATURE. (Which was broken for 0.91.) 0.91 2006-02-13 [Bug Fixes] - Applied Alan Stewart's patch which fixes @ARGV pollution in daughter programs. See also http://www.nntp.perl.org/group/perl.par/2152 - Now mentioning the ENV var "PAR_VERBATIM" in the documentation. See also http://www.nntp.perl.org/group/perl.par/2196 - Applied Malcolm Nooning's fix for the test suite. We used to get failed tests on Windows because of spaces in path names. - Applied Roderich Schupp's and Malcolm Nooning's patches to the test suite fixing problems with Cygwin. - Applied Vincent Ladeuil's patch to PAR::Filter::Bleach to return a true value for modules that loaded okay. - Changed 'PAR_BASE' in the Makefile.PL to 'SMUELLER'. 0.90 2005-11-25 [Bug Fixes] - When compiling with static libperl, myldr/ may fail "make" due to sha1.c not generated properly. - Pod stripping could fail on __DATA__ sections for files with CRLF line endings. - The documentation erroneously referred to the PAR_TEMP environment variable, whereas it should be PAR_GLOBAL_TEMP. - Compilation fixes for MinGW/MSYS. 0.89 2005-06-10 [Bug Fixes] - Stop static.c from pulling in Perl header files, otherwise parl.exe ends up depending on the Perl DLL on Win32 when Perl is built without PERL_IMPLICIT_SYS. - With *nix and File::Path 1.06, par.pl's avoidance of loading Cwd.pm caused syntax errors. 0.88 2005-06-07 [Bug Fixes] - Extracted .pl files should be loadable via the coderef-in-@INC too, just like .pm files and autosplit files. This makes PAR work with Perl 5.8.7 on Win32. - Fix the build with GCC 4.0. - If $ENV{PWD} is not defined, fallback to use `pwd` to obtain the working directory for invoking. 0.87 2005-01-31 [Bug Fixes] - On Win32, some versions of File::Spec::Win32 contains explicit "use Cwd;" lines, which renders parl.exe unusable. - Executable made by "pp" may fail when invoked as "./a.out" or "../a.out", due to incorrect PWD handling logic. 0.86 2004-12-11 [New Features] - New "pp -z" (--compress) option to set compression level (0-9). - New "pp -T" (--tempcache) option to override the per-executable directory name; it defaults to a hash of the executable, computed at compile time. This makes startup much faster for large executables. - The hash algorithm described above now prefers Digest::SHA if installed, otherwise Digest::SHA1, then fallbacks to Digest::MD5. - Functionality of "pp -X" is now extended: if the argument after -X is a zip or par file, files in it are excluded from the produced executable, and the executable will "use" the zip/par instead. For multiple -X args, successive args are only "use"d if they contain additional unique files. - "pp -l" now searches for libraries in "." and PATH in Win32. - "pp -l" shared libraries are now added to %skip, so it will not be included in both shlib/ and lib/. - "pp -l" now chases symbolic links. For example, if "libsomelib.so" is a symlink to "libsomelib.so.1", which is another symlink to "libsomelib.so.1.2", pp now follows these symlinks and add the real file the par, rather than "libsomelib.so". - New contributed code in "contrib/stdio/": Useful Tk console for "pp -g" users. - New contributed tutorial documents, currently in "contrib/docs/", which will eventually be turned into POD documents. - Running "perl Makefile.PL" with $ENV{DEBUG} set to true now produces "parl" with debug symbols. - Remove Cwd.pm (and Cwd.so) from the bundled dependencies. [Bug Fixes] - More robust probing for case-insensitive file systems. - PodStrip now attempts to match "standard" pod start before =cut, otherwise =cut gets removed by itself. - Win32 slashes are now normalized in privlib and archlib directories. - Don't extract shared libraries to inc/, since they were extracted in $PAR_TEMP already. - Don't re-extract shared libraries in subdirectories, since they are picked up by corresponding "use". - Tk now exits properly with a non-zero exit() value. - Fix libperl probing problem on Debian and Gentoo that manifests as a "libperl5.8.so not found" error during runtime. - gpp: Fixed typo in options with multiple filenames; cleaned up pp parameters. - When PAR_TEMP is set, shlib/ was not correctly added to the dynamic load path environment variables. - PAR now builds with Win32 VC++ without CVTRES.EXE available. - Detection of cl.exe, gcc.exe and cc.exe is now case-insensitive. 0.85 2004-07-02 [New Features] - New version of "gpp"; see contrib/gui_pp/gpp_readme.txt for details. [Bug Fixes] - MANIFEST and META.yml were not properly updated by PAR::Packer. - Setting directory aliases with "pp -a"/"pp -A" was broken. Fixed, and tests were added for it. - Statically-built executables was needlessly extracting libperl each time it runs; now it is eliminated and hence much faster. 0.83 2004-05-29 [New Features] - Revamped PAR::FAQ and sychronized with par.perl.org. - In pp-generated programs, $0 is now set to the pathname leading to the invoked executable. Use $ENV{PAR_0} instead to get the filename that contains the main perl program. - Updated "contrib/gui_pp/gpp" to support PAR::Packer options. [Bug Fixes] - Core XS modules, such as Data::Dumper, were skipped by "pp". - Fix t/2-pp.t for Cygwin by probing $Config{_exe} rather than uname(). - Scripts made by "pp -P", when invoked as "perl scriptname", should not search for the same-named programs in PATH. - Correctly remove leading slash and drive letters from absolute filenames passed to "pp -a". Also normalized blackslahes to slashes. - The PP_OPTS environment variable was not recognized. - "pp -a dirname;diralias" was broken. - "pp -f" and "pp -F" were broken. 0.82 2004-05-24 [New Features] - New module PAR::Packer provides an OO interface to "pp"'s functionality; "pp" is now merely a thin wrapper for it. - New module App::Packer::PAR is a modified version of App::Packer, designed to work with PAR::Packer, and will hopefully be merged back to App::Packer. - The old, procedural "pp" is moved to contrib/; end-users should notice no changes in "pp"'s behaviour. - New options "pp -a" and "pp -A" (--addfile/--addlist) provides ways to include extra files and directories in the package. - The long option name for "pp -M" is changed from --add to --module. The old name is still recognized but no longer documented. Using "pp -M" to include non-library files is now deprecated; use "pp -a" instead. - par.pl and parl now writes messages to STDOUT, instead of STDERR. As a consequence, t/2-pp.t no longer prints extra warnings during "make test". [Bug Fixes] - On Non-Win32 platforms, perl 5.8.0 and earlier versions produced pp-generated executables that immediately segfaults. - Running pp-generated executables with absolute pathname failed on statically-built perls. - Tests were failing due to a missing pipe_a_command.pm in MANIFEST. - Add the missing myldr/win32.coff for building on Cygwin/MinGW. - If the "perl" in path is different from the perl interpreter used for "make test", t/2-pp.t is known to fail and is now skipped. - Cygwin failed t/2-pp.t because "parl" is spelled as "parl.exe" there. 0.81 2004-05-23 [New Features] - Regained support for Win9x, Cygwin and MinGW. - PAR now supports 64-bit platforms, such as Tru64 and AIX. - Cygwin and MinGW can now build EXEs with icons, too; MinGW can update the icons, but Cygwin cannot. - Newly supported modules: Pod::Usage, DBIx::SearchBuilder, DBIx::ReportBuilder, SVK::Command, SVN::Core, and the ':encoding()' IO discipline. [Bug Fixes] - On non-Win32 systems, invoking pp-generated executable from PATH did not work. - Standalone executables were clobbered by existing perl environments with an identical "auto/IO" libpath as the author's environment. - Standalone executables did not work on systems with an unset dynamic load path environment variable (eg. LD_LIBRARY_PATH). - "pp -p -o multi.par 1.pl 2.pl; parl multi.par 1.pl" now works. - $ENV{PATH} and $ENV{TEMP} were truncated at first path delimiter. - "pp -f Bleach" did not work for ActivePerl on Win32. - Windows 9x systems were generating invalid cache directory names. - $ENV{path} is also recognized as $ENV{PATH} for Win32. 0.80 2004-03-17 [New Features] - A comprehensive test suite for pp in contrib/automated_pp_test/. It is run as part of the "make test" process from t/2-pp.t. - Much better support for "pp -i" and "pp -N" (--icon/--info) using the Win32::Exe module. You may now use EXE and DLL as icon files. - If PAR_GLOBAL_CLEAN (-C, --clean) is not set, we now preemptively extracts files under the cache directory. That made POSIX.pm and other modules that depends on %INC pointing to real files work correctly. - Now uses SHA-1 to create temporary directories and files, instead of mtime. - Verbosity level is now 1..3, not 0..5; "pp -v" now takes an optional integer, so "pp -v input.pl" is no longer an error. - New flags "-vv" and "-vvv", as shorthands for "-v 2" and "-v 3". - The user-settable PAR_CLEAN and PAR_TEMP environment variables has been renamed to PAR_GLOBAL_CLEAN and PAR_GLOBAL_TEMP; the original variables are still accessible within the program. This is so that a pp-generated program can exec() or system() another one without crippling its environment variables. - File lookups are now case-insensitive on case-insensitive filesystems. - Another Tk-based GUI in contrib/gui_pp/; not installed by default. - OOified "pp" in contrib/object_oriented_pp/; not installed by default. [Bug Fixes] - "pp -d" (--dependent) prevented "pp -C" (--clean) from working. - The "pp -m" (--multiarch) option was implemented incorrectly and thus broken. - Many documentation tweaks. - Previously, "pp -M" (--module) did not add the module itself, only its dependencies. - Suppress a bogus warning when $ENV{$Config{ldlibpthname}} is empty. - "parl -v" without Module::Signature installed could delete all files within the current directory. Oops. - On *nix systems, pp-generated executables erroneously linked to libperl even if "pp -d" (--dependent) is not set. - Spurious =cut directives in source files is now handled gracefully by PAR::Filter::PodStrip. - "pp -L" (--log) now logs all output messages to the log file, not just the ones printed by "pp" itself. 0.79 2004-01-08 [Bug Fixes] - Setting PAR_CLEAN had the reversed effect. Oops. - Dynamic libraries in cached directories was not detected properly, resulting in "permission denied" errors during certain race conditions. 0.78 2004-01-07 [New Features] - By default, executables generated by "pp" will now store extracted files in cache directories. You may override this by setting the PAR_CLEAN environment variable to "1", or generate executables using "pp -C". - New "pp -C" (--clean) option to make the generated executable clean up temporary directories after each run. - PAR_CLEARTEMP is renamed to PAR_CLEAN. [Bug Fixes] - On Win32, temporary directories containing shared libraries was not being properly cleaned up. - If no suitable temporary directories are found, use the current directory (".") instead of the root directory ("/"). 0.77 2004-01-01 [New Features] - New "pp -c" and "pp -x" (--compile/--execute) options run the script with "perl -c" to check for dependencies. - Also, the new "pp -n" (--noscan) command skips the default static scanning altogether. - Added support for "pp -c/-x/-n" to tkpp. - For dynamically-built perls, pp-generated .exe files will now appear in the process table with the same name as it was launched, instead of "par.exe". - New filter "Obfuscate", which uses B::Deobfuscate to strip away PODs and comments, as well as mangling variable names. - Merged tkpp 1.1 from Doug Gruber. - OS/2 is now supported. - External Zlib is no longer required to run pp-generated binaries. [Bug Fixes] - Makefile.PL was failing if $Config{cc} contains spaces. - No longer needs setting "Windows 95 compatible mode" to run on WinXP. - On Win9x with Perl 5.6.1, "nmake" was failing due to extra "@[...]" symbols in Makefile. It should be fixed now. - The "bad signature" problem with newer Archive::Zip versions is fixed. - App::Packer::Backend::PAR was misplaced into App/Packer/PAR. - Signature tests were failing under new ExtUtils::MakeMaker versions. - ActiveState's PPM building machine was having problem with PAR; a ".pdb" entry in MANIFEST.SKIP is added to fix that. - Some self-built PAR instances on Windows were failing due to mismatching short and long pathnames. 0.76 2003-10-28 [New Features] - Input filters. "pp --filter Bleach" now obfuscates the incoming script with PAR::Filter::Bleach; "pp --modfilter Bleach" applies Bleach to all packed modules. - Two previously built-in filters, PodStrip and PatchContent, are refactored out as PAR::Filter subclasses. - Two new filters, Bleach and Bytecode, are added for source-hiding purporses. - New utility, "tkpp", provides a GUI frontend to "pp". - New option, "pp --perlscript", to generate stand-alone scripts. - The old "PAR::Intro" documentation has been replaced by two new ones: "PAR::Tutorial" and "PAR::FAQ". - Tk pixmap (.xpm) files can now be packed with "pp --add". [Bug Fixes] - Perl 5.8.1 has an off-by-one bug that prevents "parl" to function properly. We have now provided a workaround; this bug should also be fixed in Perl 5.8.2. - Fixed https support for LWP via the new Module::ScapDeps. 0.75 2003-09-21 [New Features] - "pp -o file.exe file.par" now packs file.par into file.exe; this means you can hand-tweak PAR files generated by "pp -p" before packing it into an executable. [Bug Fixes] - Packing multiple programs by "pp script1.pl script2.pl" was producing syntax errors; fixed. - "pp -M datafile" now works. - Exit code from pp-packed executables now properly propagates out. - Fixed "use base" detection, Math::BigInt support and spurious signature warnings, by updated versions of Module::ScapDeps and Module::Signature. - On Win32, the PE info headers no longer show PAR_XXXXXXXXXXX. 0.74 2003-08-20 [New Features] - pp now has a set of "PatchContent" rules, dealing with non-PAR-compatible modules: Tk, Tk::Widget, Win32::API::Type, Win32::SystemInfo, SQL::Parser, diagnostics. These rules may get refactored back to PAR.pm in the future. - New function, PAR::reload_libs(), to reload currently used libraries inside PAR files. - PAR.pm itself is now never packed into pp-generated files, to perserve interface compatibility and reduce bloat. - PAR.pm now handles "use PAR 'othercode.par'" called from program or modules inside PAR files, even recursively. - A new icon for Win32 that is hopefully prettier. [Bug Fixes] - All data after __DATA__ are preserved for included libraries. This helps self-reading modules like Net::LDAP::Constants. - PAR::read_file() was broken. It now works. - "use PAR" inside pp-generated executables was failing with 'file too short' errors due the mishandling of seek/tell. - Occasional crashes on Win32 due to rmdir() called too early with DLLs still open is fixed; however, "pp -d" executables may still exhibit this problem. - "pp -X" used to only take full pathnames as arguments. It now also takes "Module::Name" and "Module/Name.pm". - Dynamically built Perl under Cygwin failed to build, because libperl.dll.a was not found. - Eliminated "callback called on exit" warnings, and the related "access violation" error on Win32. 0.73 2003-08-06 [New Features] - The PAR Homepage is now online at http://par.perl.org/. Documentations have been changed to link to it. [Bug Fixes] - Tk applications can now properly access xpm/xbm files with Tk->findINC. - On Win32, pp-generated executables could not start from Explorer, if its path contains space characters. Fixed. - On Win32, pp-generated executables used to leave around an empty directory in $ENV{TEMP}. It is now properly rmdir'ed. - Some systems (notably OpenBSD and Debian) does not put their libperl.so in the default location, which breaks the build process; now searches inside $ENV{$Config{ldlibpthname}} and $Config{libpth} to find it. 0.72 2003-08-02 [New Features] - CHECK and INIT blocks in programs inside PAR are now supported. [Bug Fixes] - Two debug statements were mistakenly left in the source, resulting in "trying to get rid of /tmp/par_priv.xxxx.tmp" messages. - Building on Linux with GCC 3.2.2 was failing due to massive heap required for my_perl.c. Fixed by splitting it into 3k chunks. - Depends on Module::ScanDeps 0.21; it supports utf8 on Perl 5.6.1 and can significantly reduce executable file size by eliminating unneccessary shared libraries. 0.71 2003-07-30 [Bug Fixes] - A nasty data-loss bug has been uncovered immediately after the previous release; it only affects Windows platforms, and may cause all files to be erased under the current root (\) directory. - Building on Red Hat linux was failing, with error message that says "my_perl not declared". This has since been fixed. 0.70 2003-07-29 [New Features] - On machines with shared libperl, "pp" now makes truly stand-alone executables; the old behaviour is available with "pp --dependent". - Under Windows NT/2000/XP, "pp --icon=name.ico" now changes the icon for the generated executable; otherwise, a default "white camel" icon is used. - "use PAR 'http://example.com/foo.par'" now works, as does "perl -MPAR -Ihttp://example.com/foo.par". - PAR::Dist is now a mandatory prerequisite, which provides functions to turn any CPAN distribution into a PAR distribution, as well as to install, uninstall, sign and verify such files. - Integrated PAR::Dist into "par.pl" and "parl". For example, "parl -i Foo-0.01-i386-freebsd-5.8.0.par" installs a PAR distribution; "parl -v out.exe" verifies a digitally signed executable generated by "pp --sign". - A new option, "pp --multiarch", lets you generate PAR files that can work on several architectures. - "pp --sign" now adds digital signatures to generated executables and PAR files. - PAR files may now (recursively) contain other PAR files inside their par/ directories. - shlib/ and par/ directories inside PAR files can now contain architecture- and perl-version-specific subdirectories. - The "Cross-Platform Packaging and Deployment with PAR" tutorial is now online as http://www.autrijus.org/par-tutorial/. [Bug Fixes] - MANIFEST.SKIP was broken on Win32. - C compilers that doesn't handle long line well can now compile PAR. - DLL files inside the same auto/ library as XS modules was not properly extracted and loaded. This specifically affects Win32. - Because parl's @INC is '.', pp-generated executables may miss IO.dll and other shared libraries since they couldn't be correctly found in @INC. 0.69 2003-05-31 [New Features] - Under Perl 5.8, "pp -p" now works with Apache::PAR. See http://aut.dyndns.org/par-tutorial/slide018.html for a simple example. - "pp -M filename" now adds "filename" to /, not /lib/, unless filename ends in (pm|ix|al). This makes it possible to bundle "web.conf" needed by Apache::PAR. - "pp -l" now searchs in system library paths, and appends "lib" / prepends ".$dl_ext" where necessary. [Bug Fixes] - PAR segfaults on some Unix platforms due to a NULL pointer used in mktmpdir.c. Fixed. - "pp -o out.par -p -e '...'" now honors -o; previously it used "a.out.par" anyway. - Inhibited spurious uninitialized warnings under -w in the POD-stripping code. - Win32 did not properly cleans up PAR_TEMP directory, resulting in failure for executables that reused the same PID. Fixed. 0.68 2003-05-26 [New Features] - New 'pp -l' option to pack additional shared libraries (DLLs). - POD-stripped libraries inside PAR files now have #line directives inserted, so they report the original line numbers on failure. - PAR files generated by 'pp' now has a MANIFEST file that can be viewed by Gecko-based browsers with Javascript turned on, e.g.: jar:http://aut.dyndns.org/par/test.par!/MANIFEST [Bug Fixes] - Each pp-executable instance now creates its own PAR_TEMP directory; this avoids permission errors when multiple users run the same binary. As a consequence, PAR_CLEARTEMP is now set to "1" by default. - Newer versions of shared Zlib library no longer causes "pp" to generate broken executables. - Fixed dynamic loading on Cygwin was failing due to missing +x mode. - Like "use lib", "use PAR 'name.par'" now unshift()s instead of push()es into @INC. Same applies for "par.pl -A" and "parl -A". - Fixed building on ActivePerl 626 and below due to a missing $Config{ld}. 0.67 2003-04-01 [New Features] - PAR now works on Cygwin and MinGW/MSYS. - Globbing support in PAR::import(): use PAR "/path/*.pm"; - New license clarification messages added to POD and 'pp -V'. - All 'pp' options now has a short form (-o) and a long form (--output). - Revamped documentation for 'pp'. - New -g (--gui) flag for 'pp' to build console-less Win32 executables. [Bug Fixes] - Building on Darwin Perl 5.6.0 was broken with 'cc -s'. - Building on 5.6.0 was broken due to bad 'base.pm'. - Win32 Tk::Widget autoloading was broken due to a binmode() bug. - IPC::Run was pod-stripped incorrectly. Fixed. - Depends on Module::ScanDeps 0.19, which supports utf8 and .ph files. - Better AutoInstall support, which uses 'sudo' where necessary. 0.66 2003-03-20 [New Features] - Adds PAR::Intro, a PODified version of the online presentation. - Adds App::Packer::Backend::PAR, a bridge between PAR and App::Packer. - Scripts and modules are now searched in "/" last, instead of first. - Experimental patch for packing shared libraries via "pp -l". - HTTP fetching of precompiled packages in addition to FTP. [Bug Fixes] - Makefile.PL now downloads precompiled packages only if needed. - AutoInstall has been made to work for an easier installation. - The redundant "parl.exe.bat" is no longer created on Win32. - Pre-0.63 PARs used to leave broken .dll in TEMP; now they're cleaned. - "pp c:\something.pl" no longer treats c: as a relative path. - "pp -I dir" now searches 'dir' first, instead of last. - "pp" was broken on Perl 5.6.0 due to => stringification bugs. - Support for Tk::Widget autoloading has been added. - "parl" was not stripped if "gcc" was invoked as "cc"; fixed. - On a machine with multiple "parl"s, "pp" now uses the correct one. - File::Temp was missing as a dependency. [Known Issues] - Cygwin support is still broken. - PAR does not include utf8_heavy.pl nor unicore/* for scripts that has "use utf8;". This has since been fixed by Module::ScanDeps 0.18. 0.65 2003-03-09 This release comes with several significant improvements: [Automatic binary installation] Previously, users without a C compiler cannot build the 'parl' executable, and is therefore unable to create self-contained binaries using 'pp'. Now, if there is a binary package available for that architecture under my CPAN directory, the Makefile.PL script will automatically fetch it, unpack into blib/, and the installation will continue as normal, resulting in a fully-functional 'pp'. This feature is part of the soon-to-be-released Module::Install framework; it will greatly benefit all CPAN authors with non-pure-perl distributions. [POD stripping] Packages generated with 'pp' will now strip POD sections from all packed dependencies (your own scripts is unaffected); all binary executables will save at least 276732 bytes, with additional ~20% saving in additional packed dependencies. You can turn off this feature with the PAR_VERBATIM environment variable. [XS Incompatibility solved] Because 'pp'-generated executables includes some fixed version of shared libraries (IO, Zlib, etc), they used to break when the target system has different version of shared libraries. Now PAR::Heavy intercepts DynaLoader::dl_expandspec to always prefer the library inside the PAR file, so this issue is resolved. [5.6.1 Reclaimed] Thanks to Sisyphus and various others, building on Perl 5.6.1 (with its old ExtUtils::MakeMaker and lack of PTHREAD_ATFORK) now works again. 0.64 2003-03-02 [New Features] - The t/0-signature.t test is re-enabled for people using my Module::Signature to verify the module's OpenPGP signature. - This release is the first distribution on CPAN to use the Module::Install framework, which is a stand-alone, extensible drop-in replacement for ExtUtils::MakeMaker that needs no extra action/prerequisites for end users. [Bug Fixes] - Dynamic loading on Win32 was broken, due to a binmode() bug reported by Bill Atkins, D. Menzel and others. - Building on Win32 in directory names that contain spaces did not work. 0.63 2003-02-06 [Bug Fixes] - The 'parl' binary (which replaces the old 'par' or 'par.exe') didn't work properly when bundling perl modules for self- contained executables, rendering 'pp' useless on machines without core perl. PAR-1.020/AUTHORS0000644000175000017500000000741512767470055013412 0ustar roderichroderichHere is a list of people and their CPAN id, extracted from the Changes file and the mailing list archives. These people have either submitted patches or suggestions, or their bug reports or comments have inspired the appropriate patches. Note that this list applies to both PAR and the now separate PAR-Packer distribution. Corrections, additions, deletions welcome: Abe Timmerman (ABELTJE) Abhijit Menon-Sen (AMS) Adam Kennedy (ADAMK) Alan Stewart Alan Teague Alasdair Allan (AALLAN) Alexey Borzenkov Alvin Belden Andrew Lee Andy Balaam Andy Lester (PETDANCE) Antti Lankila Arthur Bergman (ABERGMAN) Ask Bjoern Hansen (ABH) Barrie Slaymaker (RBS) Barry Jaspan Bill Atkins (BATKINS) Brad Elliott Brigitte Jellinek Bruce Winter Chia-Liang Kao (CLKAO) Chip Salzenberg (CHIPS) Chris Dolan (CDOLAN) Chris Williams Christian Schiefer Clayton O'Neill (CMO) Corey Goldberg Cosimo Streppone (COSIMO) D. Menzel Daniel Cohen-Laroque Daniel Shane (DSHANE) Darek Adamkiewicz (DADAMK) David Dyck David Romano Doug Gruber Doug Miles Edward S. Peschko Edward Wildgoose Eric Paulson Eric Wilhelm Gaal Yahas (GAAL) Gabor Szabo (SZABGAB) Gerald Richter (GRICHTER) Germain Garand (GGARAND) Glenn Mabbutt H. Wade Minter Henrique Dias (HDIAS) Hirosi Taguti Iain Cass Iain Truskett (SPOON) Ilya Zakharevich (ILYAZ) Indy Singh Ivan Kudryavtsev James Muir Jan Dubois (JDB) Jeff Goff (JGOFF) Jerrad Pierce Jerry Veldhuis Jesse Schoch Jesse Vincent (JESSE) Jody Belka (KNEW) Johan Lindstroem (JOHANL) Johannes Lode John McMahon John Siracusa (JSIRACUSA) Jonathan Leffler (JOHNL) Joseph Landman Jouke Visser (JOUKE) Karl Forner Kieran J Broadfoot Lindsay Morris Luc Willems Malcolm Nooning Marcus Ramberg (MRAMBERG) Mark Dootson (MDOOTSON) Mark Shelor (MSHELOR) Markus Jansen Martin Fabiani Martin Hosken (MHOSKEN) Matt Sergeant (MSERGEANT) Matthew Andersen Matthew Braid (MDBGRIZ) Matthew Riedel Mattia Barbon (MBARBON) Michael Goldberger Michael Schilli (MSCHILLI) Mike Campbell Mike Stok (MIKESTOK) Morbus Iff Murat Uenalan (MUENALAN) Nadim Ibn Hamouda El Khemir (NKH) Nathan Byrd (NBYRD) Ned Konz (NEDKONZ) Nicholas Clark (NWCLARK) Nicolas FROMENT Niko Tyni Nomota KIM Paritosh Tyagi Paul Miller Peter Klewinghaus Patrice Parmentier Patrick Whitney Phil Sallee Piotr Martyniuk PodMaster (PODMASTER) Rafael Garcia-Suarez (RGARCIA) Randal L. Schwartz (MERLYN) Randy Carpenter Randy W. Sims (RANDYS) Reini Urban Richard Soderberg (RSOD) Rick Fitzsimmons Rob Casey (ROBAU) Robert Allerstorfer Robert Creager (RCREAGER) Robert Wyrick Roderich Schupp (RSCHUPP) Rong-En Fan Ryan Briones Sascha Wuestemann Scott Stanton Sim Lim Hai Simon Andrews Simon Cozens (SIMON) Sisyphus Steffen Mueller (SMUELLER) Stephen Pick Steve Hay (SHAY) Steven Mackenzie Thomas Loo (TLOO) Thomas Rush Tim Conrow Tina Mueller (TINITA) Tom Pollard Tommy Butler Ton Hospel (THOSPEL) TP Diffenbach Uri Guttman (URI) Vincent Ladeuil Vladimir Yu. Tereshchenko PAR-1.020/MANIFEST.SKIP0000644000175000017500000000024113073714250014213 0ustar roderichroderich#defaults ^\..*\.sw.$ ^MANIFEST.bak$ ^Makefile$ ^Makefile.old$ ^blib/ ^pm_to_blib ^blibdirs \B\.git\b ^\.gitignore \B\.svn\b ^MYMETA\. ^typescript$ ^t/hello.par PAR-1.020/t/0000755000175000017500000000000014571323312012562 5ustar roderichroderichPAR-1.020/t/01-basic.t0000644000175000017500000000153012767470055014261 0ustar roderichroderich#!/usr/bin/perl use strict; use warnings; use Test::More tests => 8; use File::Spec; use File::Path; use File::Temp (); BEGIN { $ENV{PAR_TMPDIR} = File::Temp::tempdir(TMPDIR => 1, CLEANUP => 1); $ENV{PAR_CLEAN} = 1; } ok( `"$^X" -Mblib -MPAR -It/hello -MHello -e Hello::hello`, "Hello, world!\n", ); ok( `"$^X" -Mblib -MPAR t/hello.par hello.pl`, "Hello, world!\nGoodbye, world!\n", ); ok( `"$^X" -Mblib -MPAR t/hello.par nostrict.pl`, "No Strict!\n", ); ok( `"$^X" -Mblib -MPAR t/hello.par data.pl`, "Data section\nData reflection\n", ); require PAR; PAR->import('t/hello.par'); ok( PAR::read_file('script/hello.pl'), qr/Hello::hello/, ); ok( my $zip = PAR::par_handle('t/hello.par') ); ok( my $member = $zip->memberNamed('lib/Hello.pm') ); ok( $member->contents, qr/package Hello/, ); __END__ PAR-1.020/t/data/0000755000175000017500000000000014571323312013473 5ustar roderichroderichPAR-1.020/t/data/script/0000755000175000017500000000000014571323312014777 5ustar roderichroderichPAR-1.020/t/data/script/nostrict.pl0000644000175000017500000000006413016602547017204 0ustar roderichroderich#!/usr/bin/perl ${'a'} = "No Strict!\n"; print $a; PAR-1.020/t/data/script/hello.pl0000644000175000017500000000011013016602547016432 0ustar roderichroderich#!/usr/bin/perl use Hello; Hello::hello(); print "Goodbye, world!\n"; PAR-1.020/t/data/script/data.pl0000644000175000017500000000012213016602547016243 0ustar roderichroderich#!/usr/bin/perl use Data; Data::data(); print ; __DATA__ Data reflection PAR-1.020/t/data/lib/0000755000175000017500000000000014571323312014241 5ustar roderichroderichPAR-1.020/t/data/lib/Data.pm0000644000175000017500000000012413016602547015450 0ustar roderichroderichpackage Data; use strict; sub data { print ; } 1; __DATA__ Data section PAR-1.020/t/data/lib/Hello.pm0000644000175000017500000000011313016602547015640 0ustar roderichroderichpackage Hello; use strict; sub hello { print "Hello, world!\n"; } 1; PAR-1.020/t/40-par-hashref.t0000644000175000017500000000206612767470055015410 0ustar roderichroderich#!/usr/bin/perl -w use strict; use Test::More tests => 7; use File::Spec; use File::Temp (); use FindBin; use vars qw/@INC %INC/; $ENV{PAR_TMPDIR} = File::Temp::tempdir(TMPDIR => 1, CLEANUP => 1); unshift @INC, ($FindBin::Bin); use_ok('PAR'); my $par = File::Spec->catfile($FindBin::Bin, 'hello.par'); ok(-f $par, 'PAR file for testing exists.'); eval "use PAR { file => '$par'};"; warn $@ if $@; ok(!$@, "use PAR {file =>...} threw error"); require Hello; my $res = Hello::hello(); ok($res, "Hello from PAR returned true"); delete $INC{'Hello.pm'}; %PAR::PAR_INC = %PAR::PAR_INC = (); @PAR::PAR_INC = @PAR::PAR_INC = (); @PAR::PAR_INC_LATE = @PAR::PAR_INC_LATE = (); eval "use PAR { file => '$par', fallback => 1 };"; warn $@ if $@; ok(!$@, "use PAR {file=>...,fallback=>1} threw error"); undef *Hello::hello; require Hello; $res = Hello::hello(); ok(!$res, "Hello from filesys returned false"); ok(eval("require Data; 1;"), 'fallback works'); print PAR->import({run => 'hello', file => $par}); ok(0, 'should not be reached if hello from par file is executed!'); PAR-1.020/t/00-pod.t0000644000175000017500000000040412767470053013756 0ustar roderichroderichuse strict; use warnings; use Test::More; plan skip_all => "Set environment variable PERL_TEST_POD=1 to test POD" if not $ENV{PERL_TEST_POD}; eval "use Test::Pod 1.00"; plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; all_pod_files_ok(); PAR-1.020/t/60-cleanup.t0000644000175000017500000000121412767470055014633 0ustar roderichroderich#!/usr/bin/perl use strict; use warnings; # This test is supposed to make sure that # the /tmp/par-$USER/temp-$$ directories get cleaned up when # in CLEAN mode. use File::Temp (); use Test::More tests => 5; BEGIN { $ENV{PAR_TMPDIR} = File::Temp::tempdir(TMPDIR => 1, CLEANUP => 1); $ENV{PAR_CLEAN} = 1; delete $ENV{PAR_TEMP}; } ok(!defined $ENV{PAR_TEMP}, "No PAR_TEMP to start with"); require PAR; PAR->import(); ok(1, "Loaded PAR"); ok(defined $ENV{PAR_TEMP}, "Loading PAR defined PAR_TEMP"); ok(-d $ENV{PAR_TEMP}, "Loading PAR created the PAR_TEMP directory"); my $partemp = $ENV{PAR_TEMP}; END { ok(not -d $partemp); } __END__ PAR-1.020/t/50-autoloaderfix.t0000644000175000017500000000115212767470055016052 0ustar roderichroderich#!/usr/bin/perl # Problem doesn't manifest if Test::More is in effect? # What the hell? use File::Temp (); BEGIN { $ENV{PAR_TMPDIR} = File::Temp::tempdir(TMPDIR => 1, CLEANUP => 1); } $|=1; print "1..1\n"; use PAR; package Bar; use AutoLoader 'AUTOLOAD'; # Can't use strict and warnings because in case of the # erroneous recursion, we'll require ourselves and get a # "subroutine redefined" error which doesn't matter. sub new { return bless {} => $_[0]; } package main; $INC{"Bar.pm"} = $0; # <-- { my $p = Bar->new(); } # <-- looping while looking for Bar::DESTROY print "ok 1 - AutoLoader works\n"; PAR-1.020/t/gen-hello-par.pl0000644000175000017500000000031213016602547015550 0ustar roderichroderichuse strict; use warnings; use Archive::Zip qw( :ERROR_CODES ); my $zip = Archive::Zip->new(); exit($zip->addTree("t/data", "") == AZ_OK && $zip->writeToFileNamed("t/hello.par") == AZ_OK ? 0 : 1); PAR-1.020/t/Hello.pm0000644000175000017500000000016212767470053014174 0ustar roderichroderichpackage Hello; # This package (and file) is used by 40-par-hashref.t use strict; sub hello { return(); } 1; PAR-1.020/MANIFEST0000644000175000017500000000102614571323312013447 0ustar roderichroderichAUTHORS Changes lib/PAR.pm lib/PAR/Environment.pod lib/PAR/FAQ.pod lib/PAR/Heavy.pm lib/PAR/SetupProgname.pm lib/PAR/SetupTemp.pm lib/PAR/Tutorial.pod LICENSE Makefile.PL MANIFEST This list of files MANIFEST.SKIP META.yml README t/00-pod.t t/01-basic.t t/40-par-hashref.t t/50-autoloaderfix.t t/60-cleanup.t t/data/lib/Data.pm t/data/lib/Hello.pm t/data/script/data.pl t/data/script/hello.pl t/data/script/nostrict.pl t/gen-hello-par.pl t/Hello.pm META.json Module JSON meta-data (added by MakeMaker) PAR-1.020/lib/0000755000175000017500000000000014571323312013065 5ustar roderichroderichPAR-1.020/lib/PAR/0000755000175000017500000000000014571323312013507 5ustar roderichroderichPAR-1.020/lib/PAR/Heavy.pm0000644000175000017500000001452114534627451015136 0ustar roderichroderichpackage PAR::Heavy; use strict; use warnings; $PAR::Heavy::VERSION = '0.12'; =head1 NAME PAR::Heavy - PAR guts =head1 SYNOPSIS (internal use only) =head1 DESCRIPTION No user-serviceable parts inside. =cut ######################################################################## # Dynamic inclusion of XS modules # NOTE: Don't "use" any module here, esp. one that is an XS module or # whose "use" could cause the loading of an XS module thru its dependencies. # enable debug/trace messages from DynaLoader perl code my $dl_debug = $ENV{PERL_DL_DEBUG} || 0; our %FullCache; my ($bootstrap, $dl_findfile); # Caches for code references my ($cache_key); # The current file to find my $is_insensitive_fs = ( -s $0 and (-s lc($0) || -1) == (-s uc($0) || -1) and (-s lc($0) || -1) == -s $0 ); # Adds pre-hooks to Dynaloader's key methods sub _init_dynaloader { return if $bootstrap; return unless eval { require DynaLoader; DynaLoader::dl_findfile(); 1 }; print STDERR "PAR::Heavy: pre-hooks to Dynaloader's key methods\n" if $dl_debug; $bootstrap = \&DynaLoader::bootstrap; $dl_findfile = \&DynaLoader::dl_findfile; { no strict 'refs'; local $^W; no warnings 'redefine'; *{'DynaLoader::dl_expandspec'} = sub { return }; *{'DynaLoader::bootstrap'} = \&_bootstrap; *{'DynaLoader::dl_findfile'} = \&_dl_findfile; } } # Return the cached location of .dll inside PAR first, if possible. sub _dl_findfile { print STDERR "PAR::Heavy::_dl_findfile($cache_key)\n" if $dl_debug; if (exists $FullCache{$cache_key}) { print STDERR " found in FullCache as $FullCache{$cache_key}\n" if $dl_debug; return $FullCache{$cache_key}; } if ($is_insensitive_fs) { # We have a case-insensitive filesystem... my ($key) = grep { lc($_) eq lc($cache_key) } keys %FullCache; if (defined $key) { print STDERR " found case-insensitively in FullCache as $FullCache{$key}\n" if $dl_debug; return $FullCache{$key}; } } print STDERR " fall back to DynaLoader::dl_findfile\n" if $dl_debug; return $dl_findfile->(@_); } # Find and extract .dll from PAR files for a given dynamic module. sub _bootstrap { my (@args) = @_; my ($module) = $args[0] or return; my @modparts = split(/::/, $module); my $modfname = $modparts[-1]; $modfname = &DynaLoader::mod2fname(\@modparts) if defined &DynaLoader::mod2fname; if (($^O eq 'NetWare') && (length($modfname) > 8)) { $modfname = substr($modfname, 0, 8); } my $modpname = join((($^O eq 'MacOS') ? ':' : '/'), @modparts); my $file = $cache_key = "auto/$modpname/$modfname.$DynaLoader::dl_dlext"; if ($FullCache{$file}) { # TODO: understand local $DynaLoader::do_expand = 1; return $bootstrap->(@args); } my $member; # First, try to find things in the preferentially loaded PARs: $member = PAR::_find_par_internals([@PAR::PAR_INC], undef, $file, 1) if defined &PAR::_find_par_internals; # If that failed to find the dll, let DynaLoader (try or) throw an error unless ($member) { my $filename = eval { $bootstrap->(@args) }; return $filename if not $@ and defined $filename; # Now try the fallback pars $member = PAR::_find_par_internals([@PAR::PAR_INC_LAST], undef, $file, 1) if defined &PAR::_find_par_internals; # If that fails, let dynaloader have another go JUST to throw an error # While this may seem wasteful, nothing really matters once we fail to # load shared libraries! unless ($member) { return $bootstrap->(@args); } } $FullCache{$file} = _dl_extract($member); # Now extract all associated shared objs in the same auto/ dir # XXX: shouldn't this also set $FullCache{...} for those files? my $first = $member->fileName; my $path_pattern = $first; $path_pattern =~ s{[^/]*$}{}; if ($PAR::LastAccessedPAR) { foreach my $member ( $PAR::LastAccessedPAR->members ) { next if $member->isDirectory; my $name = $member->fileName; next if $name eq $first; next unless $name =~ m{^/?\Q$path_pattern\E\/[^/]*\.\Q$DynaLoader::dl_dlext\E[^/]*$}; $name =~ s{.*/}{}; _dl_extract($member, $name); } } local $DynaLoader::do_expand = 1; return $bootstrap->(@args); } sub _dl_extract { my ($member, $name) = @_; $name ||= $member->crc32String . ".$DynaLoader::dl_dlext"; my $filename = File::Spec->catfile($ENV{PAR_TEMP} || File::Spec->tmpdir, $name); ($filename) = $filename =~ /^([\x20-\xff]+)$/; return $filename if -e $filename && -s _ == $member->uncompressedSize; # $filename doesn't exist or hasn't been completely extracted: # extract it under a temporary name that isn't likely to be used # by concurrent processes doing the same my $tempname = "$filename.$$"; $member->extractToFileNamed($tempname) == Archive::Zip::AZ_OK() or die "Can't extract archive member ".$member->fileName." to $tempname: $!"; # now that we have a "good" copy in $tempname, rename it to $filename; # if this fails (e.g. some OSes won't let you delete DLLs that are # in use), but $filename exists, we assume that $filename is also # "good": remove $tempname and return $filename unless (rename($tempname, $filename)) { -e $filename or die "can't rename $tempname to $filename: $!"; unlink($tempname); } return $filename; } 1; =head1 SEE ALSO L =head1 AUTHORS Audrey Tang Ecpan@audreyt.orgE You can write to the mailing list at Epar@perl.orgE, or send an empty mail to Epar-subscribe@perl.orgE to participate in the discussion. Archives of the mailing list are available at Ehttps://www.mail-archive.com/par@perl.org/E or Ehttps://groups.google.com/g/perl.parE. Please submit bug reports to Ehttps://github.com/rschupp/PAR/issuesE. =head1 COPYRIGHT Copyright 2002-2010 by Audrey Tang Ecpan@audreyt.orgE. Copyright 2006-2010 by Steffen Mueller Esmueller@cpan.orgE. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See F. =cut PAR-1.020/lib/PAR/SetupTemp.pm0000644000175000017500000001147214562133051015777 0ustar roderichroderichpackage PAR::SetupTemp; $PAR::SetupTemp::VERSION = '1.002'; use 5.008009; use strict; use warnings; use Fcntl ':mode'; use PAR::SetupProgname; =head1 NAME PAR::SetupTemp - Setup $ENV{PAR_TEMP} =head1 SYNOPSIS PAR guts, beware. Check L =head1 DESCRIPTION Routines to setup the C environment variable. The documentation of how the temporary directories are handled is currently scattered across the C manual and the C manual. The C subroutine sets up the C environment variable. =cut # for PAR internal use only! our $PARTemp; # name of the canary file our $Canary = "_CANARY_.txt"; # how much to "date back" the canary file (in seconds) our $CanaryDateBack = 24 * 3600; # 1 day # The C version of this code appears in myldr/mktmpdir.c # This code also lives in PAR::Packer's par.pl as _set_par_temp! sub set_par_temp_env { PAR::SetupProgname::set_progname() unless defined $PAR::SetupProgname::Progname; if (defined $ENV{PAR_TEMP} and $ENV{PAR_TEMP} =~ /(.+)/) { $PARTemp = $1; return; } my $stmpdir = _get_par_user_tempdir(); die "unable to create cache directory" unless $stmpdir; require File::Spec; if (!$ENV{PAR_CLEAN} and my $mtime = (stat($PAR::SetupProgname::Progname))[9]) { require Digest::SHA; my $ctx = Digest::SHA->new(1); if ($ctx and open(my $fh, "<$PAR::SetupProgname::Progname")) { binmode($fh); $ctx->addfile($fh); close($fh); } $stmpdir = File::Spec->catdir( $stmpdir, "cache-" . ( $ctx ? $ctx->hexdigest : $mtime ) ); } else { $ENV{PAR_CLEAN} = 1; $stmpdir = File::Spec->catdir($stmpdir, "temp-$$"); } $ENV{PAR_TEMP} = $stmpdir; mkdir $stmpdir, 0700; $PARTemp = $1 if defined $ENV{PAR_TEMP} and $ENV{PAR_TEMP} =~ /(.+)/; } # Find any digester # Used in PAR::Repository::Client! sub _get_digester { my $ctx = eval { require Digest::SHA; Digest::SHA->new(1) } || eval { require Digest::SHA1; Digest::SHA1->new } || eval { require Digest::MD5; Digest::MD5->new }; return $ctx; } # find the per-user temporary directory (eg /tmp/par-$USER) # Used in PAR::Repository::Client! sub _get_par_user_tempdir { my $username = _find_username(); my $temp_path; foreach my $path ( (map $ENV{$_}, qw( PAR_TMPDIR TMPDIR TEMPDIR TEMP TMP )), qw( C:\\TEMP /tmp . ) ) { next unless defined $path and -d $path and -w $path; # create a temp directory that is unique per user # NOTE: $username may be in an unspecified charset/encoding; # use a name that hopefully works for all of them; # also avoid problems with platform-specific meta characters in the name $temp_path = File::Spec->catdir($path, "par-".unpack("H*", $username)); ($temp_path) = $temp_path =~ /^(.*)$/s; unless (mkdir($temp_path, 0700) || $!{EEXIST}) { warn "creation of private subdirectory $temp_path failed (errno=$!)"; return; } unless ($^O eq 'MSWin32') { my @st; unless (@st = lstat($temp_path)) { warn "stat of private subdirectory $temp_path failed (errno=$!)"; return; } if (!S_ISDIR($st[2]) || $st[4] != $< || ($st[2] & 0777) != 0700 ) { warn "private subdirectory $temp_path is unsafe (please remove it and retry your operation)"; return; } } last; } return $temp_path; } # tries hard to find out the name of the current user sub _find_username { my $username; my $pwuid; # does not work everywhere: eval {($pwuid) = getpwuid($>) if defined $>;}; if ( defined(&Win32::LoginName) ) { $username = &Win32::LoginName; } elsif (defined $pwuid) { $username = $pwuid; } else { $username = $ENV{USERNAME} || $ENV{USER} || 'SYSTEM'; } return $username; } 1; __END__ =head1 SEE ALSO L, L =head1 AUTHORS Audrey Tang Ecpan@audreyt.orgE, Steffen Mueller Esmueller@cpan.orgE You can write to the mailing list at Epar@perl.orgE, or send an empty mail to Epar-subscribe@perl.orgE to participate in the discussion. Archives of the mailing list are available at Ehttps://www.mail-archive.com/par@perl.org/E or Ehttps://groups.google.com/g/perl.parE. Please submit bug reports to Ehttps://github.com/rschupp/PAR/issuesE. If you need support, however, joining the Epar@perl.orgE mailing list is preferred. =head1 COPYRIGHT Copyright 2002-2010 by Audrey Tang Ecpan@audreyt.orgE. Copyright 2006-2010 by Steffen Mueller Esmueller@cpan.orgE. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See F. =cut PAR-1.020/lib/PAR/Environment.pod0000644000175000017500000002034114534627452016532 0ustar roderichroderich=head1 NAME PAR::Environment - Index and reference of PAR environment variables =head1 DESCRIPTION PAR uses various environment variables both during the building process of executables or PAR archives and the I of them. Since the wealth of combinations and settings might confuse one or the other (like me), this document is intended to document all environment variables which PAR uses. Wherever I want to refer to the C<$ENV{FOO}> environment hash entry, I will usually talk about the C variable for brevity. =head1 INDEX OF ENVIRONMENT VARIABLES B For each variable, there should be a description what it contains, when it can be expected to exist (and contain meaningful information), when it is sensible to define it yourself, and what effect this has. Of course, the description may use examples. =head2 PAR_0 If the running program is run from within a PAR archive or pp-produced executable, this variable contains the name of the extracted program (i.e. .pl file). This is useful of you want to open the source code file of the running program. For example, if you package a file F into F and run F with this command par.pl foo.par bar.pl then the C variable will contain something like C where C is your username and C is the PAR cache directory (C). The name of the PAR cache directory can take a number of different forms, so use C if you want to find the extracted program's .pl file -- attempting to construct the name yourself requires complex logic that has already produced the value in C. This works the same for executable binaries (F<.exe>, ...). If you are looking for the name and path of the pp-ed binary file, please refer to the C variable. =head2 PAR_CLEAN Users should set C instead. Recreated from C and the value of C<-C> from the YAML file by the PAR loader, and used within loader to control the initial behavior of extraction, and the final behavior of cleanup. The user can reference C in the application to determine which of these behaviors is being used for this run of the application. =head2 PAR_DEBUG Users should set C instead. If this variable is set to a true value and F is run, verbose output is sent to STDOUT or the logging filehandle. This is overridden by the C<-q> option to F, for steps after argument parsing occurs. This currently only influences F. Whether this is the intended behaviour remains to be verified. =head2 PAR_GLOBAL_CLEAN Setting C alters the behavior of par applications which see that environment variable at launch. C overrides the C<-C> option. Settings of 0 and 1 are supported. 0 corresponds to not using C<-C> on the pp command line; 1 corresponds to using C<-C> on the pp command line. C is ignored if C is set, yet it controls the form of C when C is not set. =head2 PAR_GLOBAL_DEBUG The PAR loader becomes more verbose when C is set. Setting C guarantees that C will be set internally, initially. See C for more details. =head2 PAR_GLOBAL_TEMP Contributes to the calculation of C, and is further explained there. =head2 PAR_GLOBAL_TMPDIR Contributes to the calculation of C, and is further explained there. =head2 PAR_INITIALIZED This environment variable is for internal use by the PAR binary loader only. Documented only to avoid surprises if spawned applications expect to see a value initialized by the user. =head2 PAR_PROGNAME C is set to the fully-qualified path name of the executable program. On Windows, this is reliably obtained from the C API. On other OSes, if the C runtime is given a qualified path name, it is used, or the unqualified file name given is qualified by walking the path. This is reasonably reliable given normal program spawning conventions, but cannot be guaranteed to be correct in all circumstances. =head2 PAR_APP_REUSE Strictly internal. Skip this section if you're not a PAR developer. The variable shouldn't ever be exposed to user code and packaged applications should not depend on it being set or not. If an application has been packaged with the C<--reusable> option, the bootstrapping code will set this environment variable to the name of the program that is to be run instead of the packaged program. The F loader script fetches the file name, deletes the environment variable, and then runs the given program. =head2 PAR_RUN This environment variable was set during constructions of C objects (usually during F runs only) by versions of PAR up to 0.957. Since PAR 0.958, this variable is unused. =head2 PAR_SPAWNED This variable is used internally by the F binary loader to signal the child process that it's the child. You should not rely on this variable outside of the PAR binary loader code. For a slightly more detailed discussion, please refer to the F documentation file in the PAR source distribution which was contributed by Alan Stewart. Documented only to avoid surprises if spawned applications expect to see a value initialized by the user. =head2 PAR_TEMP Users should set C instead. C is calculated from a variety of other variables. See the C section in the pod for PAR.pm for a complete description of how the calculation proceeds. C, once calculated, is used as the location where PAR stores its extracted, temporary file cache. =head2 PAR_TMPDIR Contributes to the calculation of C, and is further explained there. Users should set C instead. =head2 PAR_VERBATIM The C variable controls the way Perl code is packaged into a PAR archive or binary executable. If it is set to a true value during the packaging process, modules (and scripts) are B passed through the default C filter which removes all POD documentation from the code. Note that the C filter is still applied. The C<-F> option to the F tool overrides the C setting. That means if you set C but specify C<-F PodStrip> on the C command line, the C filter will be applied. C is not used by the PAR application. =head2 PAR_VERBOSE Setting this environment variable to a positive integer has the same effect as using the C<-verbose> switch to F. =head2 PP_OPTS During a F run, the contents of the C variable are treated as if they were part of the command line. In newer versions of PAR, you can also write options to a file and execute F as follows to read the options from the file: pp @FILENAME That can, of course, be combined with other command line arguments to F or the C variable. =head2 TMP, TEMP, TMPDIR, TEMPDIR Please refer to C. =head1 SEE ALSO L, L, L L, L, L L for details on PAR distributions. =head1 AUTHORS Steffen Mueller Esmueller@cpan.orgE You can write to the mailing list at Epar@perl.orgE, or send an empty mail to Epar-subscribe@perl.orgE to participate in the discussion. Archives of the mailing list are available at Ehttps://www.mail-archive.com/par@perl.org/E or Ehttps://groups.google.com/g/perl.parE. Please submit bug reports to Ehttps://github.com/rschupp/PAR/issuesE. If you need support, however, joining the Epar@perl.orgE mailing list is preferred. =head1 COPYRIGHT PAR: Copyright 2003-2010 by Audrey Tang, Ecpan@audreyt.orgE. This document: Copyright 2006-2010 by Steffen Mueller, Esmueller@cpan.orgE Some information has been taken from Alan Stewart's extra documentation in the F folder of the PAR distribution. This program or documentation is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See F. =cut PAR-1.020/lib/PAR/FAQ.pod0000644000175000017500000005023314534627453014641 0ustar roderichroderich=encoding utf8 =head1 NAME PAR::FAQ - Frequently Asked Questions about PAR =head1 SYNOPSIS This is the Frequently Asked Questions list for the Perl Archive Toolkit. This (included) FAQ list might be outdated. The Wiki version at the above URL is guaranteed to be up to date. =head1 DESCRIPTION =head2 Where is the Windows binary version? You can find windows binaries here: L There are three ways to install them. Sorted in order of preference: =head3 cpan Run the I command line tool that comes with Perl. In the I shell, type install PAR and wait for the script to download and extract PAR and its dependencies. If you have a C compiler installed, PAR will be built on your computer for your specific version of Perl. If you do not have a C compiler, the installer will look at the site referenced above for a compatible binary release and ask you whether you would like to install it. =head3 ppm If you are using ActivePerl from ActiveState, you can use the 'ppm' program that comes with the ActiveState Perl. Instructions can be found below. PAR is available from various PPM repositories and some packages are compatible with some versions of ActivePerl and not with others. There is an incomplete PAR-Win32 Binary Compatibility List at L There are at least three relevant PPM repositories: The default ActiveState one, the bribes repository which is used in the example below and Randy Kobes' repository at L. C:\> ppm3 # activestate was out of date compared to this one % rep add bribes http://www.bribes.org/perl/ppm # move it to first place on list of repositories % rep up bribes CPAN>upgrade -install PAR And finally, 'q' to quit and that's all :-) You have access to pp and so on... =head3 manual For reference, here's the old explanation of how to install it by hand: The file you need will be called PAR-X.XX-MSWin32-x86-multi-thread-Y.Y.Y.par where X.XX is the version of PAR you will use and Y.Y.Y is the version of Perl you have. Unzip this file (you may need to rename it to end with .zip instead of .par first) and copy all the files in the script directory into a directory in your PATH. Now you should be able to use PAR. =head2 Can PAR bundle all its prerequisites? I This entry needs serious attention. Yes and no. It would be possible to do this but it would also introduce a maintenance nightmare. A new version of PAR would have to be released whenever a new version of any of the dependencies came out. This is already painful with the included L. The original proposal which led to this FAQ entry considered the case where you want to install PAR without a working CPAN.pm/CPAN shell installation or without internet connectivity. By default, PAR will try to install its dependencies from CPAN using the CPAN.pm module. Given that you have a development machine with PAR installed and with a working CPAN.pm, it is reasonably simple to create one or more .par distributions of PAR's dependencies. Install L. Then you can create .par distributions (read: binaries installable with the pure-perl PAR::Dist on the same architecture) for the PAR dependencies as follows: mkdir par_files cpan2par --pattern PAR --follow --out par_files/ --merge --skip File::.* --skip Getopt::Std --skip Carp --skip Data::Dumper --skip Time::Local --skip 'Test\b.*' --skip Text::ParseWords --skip ExtUtils::.* --skip Getopt::Long --skip Text::Abbrev --skip DirHandle --skip Pod::.* (Line breaks inserted for readability.) What happens here? cpan2par uses the API of the CPAN.pm module to fetch the PAR distribution from CPAN, unpacks it, builds it, creates a .par archive from its compiled state and then does the same for any of its dependencies. And then for its dependencies dependencies and... You get the idea. This is what the --follow option does. We add a couple of --skip options to skip core modules which we need not include and any Test::* modules. The --merge option merges all of the .par distributions into the original PAR one. Voila! (Future versions of PAR::Dist::FromCPAN might include an option --skip-core which would skip any modules contained in the core distribution.) After this command worked its magic, you should have a single file PAR-VERSION-ARCHNAME-PERLVERSION.par in the subdirectory 'par_files/'. You can now install PAR and its non-core dependencies on any machine that has the architecture of your development system (and a binary compatible perl version) using L as follows: perl -MPAR::Dist -einstall_par Provided that you run the command from within the directory containing the aforementioned .par file (and no other .par file). Since you might not even have PAR::Dist on the target machine, you can do this simple hack to get a basic installer: perl -MPAR::Dist -e'open my $fh, "<", $INC{"PAR/Dist.pm"}; print <$fh>; print "\npackage main;\nPAR::Dist::install_par(\@ARGV ? shift(\@ARGV) : ());\n\n"' > installer.pl (Again: Line breaks inserted for readability.) This looks for your installed copy of PAR::Dist, reads it, writes it to STDOUT and appends two lines of code: "package main;" and a call to PAR::Dist::install_par. By default, it will install any (single) .par file in the current directory. If supplied with a file name as first argument, it will install the specified file. It should have no non-core dependencies! So shipping the generated PAR-....par file and the installer.pl file to the target machine and running "perl installer.pl" should just magically install PAR and its dependencies for you. Now, this whole trick works equally well for any other modules. In fact, if you have PAR on the target machine, you needn't even install the modules in the .par file in order to use them! You can just add "use PAR 'foo-bar.par';" to your code and any modules will be loaded from the .par file as necessary. ("perl -MPAR=foo-bar.par your_script.pl" works, too.) The documentation of the PAR module has details on this. Finally, note that you can install L on the target machines and subsequently use PAR 0.951 and later to automatically fetch any unfulfilled dependencies from a (remote or local) repository: use PAR { repository => 'http://my_local_secure_host/repository' }; or: use PAR { repository => 'file:///path/to/repository' }; Details, again, in the L documentation and in the L documentation. Answer from: Steffen Mueller, 16 August 2006 =head2 If I try to compile my wxGlade generated script, it doesn't run. What's wrong? I Is this still a problem? Comment out the line that starts with " unless (caller) ", and compile it again. Note that this is considered a bug; clearing the caller stack is a development in progress. =head2 I get a link error '/usr/bin/ld: cannot find -lperl' during the 'make' step of the installation on Debian. What's wrong? Install the C package. Note that Debian provides (usually up-to-date) packages of the modules in the PAR ecosystem: L, L, L and L; the corresponding packages are called C, C, C and C. =head2 I added a directory to my PAR file using "zip -r" or winzip, and then generated an executable from this PAR file, and the executable failed to run (IO error: reading header signature :..). What's wrong? As pointed out by Alan Stewart, zip adds a directory entry for the new directory, and it causes the PAR executable to fail. Just use : zip -r -D hello.par my_dir/ or the Archive::Zip::addTree as follows : $zip->addTree( $root, $dest, sub { -f } ) =head2 On what platforms can I run PAR? On what platforms will the resulting executable run? Win32 (95/98/ME/NT4/2K/XP), FreeBSD, Linux, AIX, Solaris, Darwin and Cygwin. The resulting executable will run on any platforms that supports the binary format of the generating platform. =head2 How do I extract my script out of packed executable? In other words, "I did a `pp foo.pl' and I lost foo.pl, how do I get it back?". The answer is to just use unzip/winzip/winrar/whatever to decompress the executable, treating it like a normal Zip file. You may need to rename the executable into a .zip extension first. =head2 Can PAR completely hide my source code? Not completely, but possible to a degree. Starting from version 0.76, PAR supports an input filter mechanism, which can be used to implement source obfuscators (or even product activation schemes). But if you are looking for 100% bulletproof way of hiding source code, it is not possible with any language. Learning Perl, 3rd Edition has this answer to offer (quoted with permission from Randal Schwartz): If you're wishing for an opaque binary, though, we have to tell you that they don't exist. If someone can install and run your program, they can turn it back into source code. Granted, this won't necessarily be the same source that you started with, but it will be some kind of source code. The real way to keep your secret algorithm a secret is, alas, to apply the proper number of attorneys; they can write a license that says "you can do this with the code, but you can't do that. And if you break our rules, we've got the proper number of attorneys to ensure that you'll regret it." Other than that, I would point you at L. Be sure to read the CAVEATS and WARNINGS sections of the documentation. =head2 On Windows XP, pp crashes saying that "par.exe has encountered a problem" This is believed to be fixed by PAR 0.76_99. The following answer applies to PAR 0.76 and earlier: You may be able to escape this problem by setting some executables to Windows 95 compatibility mode. Specifically, find "parl.exe" (probably in "C:\perl\5.8.0\bin") using Windows Explorer, and right-click on it and choose "Properties". Choose the "Compatibility" tab and tick the box for "Run this program with compatibility mode for" and check that the dropdown shows "Windows 95". Then click OK. Now you can hopefully run pp as normal to generate an EXE. Before you can run the generated EXE, you'll need to set its compatibility mode too, in the same way as you did for parl.exe. This workaround is known not to work in all cases, and the developers are working on a solution to the problem. See these posts for more info: L, L, L, L =head2 Perl Tk tips On Windows XP start your script with use strict; use Encode::Unicode; use Tk; Some widgets use xbm bitmaps which don't get picked up by PAR. The error is: couldn't read bitmap file "": No such file or directory error reading bitmap file "" at Tk/Widget.pm line 205. at Tk/Widget.pm line 203 Fix is to find the missing xbm files (perl -V tells you where to start looking) and add them to the executable eg copy missing xbm files to script directory then: % pp --add cbxarrow.xbm --add arrowdownwin.xbm -o test test.pl =head2 Problem with Win32::Perms and Perms.DLL With a script my.pl using Win32::Perms, pp -o my.exe my.pl you may have: Can't locate loadable object for module Win32::Perms in @INC (@INC contains: CODE(0xb97eec) CODE(0xc8a99c) .) at ../blib/lib/PAR/Heavy.pm line 78 In fact the dll is Perms.DLL wit DLL in capital letters. That's the problem. The bootstrap function of PAR in the Dynaloader module fails looking for Perms.dll in the table of dlls which contains only Perms.DLL. And so the solution is just rename Perms.DLL in Perms.dll and do pp -o my.exe my.pl ... and everything goes right. =head2 Under Win32, a pp packed executable has trouble executing other perl scripts or pp packed executable I Is this still current? When running on a Win32 system, if a perl script is packed with pp and invokes another Perl script or pp packed executable, either with system() or backticks, the invoked program runs with the copy of perl5x.dll already loaded into memory. If the calling executable was packed with "pp -d", the perl5x.dll is the one from the installed perl bin directory. Otherwise, it is the one packed with the executable. The perl5x.dll from the bin dir knows the @INC paths for the installed libraries; the one in the executable does not. Because of this, a program packed without "-d" calling a program with packed with "-d" or calling perl.exe to run a plain Perl script may fail. This is a Win32 limitation. =head2 How can I make a .exe that runs with no console window under Windows? Use the --gui switch, ie % pp --gui -o file.exe file.pl I found that this is not documented on all versions of pp ... Some versions have a more complete doc than others when you type "pp -h" etc. (This should be reasonably documented now.) When searching for an answer to this myself, I found many references to using "exetype" ... it comes as a .bat with ActivePerl, or you can find an exetype.pl from several places. You run "exetype file.exe [WINDOWS|CONSOLE]". This worked, I think, but still did not achieve the desired result on my PAR executable. While the exe itself did not generate a console window, par.exe (which was invoked in my exe somewhere) DID generate a console window, with a titlebar saying "par.exe ", whereas before changing the console window title bar just displayed the path to my .exe. =head2 The command line parameters (@ARGV) of a pp-ed binary called from another pp-ed binary are missing or broken. What the...? This was a bug in releases up to and including PAR-0.90. Please upgrade to PAR 0.91 or later and the problem will go away. =head2 I want to include a pp-ed binary in an RPM package. How can I make this work? The binary executables outputted by pp (on Linux) are not valid ELF binaries because it basically attaches a zip archive to the binary loader and does not modify the ELF headers to reflect that. When building an RPM archive, the validity of the ELF headers is checked by default. This can result in problems when packaging pp-ed binaries in RPM archives. Scott McBrien helped track down what can be done to get this to work: [I]t appears that the RPM archive that is generated gets a list of the MD5 sums for components of the executable file calculated by prelink. By disabling prelink, it fixed the problem; in my RPM .spec file: %define __prelink_undo_cmd %{nil} After quite some time, it seems like the smart folks at Redhat found the culprit. I'm glad *they* did, because I wouldn't have: It appears that we found a solution that works. It like the pp executables are already stripped, so we don't want rpm stripping them again, which, of course, renders them useless. In this case, we added the following lines to the spec file to keep rpm from running the strip process and not produce debuginfo packages: %define __spec_install_post : %define debug_package %{nil} Don't forget to add the ":" character to __spec_install_post as above or this won't work. Much praise to all who helped track this down! The discussion can be found in the following RT tickets: L and L. -- Steffen Mueller, 22 July 2006 =head2 How can I package Wx applications? Have a look at the separately maintained L module. -- Steffen Mueller, 3 July 2006 =head2 How can I package Catalyst web applications? Catalyst has some builtin PAR support. I found the following URL to be very helpful: L. -- Steffen Mueller, 21 July 2006 =head2 The resulting files are huge! How can I reduce the size of the output file? The executables generated by pp generally contain a copy of your Perl shared libraries, the Perl core modules and any module dependencies your packaged application may have. That is a lot. Sometimes, PAR packages too much. It adheres to the philosophy of rather making the application work than generating a streamlined executable. If you want to optimize this, you will have to do so by excluding specific modules. Chris Dolan's recent post to the PAR mailing list explains this well. Quoting Chris: (L) [...] I've found a few tricks that can help a lot: * If you know the target platform has Perl pre-installed (e.g. Mac OS X) then use the "--dependent" flag. This skips all of the core modules, yielding a much smaller executable. One significant caveat is moving to older systems. For example, Mac OS X 10.2 had Perl 5.6.0 which has 146 fewer core modules than Perl 5.8.6 which shipped with Mac OS X 10.4, and (even more significantly) is binary-incompatible with any extra XS modules added from CPAN. Other platforms can be even harder to predict. * Watch for modules that pull in lots of dependencies A good example is DBI. If your program uses DBI, then Module::ScanDeps pulls in ALL of the DBD::* modules (some of which are large) installed on your system, because it cannot realistically parse the DBI->connect() arguments which specify which database drivers are actually needed. In one of my MySQL-based applications, I use this invocation of PAR: pp -X DBD::SQLite -X DBD::CSV -X DBD::File -X DBD::Excel which saves quite a few bytes, because both DBD::SQLite and DBD::Excel have lots of CPAN dependencies. The actual list if DBD::* modules you need to exclude depends on your system. Here's a short command that will reveal all DBD::* modules on a unix-like system: perl -MModule::ScanDeps -le'print for map {"DBD/".$_->{name}} Module::ScanDeps::_glob_in_inc("DBD")' Another smaller example is SOAP::Transport::* where most installations only need SOAP::Transport::HTTP. [...] Similar techniques can be applied when a module makes use of L for plugins. Finally, there is a PAR filter available as a separate distribution on CPAN which compresses the source code as much as possible by first parsing it using PPI and then spitting out a reduced functional equivalent: L. -- Steffen Mueller, August 2006 =head2 How do I use Win32::GUI::SplashScreen with PAR? When using pp to package an application that uses Win32::GUI::SplashScreen, try adding the splashscreen bitmap manually as suggested in the Win32::GUI::SplashScreen docs: pp -a SPLASHFILE.bmp -o xxx.exe xxx.pl =head2 The Perl Packager scripts says that it can create executable that runs in same OS. Can I use it to create Win32 binary with linux machine? Or what should I use to create Win32 executable binary on linux from my script? It is not possible to create stand-alone binaries for different platform than what you are currently running on. This is a generally hard problem since you would have to cross-compile all XS modules and perl itself. Not nice. For example, if you would like to develop an application on Linux and ship it for both Linux/x86 and Win32/x86, it works well to set up a Virtual Machine with a Windows (XP or 2000 or whatever) and a Perl installation. On that machine, use PAR/pp to package your application for Win32. See also the question "On what platforms can I run PAR? On what platforms will the resulting executable run?". -- Steffen Mueller, 2 November 2006 =head1 SEE ALSO L, L =head1 AUTHORS Audrey Tang Ecpan@audreyt.orgE, Steffen Mueller Esmueller@cpan.orgE You can write to the mailing list at Epar@perl.orgE, or send an empty mail to Epar-subscribe@perl.orgE to participate in the discussion. Archives of the mailing list are available at Ehttps://www.mail-archive.com/par@perl.org/E or Ehttps://groups.google.com/g/perl.parE. Please submit bug reports to Ehttps://github.com/rschupp/PAR/issuesE. =head1 COPYRIGHT Copyright 2003-2008 by Audrey Tang Ecpan@audreyt.orgE. This document is free documentation; you can redistribute it and/or modify it under the same terms as Perl itself. See F. =cut PAR-1.020/lib/PAR/SetupProgname.pm0000644000175000017500000000440614562133060016641 0ustar roderichroderichpackage PAR::SetupProgname; $PAR::SetupProgname::VERSION = '1.002'; use 5.008009; use strict; use warnings; use Config; =head1 NAME PAR::SetupProgname - Setup $ENV{PAR_PROGNAME} =head1 SYNOPSIS PAR guts, beware. Check L =head1 DESCRIPTION Routines to setup the C environment variable. Read the C manual. The C subroutine sets up the C environment variable =cut # for PAR internal use only! our $Progname = $ENV{PAR_PROGNAME} || $0; # same code lives in PAR::Packer's par.pl! sub set_progname { require File::Spec; if (defined $ENV{PAR_PROGNAME} and $ENV{PAR_PROGNAME} =~ /(.+)/) { $Progname = $1; } $Progname = $0 if not defined $Progname; if (( () = File::Spec->splitdir($Progname) ) > 1 or !$ENV{PAR_PROGNAME}) { if (open my $fh, $Progname) { return if -s $fh; } if (-s "$Progname$Config{_exe}") { $Progname .= $Config{_exe}; return; } } foreach my $dir (split /\Q$Config{path_sep}\E/, $ENV{PATH}) { next if exists $ENV{PAR_TEMP} and $dir eq $ENV{PAR_TEMP}; my $name = File::Spec->catfile($dir, "$Progname$Config{_exe}"); if (-s $name) { $Progname = $name; last } $name = File::Spec->catfile($dir, "$Progname"); if (-s $name) { $Progname = $name; last } } } 1; __END__ =head1 SEE ALSO L, L =head1 AUTHORS Audrey Tang Ecpan@audreyt.orgE, Steffen Mueller Esmueller@cpan.orgE You can write to the mailing list at Epar@perl.orgE, or send an empty mail to Epar-subscribe@perl.orgE to participate in the discussion. Archives of the mailing list are available at Ehttps://www.mail-archive.com/par@perl.org/E or Ehttps://groups.google.com/g/perl.parE. Please submit bug reports to Ehttps://github.com/rschupp/PAR/issuesE. If you need support, however, joining the Epar@perl.orgE mailing list is preferred. =head1 COPYRIGHT Copyright 2002-2010 by Audrey Tang Ecpan@audreyt.orgE. Copyright 2006-2010 by Steffen Mueller Esmueller@cpan.orgE. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See F. =cut PAR-1.020/lib/PAR/Tutorial.pod0000644000175000017500000005061714534627454016044 0ustar roderichroderich=head1 NAME PAR::Tutorial - Cross-Platform Packaging and Deployment with PAR =head1 SYNOPSIS This is a tutorial on PAR, first appeared at the 7th Perl Conference. The HTML version of this tutorial is available online as L =head1 DESCRIPTION =head2 On Deploying Perl Applications % sshnuke.pl 10.2.2.2 -rootpw="Z1ON0101" Perl v5.6.1 required--this is only v5.6.0, stopped at sshnuke.pl line 1. BEGIN failed--compilation aborted at sshnuke.pl line 1. =over 4 =item * Q: "Help! I can't run your program!" =item * A1: Install Perl & C =over 4 =item * How do we know which modules are needed? =item * New versions of CPAN modules may break C =back =item * A2: Install Perl & C =over 4 =item * Possibly overwriting existing modules; not cross-platform at all =back =item * A3: Use the executable generated by C =over 4 =item * Impossible to debug; C usually does not work anyway =back =back =head2 PAR, the Perl Archive Toolkit =over 4 =item * Do what JAR (Java Archive) does for Perl =over 4 =item * Aggregates modules, scripts and other files into a Zip file =item * Easy to generate, update and extract =item * Version consistency: solves forward-compatibility problems =item * Developed by community: C =back =item * PAR files can be packed into self-contained scripts =over 4 =item * Automatically scans perl script for dependencies =item * Bundles all necessary 3rd-party modules with it =item * Requires only core Perl to run on the target machine =item * PAR also comes with C, the Perl Packager: % pp -o sshnuke.exe sshnuke.pl # stand-alone executable! =back =back =head2 Simple Packaging =over 4 =item * PAR files are just Zip files with modules in it =item * Any Zip tools can generate them: % zip foo.par Hello.pm World.pm # pack two modules % zip -r bar.par lib/ # grab all modules in lib/ =item * To load modules from PAR files: use PAR; use lib "foo.par"; # the .par part is optional use Hello; =item * This also works: use PAR "/home/mylibs/*.par"; # put all of them into @INC use Hello; =back =head2 PAR Loaders =over 4 =item * Use C to run files inside a PAR archive: % par.pl foo.par # looks for 'main.pl' by default % par.pl foo.par test.pl # runs script/test.pl in foo.par =item * Same thing, with the stand-alone C or C: % parl foo.par # no perl or PAR.pm needed! % parl foo.par test.pl # ditto =item * The PAR loader can prepend itself to a PAR file: =over 4 =item * C<-b> bundles non-core modules needed by C: % par.pl -b -O./foo.pl foo.par # self-contained script =item * C<-B> bundles core modules in addition to C<-b>: % parl -B -O./foo.exe foo.par # self-contained binary =back =back =head2 Dependency Scanning =over 4 =item * Recursively scan dependencies with C: % scandeps.pl sshnuke.pl # Legend: [C]ore [X]ternal [S]ubmodule [?]NotOnCPAN 'Crypt::SSLeay' => '0', # X # 'Net::HTTP' => '0', # # 'Crypt::SSLeay::X509' => '0', # S # Crypt::SSLeay 'Net::HTTP::Methods' => '0', # S # Net::HTTP 'Compress::Zlib' => '0', # X # Net::HTTP::Methods =item * Scan an one-liner, list all involved files: % scandeps.pl -V -e "use Dynaloader;" ... # auto/DynaLoader/dl_findfile.al [autoload] # auto/DynaLoader/extralibs.ld [autoload] # auto/File/Glob/Glob.bs [data] # auto/File/Glob/Glob.so [shared] ... =back =head2 Perl Packager: C =over 4 =item * Combines scanning, zipping and loader-embedding: % pp -o out.exe src.pl # self-contained .exe % out.exe # runs anywhere on the same OS =item * Bundle additional modules: % pp -o out.exe -M CGI src.pl # pack CGI + its dependencies, too =item * Pack one-liners: % pp -o out.exe -e 'print "Hi!"' # turns one-liner into executable =item * Generate PAR files instead of executables: % pp -p src.pl # makes 'source.par' % pp -B -p src.pl # include core modules =back =head2 How it works =over 4 =item * Command-line options are almost identical to C's =over 4 =item * Also supports C-style long options: % pp --gui --verbose --output=out.exe src.pl =back =item * Small initial overhead; no runtime overhead =item * Dependencies are POD-stripped before packing =item * Loads modules directly into memory on demand =item * Shared libraries (DLLs) are extracted with File::Temp =item * Works on Perl 5.6.0 or above =item * Tested on Win32 (VC++ and MinGW), FreeBSD, NetBSD, Linux, MacOSX, Cygwin, AIX, Solaris, HP-UX, Tru64... =back =head2 Aggregating multiple programs =over 4 =item * A common question: > I have used pp to make several standalone applications which work > great, the only problem is that for each executable that I make, I am > assuming the parl.exe is somehow bundled into the resulting exe. =item * The obvious workaround: You can ship parl.exe by itself, along with .par files built by "pp -p", and run those PAR files by associating them to parl.exe. =item * On platforms that have C, there is a better solution: % pp --output=a.out a.pl b.pl # two scripts in one! % ln a.out b.out # symlink also works % ./a.out # runs a.pl % ./b.out # runs b.pl =back =head2 Cross-platform Packages =over 4 =item * Of course, there is no cross-platform binary format =item * Pure-perl PAR packages are cross-platform by default =over 4 =item * However, XS modules are specific to Perl version and platform =item * Multiple versions of a XS module can co-exist in a PAR file =back =item * Suppose we need C on both Win32 and Finix: C:\> pp --multiarch --output=out.par src.pl ...copy src.pl and out.par to a Finix machine... % pp --multiarch --output=out.par src.pl =item * Now it works on both platforms: % parl out.par # runs src.pl % perl -MPAR=out.par -e '...' # uses modules inside out.par =back =head2 The Anatomy of a PAR file =over 4 =item * Modules can reside in several directories: / # casual packaging only /lib/ # standard location /arch/ # for creating from blib/ /i386-freebsd/ # i.e. $Config{archname} /5.8.0/ # i.e. Perl version number /5.8.0/i386-freebsd/ # combination of the two above =item * Scripts are stored in one of the two locations: / # casual packaging only /script/ # standard location =item * Shared libraries may be architecture- or perl-version-specific: /shlib/(5.8.0/)?(i386-freebsd/)? =item * PAR files may recursively contain other PAR files: /par/(5.8.0/)?(i386-freebsd/)? =back =head2 Special files =over 4 =item * MANIFEST =over 4 =item * Index of all files inside PAR =item * Can be parsed with C =back =item * META.yml =over 4 =item * Dependency, license, runtime options =item * Can be parsed with C =back =item * SIGNATURE =over 4 =item * OpenPGP-signed digital signature =item * Can be parsed and verified with C =back =back =head2 Advantages over perlcc, PerlApp and Perl2exe =over 4 =item * This is not meant to be a flame =over 4 =item * All three maintainers have contributed to PAR directly; I'm grateful =back =item * perlcc =over 4 =item * "The code generated in this way is not guaranteed to work... Use for production purposes is strongly discouraged." (from perldoc perlcc) =item * I is more like it =back =item * PerlApp / Perl2exe =over 4 =item * Expensive: Need to pay for each upgrade =item * Non-portable: Only available for limited platforms =item * Proprietary: Cannot extend its features or fix bugs =item * Obfuscated: Vendor and black-hats can see your code, but you can't =item * Inflexible: Does not work with existing Perl installations =back =back =head2 MANIFEST: Best viewed with Mozilla =over 4 =item * The URL of C inside C: jar:file:///home/autrijus/foo.par!/MANIFEST =item * Open it in a Gecko browser (e.g. Netscape 6+) with Javascript enabled: =item * No needed to unzip anything; just click on files to view them =back =head2 META.yml: Metadata galore =over 4 =item * Static, machine-readable distribution metadata =over 4 =item * Supported by C, C, C =back =item * A typical C-generated C looks like this: build_requires: {} conflicts: {} dist_name: out.par distribution_type: par dynamic_config: 0 generated_by: 'Perl Packager version 0.03' license: unknown par: clean: 0 signature: '' verbatim: 0 version: 0.68 =item * The C settings controls its runtime behavior =back =head2 SIGNATURE: Signing and verifying packages =over 4 =item * OpenPGP clear-signed manifest with SHA1 digests =over 4 =item * Supported by C, C and C =back =item * A typical C looks like this: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 SHA1 8a014cd6d0f6775552a01d1e6354a69eb6826046 AUTHORS ... -----BEGIN PGP SIGNATURE----- ... -----END PGP SIGNATURE----- =item * Use C and C to work with signatures: % pp -s -o foo.par bar.pl # make and sign foo.par from bar.pl % cpansign -s foo.par # sign this PAR file % cpansign -v foo.par # verify this PAR file =back =head2 Perl Servlets with Apache::PAR =over 4 =item * Framework for self-contained Web applications =over 4 =item * Similar to Java's "Web Application Archive" (WAR) files =item * Works with mod_perl 1.x or 2.x =back =item * A complete web application inside a C<.par> file =over 4 =item * Apache configuration, static files, Perl modules... =item * Supports Static, Registry and PerlRun handlers =item * Can also load all PARs under a directory =back =item * One additional special file: C Alias /myapp/cgi-perl/ ##PARFILE##/ Options +ExecCGI SetHandler perl-script PerlHandler Apache::PAR::Registry =back =head2 Hon Dah, A-par-che! =over 4 =item * First, make a C from an one-liner: # use the "web.conf" from the previous slide % pp -p -o hondah.par -e 'print "Hon Dah!\n"' \ --add web.conf % chmod a+x hondah.par =item * Add this to C, then restart apache: PerlModule Apache2 PerlAddVar PARInclude /home/autrijus/hondah.par PerlModule Apache::PAR =item * Test it out: % GET http://localhost/myapp/cgi-perl/main.pl Hon Dah! =item * Instant one-liner web application that works! =back =head2 On-demand library fetching =over 4 =item * With LWP installed, your can use remote PAR files: use PAR; use lib 'http://aut.dyndns.org/par/DBI-latest.par'; use DBI; # always up to date! =item * Modules are now cached under C<$ENV{PAR_GLOBAL_TEMP}> =item * Auto-updates with C =over 4 =item * Download only if modified =item * Safe for offline use after the first time =item * May use C to prevent DNS-spoofing =back =item * Makes large-scale deployment a breeze =over 4 =item * Upgrades from a central location =item * No installers needed =back =back =head2 Code Obfuscation =over 4 =item * Also known as I techniques =over 4 =item * It is I encryption =item * Offered by PerlApp, Perl2Exe, Stunnix... =back =item * Usually easy to defeat =over 4 =item * Take optree dump from memory, feed to C =item * If you just want to stop a casual C, "deflate" already works =back =item * PAR now supports pluggable I with C =over 4 =item * Bundled examples: Bleach, PodStrip and PatchContent =item * True encryption using C =item * Or even _product activation_ over the internet =back =item * Alternatively, just keep core logic in your server and use RPC =back =head2 Accessing packed files =over 4 =item * To get the host archive from a packed program: my $zip = PAR::par_handle($0); # an Archive::Zip object my $content = $zip->contents('MANIFEST'); =item * Same thing, but with C: my $content = PAR::read_file('MANIFEST'); =item * Loaded PAR files are stored in C<%PAR::LibCache>: use PAR '/home/mylibs/*.par'; while (my ($filename, $zip) = each %PAR::LibCache) { print "[$filename - MANIFEST]\n"; print $zip->contents('MANIFEST'); } =back =head2 Packing GUI applications =over 4 =item * GUI toolkits often need to link with shared libraries: # search for libncurses under library paths and pack it % pp -l ncurses curses_app.pl # same for Tk, Wx, Gtk, Qt... =item * Use C on Win32 to eliminate the console window: # pack 'src.pl' into a console-less 'out.exe' (Win32 only) % pp --gui -o out.exe src.pl =item * "Can't locate Foo/Widget/Bar.pm in @INC"? =over 4 =item * Some toolkits (notably Tk) autoloads modules without C or C =item * Hence C and C may fail to detect them =item * Tk problems mostly fixed by now, but other toolkits may still break =item * You can work around it with C or an explicit C =item * Or better, send a short test-case to C so we can fix it =back =back =head2 Precompiled CPAN distributions =over 4 =item * Installing XS extensions from CPAN was difficult =over 4 =item * Some platforms do not come with a compiler (Win32, MacOSX...) =item * Some headers or libraries may be missing =item * PAR.pm itself used to suffer from both problems =back =item * ...but not anymore -- C to the rescue! # same old Makefile.PL, with a few changes use inc::Module::Install; # was "use ExtUtils::MakeMaker;" WriteMakefile( ... ); # same as the original check_nmake(); # make sure the user have nmake par_base('AUTRIJUS'); # your CPAN ID or a URL fetch_par() unless can_cc(); # use precompiled PAR only if necessary =item * Users will not notice anything, except now it works =over 4 =item * Of course, you still need to type C and upload the precompiled package =item * PAR users can also install it directly with C =back =back =head2 Thank you! =over 4 =item * Additional resources =over 4 =item * Mailing list: C =item * Subscribe: Send a blank email to C =item * List archive: L =item * PAR::Intro: L =item * Apache::PAR: L =item * Module::Install: L =back =item * Any questions? =back =head2 Overview of PAR.pm's Implementation =over 4 =item * Here begins the scary part =over 4 =item * Grues, Dragons and Jabberwocks abound... =item * You are going to learn weird things about Perl internals =back =item * PAR invokes four areas of Perl arcana: =over 4 =item * @INC code references =item * On-the-fly source filtering =item * Overriding C to handle XS modules =item * Making self-bootstrapping binary executables =back =item * The first two only works on 5.6 or later =over 4 =item * DynaLoader and C<%INC> are there since Perl 5 was born =item * PAR currently needs 5.6, but a 5.005 port is possible =back =back =head2 Code References in @INC =over 4 =item * On 1999-07-19, Ken Fox submitted a patch to P5P =over 4 =item * To _enable using remote modules_ by putting hooks in @INC =item * It's accepted to come in Perl 5.6, but undocumented until 5.8 =item * Type C to read the nitty-gritty details =back =item * Coderefs in @INC may return a fh, or undef to 'pass': push @INC, sub { my ($coderef, $filename) = @_; # $coderef is \&my_sub open my $fh, "wget ftp://example.com/$filename |"; return $fh; # using remote modules, indeed! }; =item * Perl 5.8 let you open a file handle to a string, so we just use that: open my $fh, '<', \($zip->memberNamed($filename)->contents); return $fh; =item * But Perl 5.6 does not have that, and I don't want to use temp files... =back =head2 Source Filtering without Filter::* Modules =over 4 =item * ... Undocumented features to the rescue! =over 4 =item * It turns out that @INC hooks can return B values =item * The first is still the file handle =item * The second is a code reference for line-by-line source filtering! =back =item * This is how C works: # Force all modules used to use strict and warnings open my $fh, "<", $filename or return; my @lines = ("use strict; use warnings;\n", "#line 1 \"$full\"\n"); return ($fh, sub { return 0 unless @lines; push @lines, $_; $_ = shift @lines; return length $_; }); =back =head2 Source Filtering without Filter::* Modules (cont.) =over 4 =item * But we don't really have a filehandle for anything =item * Another undocumented feature saves the day! =item * We can actually omit the first return value altogether: # Return all contents line-by-line from the file inside PAR my @lines = split( /(?<=\n)/, $zip->memberNamed($filename)->contents ); return (sub { $_ = shift(@lines); return length $_; }); =back =head2 Overriding DynaLoader::bootstrap =over 4 =item * XS modules have dynamically loaded libraries =over 4 =item * They cannot be loaded as part of a zip file, so we extract them out =item * Must intercept DynaLoader's library-finding process =back =item * Module names are passed to C for XS loading =over 4 =item * During the process, it calls C to locate the file =item * So we install pre-hooks around both functions =back =item * Our C<_bootstrap> just checks if the library is in PARs =over 4 =item * If yes, extract it to a C temp file =over 4 =item * The file will be automatically cleaned up when the program ends =back =item * It then pass the arguments to the original C =item * Finally, our C intercepts known filenames and return it =back =back =head2 Anatomy of a Self-Contained PAR executable =over 4 =item * The par script ($0) itself =over 4 =item * May be in plain-text or native executable format =back =item * Any number of embedded files =over 4 =item * Typically used to bootstrap PAR's various dependencies =item * Each section begins with the magic string "FILE" =item * Length of filename in pack('N') format and the filename (auto/.../) =item * File length in pack('N') and the file's content (not compressed) =back =item * One PAR file =over 4 =item * Just a regular zip file with the magic string C<"PK\003\004"> =back =item * Ending section =over 4 =item * A pack('N') number of the total length of FILE and PAR sections =item * Finally, there must be a 8-bytes magic string: C<"\012PAR.pm\012"> =back =back =head2 Self-Bootstrapping Tricks =over 4 =item * All we can expect is a working perl interpreter =over 4 =item * The self-contained script *must not* use any modules at all =item * But to process PAR files, we need XS modules like Compress::Zlib =back =item * Answer: bundle all modules + libraries used by PAR.pm =over 4 =item * That's what the C section in the previous slide is for =item * Load modules to memory, and write object files to disk =item * Then use a local C<@INC> hook to load them on demand =back =item * Minimizing the amount of temporary files =over 4 =item * First, try to load PerlIO::scalar and File::Temp =item * Set up an END hook to unlink all temp files up to this point =item * Load other bundled files, and look in the compressed PAR section =item * This can be much easier with a pure-perl C; patches welcome! =back =back =head2 Thank you (again)! =over 4 =item * Any questions, I? =back =cut =head1 SEE ALSO L, L, L, L L, L L, L, L, L =head1 AUTHORS Audrey Tang Ecpan@audreyt.orgE You can write to the mailing list at Epar@perl.orgE, or send an empty mail to Epar-subscribe@perl.orgE to participate in the discussion. Archives of the mailing list are available at Ehttps://www.mail-archive.com/par@perl.org/E or Ehttps://groups.google.com/g/perl.parE. Please submit bug reports to Ehttps://github.com/rschupp/PAR/issuesE. =head1 COPYRIGHT Copyright 2003, 2004, 2005, 2006 by Audrey Tang Ecpan@audreyt.orgE. This document is free documentation; you can redistribute it and/or modify it under the same terms as Perl itself. See F. =cut PAR-1.020/lib/PAR.pm0000644000175000017500000011756714562140027014066 0ustar roderichroderichpackage PAR; $PAR::VERSION = '1.020'; use 5.008009; use strict; use warnings; use Config; use Carp qw/croak/; # If the 'prefork' module is available, we # register various run-time loaded modules with it. # That way, there is more shared memory in a forking # environment. BEGIN { if (eval 'require prefork') { prefork->import($_) for qw/ Archive::Zip File::Glob File::Spec File::Temp Fcntl LWP::Simple PAR::Heavy /; # not including Archive::Unzip::Burst which only makes sense # in the context of a PAR::Packer'ed executable anyway. } } use PAR::SetupProgname; use PAR::SetupTemp; =head1 NAME PAR - Perl Archive Toolkit =head1 SYNOPSIS (If you want to make an executable that contains all module, scripts and data files, please consult the L utility instead. L used to be part of the PAR distribution but is now shipped as part of the L distribution instead.) Following examples assume a F file in Zip format. To use F from F<./foo.par>: % perl -MPAR=./foo.par -MHello % perl -MPAR=./foo -MHello # the .par part is optional Same thing, but search F in C<@INC>: % perl -MPAR -Ifoo.par -MHello % perl -MPAR -Ifoo -MHello # ditto Following paths inside the PAR file are searched: /lib/ /arch/ /i386-freebsd/ # i.e. $Config{archname} /5.8.0/ # i.e. $Config{version} /5.8.0/i386-freebsd/ # both of the above / PAR files may also (recursively) contain other PAR files. All files under following paths will be considered as PAR files and searched as well: /par/i386-freebsd/ # i.e. $Config{archname} /par/5.8.0/ # i.e. $Config{version} /par/5.8.0/i386-freebsd/ # both of the above /par/ Run F