29 Jan 2021 02:26:48 UTC
- Distribution: App-scriptdist
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (0)
- Testers (112 / 0 / 2)
- KwaliteeBus factor: 1
- % Coverage
- License: artistic_2
- Perl: v5.10.0
- Activity24 month
- Download (13.7KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:1 non-PAUSE userBDFOY brian d foy
- TO DO
- SOURCE AVAILABILITY
scriptdist - create a distribution for a perl script
% scriptdist script.pl
The scriptdist program takes a script file and builds, in the current working directory, a Perl script distribution around it. You can add other files to the distribution once it is in place.
This script is designed to be a stand-alone program. You do not need any other files to use it. However, you can create a directory named .scriptdist in your home directory, and scriptdist will look for local versions of template files there. Any files in ~/.scriptdist/t will show up as is in the script's t directory (until I code the parts to munge those files). The script assumes you have specified your home directory in the environment variable HOME.
You can turn on optional progress and debugging messages by setting the environment variable SCRIPTDIST_DEBUG to a true value.
Check for release information
The first time the scriptdist is run, or any time the scriptdist cannot find the file
.scriptdistrc, it prompts for CPAN and SourceForge developer information that it can add to the .releaserc file. (NOT YET IMPLEMENTED)
Create a directory named after the script
The distribution directory is named after the script name, with a .d attached. The suffix is there only to avoid a name conflict. You can rename it after the script is moved into the directory. If the directory already exists, the script stops. You can either move or delete the directory and start again.
Look for template files
The program looks in .scriptdistrc for files to copy into the target script distribution directory. After that, it adds more files unless they already exist (i.e. the script found them in the template directory). The script replaces strings matching
%%SCRIPTDIST_FOO%%with the internal value of FOO. The defined values are currently SCRIPT, which substitutes the script name, and VERSION, whose value is currently hard-coded at '0.10'.
While looking for files, scriptdist skips directories named CVS, .git, and .svn.
A bare bones Changes file
Create the Makefile.PL
Create the t directory
Add compile.t, pod.t, prereq.t
Copy the script into the directory
Run make manifest
Create git repo
Unless you set the
scriptdistcreates a git repo, adds everything, and does an initial import.
A few things have to show up in the Makefile.PL—the name of the script and the prerequisites modules are the most important. Luckily, scriptdist can discover these things and fill them in automatically.
Copy modules into lib directory (to create module dist)
Command line switches to turn things on and off
Add a cover.t and pod coverage test?
automatically import into Git?
This source is part of a Github project.
Thanks to Soren Andersen for putting this script through its paces and suggesting many changes to actually make it work.
brian d foy,
Copyright © 2004-2021, brian d foy <firstname.lastname@example.org>. All rights reserved.
This code is available under the Artistic License 2.0.
Module Install Instructions
To install App::scriptdist, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install App::scriptdist
For more information on module installation, please visit the detailed CPAN module installation guide.