Loading...
 

Package.pl

Program used to package Perl software for delivery.

Overview

The primary purpose of this program is to package the interpreted perl files
into a compressed tar file for installation on computers with a perl
interpreter installed. In it's simplest form the needed files are copied from
the source dir to the dest dir and then the dest dir is archived into a "tar"
file named after the dest dir. The basic function can be modified by options
that work to either change the work completed or provide additional info about
the work performed.

It operates either by copying files from the local working directory, or by first creating an interim source directory by exporting the files from SVN and copying from there. The default is to use the local working directory. The SVN repository is accessed by invoking the "-r" (release) option.

First the source directory structure is deleted if requested. Then the provided source location is scanned for file structure that is built at the destination location and applicable files are copied from the source structure to the destination structure. Once the copying is complete applicable files are compiled if requested. The entire destination directory structure is packed into a tar.gz file as the last step.

This program is an individual file that must be made usable by the code packager. It can be copied into each application release directory or placed into a "bin" directory in the packager's login path. I have created links from each of the application release directories I manage to the main program file in the fautore/tools SVN working directory. This assures the version is always the very latest without having the copy the base file anywhere else.

Applicable Files

The below listed files are processed into the package by default. Files to be processed can be changed with the below listed options.

.pl .pm .sql .cgi .jpg .png .gif .css .wav .js .html .ico .upd

Major Features

  • Creates *.tar.gz package
  • Can extract from SVN as an export
  • Can compile code (in development)
  • Can embeds version # in package name

Dependencies

  • Cwd;
  • File::Find;
  • File::Path qw/make_path remove_tree/;
  • File::Copy qw(cp);
  • File::Basename;
  • Par::Packer (provides "pp" command)

Usage

./package.pl opts {dest} {source}

Where:
opts : options specified to manage program behavior. None are required.
(that's why they're called options)

source : The location of the files from which the package is to be built.
This is a reference to the top level directory containing the
code to be built.

dest : The directory location to which the code will be placed. It's
recommended this directory be named to include the program name
and version because this resulting tar package file is named
after the referenced directory. This directory is created if it
doesn't already exist.

Note: An interim directory called "exp" is created for the initial export of the code and it is subsequently moved to the final destination. The "exp" directory is intentionall left behind for reference. It can be safely deleted by hand or the "-d" option can be used to delete the directory if it exists at runtime.

Options
Opt Param Default Description
-a none off The package.pl program only includes files matching an internal suffix list in it's processing (see 'Applicable Files'). This option turns off suffix checking and all files are included in the tar. This is good for using package.pl to create a complete workspace archive Indicates everything encountered in the source directory should be packaged.
-c string i Indicates all encountered *.pl files should be compiled. The provided string is affixed to the file package file name as an indicator for what OS the compilation supports. The "i" default indicates it is an interpreted version not a compiled perl package. This feature is in development and THE USE OF THIS OPTION IS DISCOURAGED. Use the "fauBuild" tool to create executables instead.
-d none off Delete existing files from the destination location that match files in the source location. Files existing in destination, but not the source are not deleted.Use this option if a warning that the interim exp file exists is issued when running this program.
-e File list undef Comma separated list of files to be excluded from packaging. Do not space separate the files. If parameter leads with a dot (.) the parameter will be treated as a file suffix. If not led by a dot the parameter will be treated as a complete file name. The -e does not currently work for directories. Suffix and name references can be intermixed as a comma separated list to this option.
-h none off Present program help screen.
-n {app name} fautore Provide the application name for inclusion in the tar file name. Meant to be used in concert with -r (release). Option default is "fautore".
-r Version string undef String to use for version in file name. (Format #-#-# ) Exports files from SVN in order to create a clean staging area that is assured to only contain official repository files. When using this option the "source" parameter can be either the local SVN working directory or the repository host server reference.
-s none 0 Report detail stats for the package run.
-v none 0 Verbose activity reporting. Does not automatically trigger stats reporting. The "-s" option is still necessary if you want to to see stats. Takes a numeric parameter. Multi-level reporting not yet implemented. This acts as a binary on/off feature at the moment.

Examples

./package.pl -r 6-0-0 -n fautore ~/dev/fautore/trunk
create directory fautore_6-0-0_n, export all applicable source files into the fautore_6-0-0_n directory from ~/dev/fautore/trunk by way of an interim "exp" directory, compile all the *.pl files and package everything into a fautore_6-0-0_lm.tar.gz file for delivery.

./package.pl -s -c lm -r 1-0-0 -n fauSendFile ~/dev/fautore/apps/fauSendFile
create directory fauSendFile_1-0-0_lm, export all applicable source files into the fauSendFile_1-0-0_lm from ~/dev/fautore/apps/fauSendFile by way of an interim "exp" directory, compile all the *.pl files and package everything into a fauSendFile_1-0-0_lm.tar.gz file for delivery showing overall statics when complete.

Seven steps to using the Internet in privacy as a respected Netizen.
  1. Perspective
  2. Search
  3. Email
  4. Social Security
  5. Have Presence
  6. Take Control
  7. Break The Ties

Shoutbox

Steve: Fautore 0.6.0.0 is now released and available to our registered Alpha participants!
Steve: Fautore 5.3.0 is now released and includes dynamically updated stats reporting!
Steve: Fautore 0.5.2.3 FILES.pm patch is up on the site. Thanks for the inputs. Keep it coming. We'll make Fautore a reality together.