Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

'Packaging' a script in lpp format 1

Status
Not open for further replies.

ranjit

Technical User
Apr 14, 2000
131
GB
Is it possible to package a user script in LPP format: thereby making it available on a # lslpp -l listing? Is there a utility available to allow for this?
 
An easier way is with AIX 5.2 mkinstallp (it basically is a script that does the previous post)
Available on the base installation media bos.adt.insttools
LCD # 4-1133-02 or higher
 
Is there a freeware product which allows for the creation of user defined lpp packages on AIX 5.1?
 
This is the best tool included with AIX 5.2 installation CDs:

# lslpp -f bos.adt.insttools
Fileset File
----------------------------------------------------------------------------
Path: /usr/lib/objrepos
bos.adt.insttools 5.2.0.0
/usr/lpp/bos/README.MKINSTALLP
/usr/sbin/mkinstallp
/usr/sbin/makebff.pl



# cat /usr/lpp/bos/README.MKINSTALLP
mkinstallp README

Description

The mkinstallp command is a tool that allows users to create their own
software packages for AIX. Packages created with mkinstallp are in installp
format and can be installed or removed with the installp command.

Files to be packaged by mkinstallp must be in a directory structure such
that the location of the file relative to the root build directory is the
same as the destination of the file after installation. For example, if
/usr/bin/<somecommand> is to be installed via a mkinstallp package,
<somecommand> must be in the <buildroot>/usr/bin directory when mkinstallp
is invoked.

Once the contents of a package are in the correct directory structure,
mkinstallp prompts for basic package data via the command line interface.
This data includes the package name, requisites, descriptions of files to
be packaged, etc. mkinstallp will then generate a template file based on
responses given by the user. Template files can be created and/or edited
directly by the user and passed to the mkinstallp command with the -T flag
to prevent command line prompting.

Command Syntax

mkinstallp [ -d BaseDirectory ] [ -T TemplateFile ]

Flags

-d BaseDirectory Specifies the root build directory containing the files
to be packaged. If omitted, the current working directory is used.

-T TemplateFile Specifies the full path name of the template file to be
passed to mkinstallp. If omitted, mkinstallp will prompt for package
information and create a new template file based on user responses.

Examples

The following examples show the directory structure and template file for a
variety of packaging scenarios. The root build directory for the following
examples is /tmp/packages. A list of template keywords is defined after
example 4.

Ex 1: PkgA - single fileset with no requisites
Ex 2: PkgB - single fileset with one prerequisite
Ex 3: PkgC - single fileset with License information
Ex 4: PkgD - multiple filesets


Ex 1: PkgA - single fileset with no requisites
----------------------------------------------
Directory Structure:

/tmp/packages
/tmp/packages/etc/afile
/tmp/packages/usr/PkgA/bin/acommand


Template File:

Package Name: PkgA
Package VRMF: 1.0.0.0
Update: N
Fileset
Fileset Name: PkgA.rte
Fileset VRMF: 1.2.3.4
Fileset Description: My runtime fileset
Bosboot required: N
License agreement acceptance required: N
Name of license agreement:
Include license files in this package: N
License file path:
Requisites:
Files
/etc/afile
/usr/PkgA
/usr/PkgA/bin
/usr/PkgA/bin/acommand
EOFiles
EOFileset


Ex 2: PkgB - single fileset with one prerequisite
-------------------------------------------------
Directory Structure:

/tmp/packages
/tmp/packages/etc/bfile
/tmp/packages/usr/PkgB/bin/bcommand


Template File:

Package Name: PkgB
Package VRMF: 1.0.0.1
Update: N
Fileset
Fileset Name: PkgB.rte
Fileset VRMF: 1.2.3.4
Fileset Description: My runtime fileset
Bosboot required: N
License agreement acceptance required: N
Name of license agreement:
Include license files in this package: N
License file path:
Requisites: *prereq PkgA 1.2.3.4;
Files
/etc/bfile
/usr/PkgB
/usr/PkgB/bin
/usr/PkgB/bin/bcommand
EOFiles
EOFileset


Ex 3: PkgC - single fileset with License agreement
----------------------------------------------------
Directory Structure:

/tmp/packages
/tmp/packages/etc/cfile
/tmp/packages/usr/PkgC/bin/ccommand


Template File:

Package Name: PkgC
Package VRMF: 1.0.1.0
Update: N
Fileset
Fileset Name: PkgC.rte
Fileset VRMF: 1.2.3.4
Fileset Description: My runtime fileset
Bosboot required: N
License agreement acceptance required: Y
Name of license agreement: LAR/usr/swlag/%L/LUM.la
Include license files in this package: N
License file path:
Requisites:
Files
/etc/cfile
/usr/PkgC
/usr/PkgC/bin
/usr/PkgC/bin/ccommand
EOFiles
EOFileset


Ex 4: PkgD - multiple filesets
------------------------------
Directory Structure:

/tmp/packages
/tmp/packages/etc/afile
/tmp/packages/etc/bfile
/tmp/packages/usr/PkgD/bin/acommand
/tmp/packages/usr/PkgD/bin/bcommand


Template File:

Package Name: PkgD
Package VRMF: 1.1.0.1
Update: N
Fileset
Fileset Name: PkgD.rte
Fileset VRMF: 1.2.3.4
Fileset Description: My runtime fileset
Bosboot required: N
License agreement acceptance required: N
Name of license agreement:
Include license files in this package: N
License file path:
Requisites:
Files
/etc/afile
/usr/PkgD
/usr/PkgD/bin
/usr/PkgD/bin/acommand
EOFiles
EOFileset
Fileset
Fileset Name: PkgD.data
Fileset VRMF: 1.2.3.4
Fileset Description: My data fileset
Bosboot required: N
License agreement acceptance required: N
Name of license agreement:
Include license files in this package: N
License file path:
Requisites:
Files
/etc/bfile
/usr/PkgD
/usr/PkgD/bin
/usr/PkgD/bin/bcommand
EOFiles
EOFileset


Template File Keywords

Keywords with a * are required, and will cause mkinstallp to fail if left blank or
omitted in the template file.

Package Name *- Name of the package
Package VRMF *- Version, Release, Modification, and Fix level of the package
Update *- Is this an update package?
Fileset *- Start of a new Fileset
Fileset Name *- Name of the fileset
Fileset VRMF *- VRMF of the fileset
Fileset Description - Description of the fileset
Bosboot required *- Is a bosboot required when installing this fileset?
License agreement acceptance required - Is license agreement acceptance required
for this filesest?
Name of license agreement - Name of the license agreement (see Note 1)
Include license files in this package - Are the license files included in this
package?
License file path - Path of the license file(s) (see Note 2)
Requisites - co/if/inst/pre-requistes for the fileset (see Note 3)
Files *- Start of the files section
/path/to/file *- File path (see Note 4)
EOFiles *- End of the files section
EOFileset *- End of the Fileset

Note 1: The Name of license agreement is defined as LAR/path/to/license/agreement.
The %L tag can be used in place of a hard coded path to represent the locale
of the machine that the package will be installed on. For example, if PkgB
is installed in the en_US locale, %L will be converted to en_US.

Note 2: The License file path is defined as LAF/path/to/license/file. Multiple
license files are separated by semicolons.

Note 3: Requisites are defined as *Type Name VRMF;. Type may be coreq, ifreq, instreq,
or prereq. Multiple requisites are separated by semicolons.

Note 4: The full path name for each file in the fileset must be listed in the Files
section. Any custom directories should also be listed in this section. For
example, to package /usr/xyz/foo, list both /usr/xyz and /usr/xyz/foo in the
Files section. Each entity in the final package will have the same attributes
(owner/group/permissions) that it had at build time. The user must ensure
that file attributes in the buildroot are correct prior to running mkinstallp.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top