Unix validation tools: Configuration and installation
The installation routines are hand-made. I know: thats bad ;-) That's why one of the most important tasks on my to do list is to implement an installation procedure conforming to the "Perl way". But I wanted to present an installation yet without torturing you with a list of cp, chmod, sed or other shell commands. I built a Perl script and a Makefile, which contain the nesseccary commands and some checks for pathnames, Perl modules and other stuff. I hope you can live with it, in the meantime I will study the ExtUtils::MakeMaker documentation.
Here is a quick reference how to configure and install the tools:
- Step 1: extract the archive
Extract it in a directory of your choice. All files will be extracted in the subdirectory SysVTools. - Step 2: configure
Change to SysVTools and call the program configure.pl. It checks some important system requirements and creates the Makefile, which will perform the installation. To learn more about the options see Configuration below. - Step 3: install
Call make in the SysVTools directory. This will execute the Makefile. The modules, programs, message catalogues and manual pages are copied to their respective destinations and a symbolic links to sysvtools.pl is created for every available tool. erzeugt.
And so it looks in a terminal when you follow the steps:
jan@jack:~/sysvtools/install> tar xzf SysVTools.tgz jan@jack:~/sysvtools/install> cd SysVTools jan@jack:~/sysvtools/install/SysVTools> perl ./configure.pl PREFIX=/home/jan/sysvtools perl executable ... /usr/bin/perl perl version ... 5.8.3 check for module POSIX::strptime check for module Locale::gettext library path .. /home/jan/sysvtools/lib binary path .. /home/jan/sysvtools/bin manual path .. /home/jan/sysvtools/man locale path .. /home/jan/sysvtools/locale creating Makefile .. done call 'make install_lib' to only install the modules and documentation call 'make all' or 'make' to install the modules, documentation and the binaries jan@jack:~/sysvtools/install/SysVTools> make ...
After extracting the archive you will find the following files in the SysVTools directory:
SysVTools
|-- Changes # log of changes
|-- INSTALL # installation description
|-- LICENSE # the GNU GPL
|-- MANIFEST # list of package files
|-- Makefile.in # Makefile template
|-- Todo # a list of tasks to do
|-- bin
| `-- sysvtools.pl # the tools program
|-- configure.pl # the configuration program
|-- install
|-- lib
| `-- JT
| `-- CLI
| |-- Pager.pm # the Pager module
| `-- SysVTools.pm # the SysVTools module
|-- locale
| |-- de
| | |-- LC_MESSAGES
| | | `-- SysVTools.mo # the german message catalogue
| | `-- SysVTools.po # the source of the german message catalogue
| `-- en
| |-- LC_MESSAGES
| | `-- SysVTools.mo # the english message catalogue
| `-- SysVTools.po # the source of the english message catalogue
`-- man
|-- man1
| `-- sysvtools.1.gz # the sysvtools manual page
`-- man3
|-- Pager.3pm.gz # the Pager module manual page
`-- SysVTools.3pm.gz # the SysVTools module manual page
To configure the package according to your requirements call the configure.pl perl script. You must execute it this way: perl ./configure.pl [options]. The program checks some system requirements, tries to evaluate nesseccary pathnames and creates the Makefile from the template Makefile.in. When you execute it without any options, it will try to get all information from your system. You can overwrite this with the following options:
- PREFIX=path
All package components will be installed in subdirectories of the defined directory. If the directory doesn't yet exist, it will be created. Read the comments about the conditions for accessing modules, programs and message catalogues carefully. - LIBPATH=path
The JT::CLI::SysVTools.pm and JT::CLI::Pager.pm are copied to the defined path. In the sysvtools.pl program this path will be included within the use lib pragma. You have to add this pragma in your own programs if the defined path is not a part of the list of directories, which are searched by the Perl loader. If you want to use perldoc, you can do it like this: PERLLIB=/home/jan/sysvtools/lib perldoc JT::CLI::SysVTools. - BINPATH=path
Installs the sysvtools.pl program in this path. The links for the tools are also created in this directory. If the path is not a part of the environment variable $PATH, you have to call the programs prefixed with this path. - MANPATH=path
Installs the manual pages in subdirectories of this path. If the path is not a part of the environment variable $MANPATH, you can see the manuals like this:
man -M <MANPATH> sysvtools for the program
man -M <MANPATH> JT::CLI::SysVTools for the module
man -M <MANPATH> JT::CLI::Pager for the pager - MOPATH=path
The message catalogues will be copied into subdirectories of this path. The path is included in configuration variables both in the program and module. If you want to use the catalogues in your own programs, you must insert this path in the bindtextdomain function. You can copy the lines from the sysvtools.pl program.
The configuration programm in detail performs the following steps:
- check the Perl installation
Evaluates the Perl program path; this path will be inserted in the "shebang" line of the sysvtools.pl program. Checks the Perl version and aborts for versions prior to 5.0. - check for necessary Perl modules
Additionally to the modules shipped with the Perl package there are two modules used: POSIX::strptime and Locale::gettext. The configuration script will abort when missing one of this modules. In this case you should go to CPAN and install these modules. After doing that you can continue. - check pathnames
The script checks if the installation pathnames for all package components (either from the system configuration or from the command line arguments) are existing directories. If a directory check fails, the program aborts with an error description. ab. - create the Makefile
Using the Makefile.in a Makefile is created. The defined installation pathnames are inserted in the Makefile.
When configuration is done successfully, you install the package simply by calling make [Target]. Without options all package components are installed. The following targets are available:
- all
The default target; all components are installed. - install_lib
This will only install the modules, their manual pages and message catalogues. Use this target if you want to use the modules in your programs, but don't need the Unix command line tools. - install_bin
This target will only install the programs and their manuals. This is intended to add the programs to your system after installing the modules. You can call it without installing the modules first - but don't do that! The result will be a bunch of dysfunctional programs on your hard disk ;-)
A complete installation will create the following files on your machine:
[PREFIX/bin] or [BINPATH]
|-- ckcont -> sysvtools.pl
|-- ckdate -> sysvtools.pl
|-- ckgid -> sysvtools.pl
|-- ckint -> sysvtools.pl
|-- ckitem -> sysvtools.pl
|-- ckkeywd -> sysvtools.pl
|-- ckpath -> sysvtools.pl
|-- ckrange -> sysvtools.pl
|-- ckstr -> sysvtools.pl
|-- cktime -> sysvtools.pl
|-- ckuid -> sysvtools.pl
|-- ckyorn -> sysvtools.pl
|-- errange -> sysvtools.pl
|-- errdate -> sysvtools.pl
|-- errgid -> sysvtools.pl
|-- errint -> sysvtools.pl
|-- erritem -> sysvtools.pl
|-- errpath -> sysvtools.pl
|-- errstr -> sysvtools.pl
|-- errtime -> sysvtools.pl
|-- erruid -> sysvtools.pl
|-- erryorn -> sysvtools.pl
|-- helpdate -> sysvtools.pl
|-- helpgid -> sysvtools.pl
|-- helpint -> sysvtools.pl
|-- helpitem -> sysvtools.pl
|-- helppath -> sysvtools.pl
|-- helprange -> sysvtools.pl
|-- helpstr -> sysvtools.pl
|-- helptime -> sysvtools.pl
|-- helpuid -> sysvtools.pl
|-- helpyorn -> sysvtools.pl
|-- sysvtools.pl
|-- valdate -> sysvtools.pl
|-- valgid -> sysvtools.pl
|-- valint -> sysvtools.pl
|-- valpath -> sysvtools.pl
|-- valrange -> sysvtools.pl
|-- valstr -> sysvtools.pl
|-- valtime -> sysvtools.pl
|-- valuid -> sysvtools.pl
`-- valyorn -> sysvtools.pl
[PREFIX/lib] or [LIBPATH]
`-- JT
`-- CLI
|-- Pager.pm
`-- SysVTools.pm
[PREFIX/locale] or [MOPATH]
|-- de
| `-- LC_MESSAGES
| `-- SysVTools.mo
`-- en
`-- LC_MESSAGES
`-- SysVTools.mo
[PREFIX/man] or [MANPATH]
|-- man1
| `-- sysvtools.1.gz
`-- man3
|-- JT::CLI::Pager.3pm.gz
`-- JT::CLI::SysVTools.3pm.gz



