pack

Package: WA2L/edrc 1.5.57
Section: Maintenance Commands (1m)
Updated: 14 May 2010
Index Return to Main Contents

 

NAME

pack - pack an application to a software package

 

SYNOPSIS

edrc/bin/pack [ -h ]

pack [ -a app ] [ -f ] [ -s ] [ -d outdir ] [ -o package_format ] [ -c config_file ] [ -t ]

pack [ -a app ] [ -f ] [ -s ] [ -d outdir ] [ -o package_format ] [ -c config_file ] -p version

pack -L [ -a app ] [ -c config_file ] [ -p version ]

pack -l [ -c config_file ]

 

AVAILABILITY

WA2L/edrc

 

DESCRIPTION

Create a software package of an installed application.

A software package should not contain logfiles, backup files, lock files etc. To support this, it can be defined in the configfile of pack which files should be excluded from the software package.

pack enables the user to pack an application that has been installed (and probably configured) back to an installable package without the need of manually copy and remove certain files. Furthermore the user does not need to know all fine details of the application e.g. which files are needed for a correct operation, which files can be deleted, which files would harm a correct operation on an other system if packed.

It is possible to create a full RELEASE or a PATCH of the current state to a certain version.

A RELEASE is created if the -p version option is not specified and contains all files of the application.

A PATCH is created if the -p version option is specified and contains all files that are newer then the point in time when the RELEASE has been created for a specific version of the application.
In this context it is important to realize that if files are added to an application which are older then the timestamp of the last RELEASE, those files are not added to the PATCH. This is often the case if .tar.gz files are downloaded and the untared files are added to the application due to the fact that the file timestamps are preserved. To ensure that those files are added to the PATCH a touch filename should be issued for all files added to the application. It might also be advisable to check the filepermissions and the ownership of the files.

 

OPTIONS

Despite of the many options available, it is often not needed to provide any option to pack due to the fact that a developer should define in the default application setting the common case for the application package creation. Issue pack -l to list all available definitions.

-h
usage message.

-a application
application handle. If this option is not specified default is used as the application handle.

-s
split package also in pieces of 1400000 bytes which fit to a diskette. This option can also be used to mail the package when mail size restrictions apply on sender or receiver side.

If this option is selected beside the pieces a setup script is provided to concatenate the pieces together in the correct order and to check if all pieces are available. Furthermore some instructions to the user are printed.

-f
force overwriting of output file if a file with the identical name already exists in the output directory.

-p version
patch application to the specified version. The timestamp for the version specified has to exist. A timestamp is always written if a RELEASE is generated and the -t option is specified. To install a patch, use the patchinstall(3) command.

-l
list all applications defined in the configuration file. The available timestamps to create patches are listed, too.

-L
list files to be packed into the software package without actually creating the package file. This option is useful to verify if your settings of EXCLUDE_LIST in the configuration file are correct.

-d output_dir
directory where to put the package file. If not specified this defaults to the setting made in OUTPUT_DIRECTORY of the related application specified with the -a application option.

-o package_format
format of the software package to be created. If not specified the software package format defaults to shar.

shar
generic installable shell archive. A shell archive is a file that contains the setup procedure and the software data. This can be compared with a setup.exe program often used on the Microsoft Windows (TM) operating system. See section EXAMPLES or issue pack -h for an example usage of a shell archive.

depot
HP-UX software depot. This format is used on Hewlett Packard HP-UX systems. The installation of a depot package is done with the swinstall command on HP-UX.
The generation of this package format is currently not implemented.

pkg
Solaris package. This format is used on Sun Solaris systems. The installation of a pkg package is done with the pkgadd command on Solaris.
The generation of this package format is currently not implemented.

rpm
RedHat package format. This format is mainly used on Linux systems. The installation of a rpm package is done with the rpm comand.
The generation of this package format is currently not implemented.

-c config_file
configuration file for pack. If this option is not specified, the configuration file edrc/etc/pack.cfg is used.

-t
the timestamp is updated when a RELEASE is generated (= if pack is called without the -p version option). It makes sense to use this option to produce productive RELEASES. In development cases this options won't be used.

 

ENVIRONMENT

$EDRC_DEBUG_PACK_EXCLUDE
when set to True all regular expressions defined in the EXCLUDE_LIST of the pack configuration file and the matched files by the related regular expression are recorded to the /tmp/pack.<DATETIME>.exclude file.

This allows to identify which regular expression of the configuration file excludes what files.

 

EXIT STATUS

0
no error.

1
no application defined in configuration file.

2
operating system not supported. See osid(3) if you get this error.

3
application is not defined in configuration file.

4
usage displayed.

5
command aborted.

6
configuration file does not exist.

7
package format is not supported yet.

8
cannot write to logfile.

9
cannot write to output directory.

10
application cannot be patched against version specified. This is the case if no RELEASE of the specified application exists for the version specified.

11
a temporary directory could not be claimed or created in /tmp. Check the system temporary directory /tmp if you get this error, it is an indicator of system intrusion.

12
a temporary output directory could not be claimed or created in the output directory.

99
creation of package format is not implemented yet.

 

FILES

edrc/etc/pack.cfg
default configuration file of pack.

edrc/var/pack/ts/<APPLICATION>-<VERSION>
timestamp of an APPLICATION for the related VERSION. Be aware that the timestamp is saved in GMT regardless of the local time zone setting.

edrc/var/pack/sadm/<APPLICATION>-<VERSION>-<DATETIME>.gz
software admin file for a RELEASE of an APPLICATION for the related VERSION. This file contains all information about the creation of a software package created on the DATE at the TIME.

edrc/var/pack/sadm/<APPLICATION>-<VERSION>-<DATETIME>-PATCH-<PATCHVERSION>.gz
software admin file for a PATCH of an APPLICATION for the related VERSION to a PATCHVERSION. This file contains all information about the creation of a software package created on the DATE at the TIME.

edrc/lib/<PACKAGE_COMPONENTS>/
package components used to generate a certain package format.

edrc/lib/<PACKAGE_COMPONENTS>/shar.header
header file for the shell archive software package. This header is displayed when installing the produced shell archive.

edrc/lib/<PACKAGE_COMPONENTS>/shar.setup
root setup script for a shell archive.

edrc/lib/<PACKAGE_COMPONENTS>/shar.install.tar.gz
install script structure for a shell archive.

edrc/lib/<PACKAGE_COMPONENTS>/piece.setup
setup script to concatenate a splited archive.

edrc/lib/<PACKAGE_COMPONENTS>/rpm.specification
rpm specification template to generate a rpm archive.

 

EXAMPLES

0) create a package of the default application

In this example usage the application timestamp is not updated. This is useful if an installed application has to be packed to be installed on an other host.

[ /opt/edrc/bin ]
[ root@rh7mzv7t001 ][bash]: ./pack

pack - create application package, by Chr. Walther

create package of application in '/opt/edrc' ...
    application information ...
        APPLICATION .......... : default
        APPLICATION_PREFIX ... : edrc
        APPLICATION_NAME ..... : WA2L/edrc
        APPLICATION_RELEASE .. : 1.5.02 
        DESCRIPTION .......... : WA2L/edrc complete
    done.
    package information ...
        format ............... : shar
        type ................. : RELEASE
        file ................. : /tmp/edrc-1.5.02-200705172007.sh
    done.
    write sadm file ...(/opt/edrc/var/pack/sadm/edrc-1.5.02-200705172007.gz)... done.
    evaluate files to be packed ...(11699 files)... done.
    evaluate properties of files to be packed ... done.
    pack files to package file ...(28262.7 kBytes)... done.
done.

1) create a RELEASE of the default application

[ /opt/edrc/bin ]
[ root@rh7mzv7t001 ][bash]: ./pack -t \
                                         -d /dat/sw/apps/edrc-1.5.02

pack - create application package, by Chr. Walther

create package of application in '/opt/edrc' ...
    application information ...
        APPLICATION .......... : default
        APPLICATION_PREFIX ... : edrc
        APPLICATION_NAME ..... : WA2L/edrc
        APPLICATION_RELEASE .. : 1.5.02 
        DESCRIPTION .......... : WA2L/edrc complete
    done.
    package information ...
        format ............... : shar
        type ................. : RELEASE
        file ................. : /dat/sw/apps/edrc-1.5.02/edrc-1.5.02-200705172007.sh
    done.
    write timestamp ...(/opt/edrc/var/pack/ts/edrc-1.5.02)... done.
    write sadm file ...(/opt/edrc/var/pack/sadm/edrc-1.5.02-200705172007.gz)... done.
    evaluate files to be packed ...(11699 files)... done.
    evaluate properties of files to be packed ... done.
    pack files to package file ...(28262.7 kBytes)... done.
done.

2) create a PATCH of the current situation to version 1.5.01

[ /opt/edrc/bin ]
[ root@rh7mzv7t001 ][bash]: ./pack -p 1.5.01

pack - create application package, by Chr. Walther

create package of application in '/opt/edrc' ...
    application information ...
        APPLICATION .......... : default
        APPLICATION_PREFIX ... : edrc
        APPLICATION_NAME ..... : WA2L/edrc
        APPLICATION_RELEASE .. : 1.5.02 
        DESCRIPTION .......... : WA2L/edrc complete
    done.
    package information ...
        format ............... : shar
        type ................. : PATCH (to version 1.5.01)
        file ................. : /tmp/edrc-1.5.02-200705172015-PATCH-1.5.01.cpio.gz
    done.
    write sadm file ...(/opt/edrc/var/pack/sadm/edrc-1.5.02-200705172015-PATCH-1.5.01.gz)... done.
    evaluate files to be packed ...(3501 files)... done.
    evaluate properties of files to be packed ... done.
    pack files to package file ...(9038.8 kBytes)... done.
done.

3) list files that would be part of a PATCH of the default application to version 1.5.01

[ /opt/edrc/bin ]
[ root@rh7mzv7t001 ][bash]: ./pack -p 1.5.01 -L

pack - create application package, by Chr. Walther

list files to be packed of application in '/opt/edrc' ...
    application information ...
        APPLICATION .......... : default
        APPLICATION_PREFIX ... : edrc
        APPLICATION_NAME ..... : WA2L/edrc
        APPLICATION_RELEASE .. : 1.5.02 
        DESCRIPTION .......... : WA2L/edrc complete
    done.
    package information ...
        format ............... : shar
        type ................. : PATCH (to version 1.5.01)
        file ................. : NONE
    done.
    evaluate files to be packed ...(3500 files)... done.
    files in package
        edrc/
        edrc/bin/
        edrc/bin/apply2sw_inventory
        edrc/bin/asup
        edrc/bin/bunzip2
        :
        :
        edrc/var/sysconfig/tools/default/
        edrc/var/sysconfig/tools/HP-11/
        edrc/var/sysconfig/tools/HP-11i
        edrc/var/sysconfig/tools/Linux/
        edrc/var/sysconfig/tools/Solaris/
    done.
done.

4) create a RELEASE of the default application and split also the outputfile

Here in addition to the complete shell archive edrc-1.5.02-200705172019.sh the splited files edrc-1.5.02-200705172019.sh.piece_aa ... edrc-1.5.02-200705172019.sh.piece_au and the setup script edrc-1.5.02-200705172019.sh.piece.sh is generated.

[ /opt/edrc/bin ]
[ root@rh7mzv7t001 ][bash]: ./pack -t -s \
                                         -d /dat/sw/apps/edrc-1.5.02

pack - create application package, by Chr. Walther

create package of application in '/opt/edrc' ...
    application information ...
        APPLICATION .......... : default
        APPLICATION_PREFIX ... : edrc
        APPLICATION_NAME ..... : WA2L/edrc
        APPLICATION_RELEASE .. : 1.5.02 
        DESCRIPTION .......... : WA2L/edrc complete
    done.
    package information ...
        format ............... : shar
        type ................. : RELEASE
        file ................. : /dat/sw/apps/edrc-1.5.02/edrc-1.5.02-200705172019.sh
    done.
    write timestamp ...(/opt/edrc/var/pack/ts/edrc-1.5.02)... done.
    write sadm file ...(/opt/edrc/var/pack/sadm/edrc-1.5.02-200705172019.gz)... done.
    evaluate files to be packed ...(11699 files)... done.
    pack files to package file ...(28262.7 kBytes)... done.
    split 'shar' package into '1400000' pieces ...
        edrc-1.5.02-200705172019.sh.piece_aa
        edrc-1.5.02-200705172019.sh.piece_ab
        edrc-1.5.02-200705172019.sh.piece_ac
        edrc-1.5.02-200705172019.sh.piece_ad
        :
        :
        edrc-1.5.02-200705172019.sh.piece_ar
        edrc-1.5.02-200705172019.sh.piece_as
        edrc-1.5.02-200705172019.sh.piece_at
        edrc-1.5.02-200705172019.sh.piece_au
        edrc-1.5.02-200705172019.sh.piece.sh
    done.
done.

5) list all defined applications

See also pack.cfg(4) for the description of how to define applications.

[ /opt/edrc/bin ]
[ root@rh7mzv7t001 ][bash]: ./pack -l

pack - create application package, by Chr. Walther

APPLICATION      PREFIX     TS_PREFIX  DESCRIPTION                                             >>
---------------  ---------  ---------  ------------------------------------------------------- >> 
default          edrc_WA2L  edrc       WA2L/edrc complete                                      >>
edrc             edrc_WA2L  edrc       WA2L/edrc complete                                      >>
edrc_CORE        edrc_WA2L  edrc       WA2L/edrc core files (without customer recovery scripts >>
edrc_NOSCRIPTS   edrc_WA2L  edrc       WA2L/edrc without customer recovery script files        >>
edrc_NOSECURITY  edrc_WA2L  edrc       WA2L/edrc without security files                        >>
edrc_UPDATE      edrc_WA2L  edrc       WA2L/edrc without recovery script files, config files,  >> 
(6)

TS_PREFIX  RELEASE  TIMESTAMP_DATE  
---------  -------  ----------------
edrc       1.4.06   0818125404      
edrc       1.4.07   1120173804      
edrc       1.4.08   2005-06-27 09:36
edrc       1.5.00   2005-07-14 14:20
edrc       1.5.01   2007-02-27 16:16
edrc       1.5.02   2007-12-14 13:00
edrc       1.5.03   2007-12-18 12:42
edrc       1.5.04   2008-04-09 17:13
edrc       1.5.05   2008-04-30 13:13
edrc       1.5.06   2008-05-09 08:06
edrc       1.5.07   2008-05-23 23:40
(11)

6) create a package containing the core files only

[ /opt/edrc/bin ]
[ root@rh7mzv7t001 ][bash]: ./pack -t -a edrc_CORE

pack - create application package, by Chr. Walther

create package of application in '/opt/edrc' ...
    application information ...
        APPLICATION .......... : edrc_CORE
        APPLICATION_PREFIX ... : edrc
        APPLICATION_NAME ..... : WA2L/edrc
        APPLICATION_RELEASE .. : 1.5.02 
        DESCRIPTION .......... : WA2L/edrc core files (without customer scripts, security files, notes)
    done.
    package information ...
        format ............... : shar
        type ................. : RELEASE
        file ................. : /tmp/edrc-1.5.02-200705172024.sh
    done.
    write timestamp ...(/opt/edrc/var/pack/ts/edrc-1.5.02)... done.
    write sadm file ...(/opt/edrc/var/pack/sadm/edrc-1.5.02-200705172024.gz)... done.
    evaluate files to be packed ...(4201 files)... done.
    pack files to package file ...(15222.7 kBytes)... done.
done.

 

SEE ALSO

edrcintro(1), edrcsetup(1m), pack.cfg(4), patchinstall(1m), stat(3)

 

NOTES

pack is used to create the shell archive of WA2L/edrc .

 

BUGS

-

 

AUTHOR

pack was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net .

 

COPYRIGHT

Copyright © 2009 Christian Walther

This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 11:13:24 GMT, April 12, 2025