Administer > Content utilities > IDK build environment > Specifying the application files of an ISM

Specifying the application files of an ISM

This section discusses the methods for getting application files into an ISM:

Placing archives in the bar subdirectory

Before running --build, you may manually copy file archives to the ISM’s bar (binary archive) subdirectory. Alternatively, the archives in the bar subdirectory may be generated as cpio files by the directives in the %files section of the specfile. See Compiling source (Unix only).

The --build command repackages the archives in the bar sub directory into the application package of the pkg subdirectory. The following table lists the types of archives that may reside in the bar subdirectory.

Valid binary archive types

File Extension

Archive Type

.cpio

Unix CPIO Archive

.msi

Microsoft Installer

.rpm

RPM Package Manager

.tar

Tape Archive

.tar.bz2

bzip2 compressed Tape Archive

.tar.gz

gzip compressed Tape Archive

.zip

Info-Zip compatible Zip

Specifying passthru packages

Unlike an archive in the bar subdirectory, a passthru package is not extracted and re-packaged. The --addPassthruPkg command copies a passthru package unchanged into the pkg subdirectory. The package specified by --addPassthruPkg cannot reside in the ISM directory. The following example adds a passthru package to an ISM and designates the package for addition to the software policy:

ismtool --addPassthruPkg /tmp/bos.rte.libs.5.1.0.50.U --pkgType lpp ISMNAME
ismtool --attachPkg bos.rte.libs-5.1.0.50 --attachValue true ISMNAME

Compiling source (Unix only)

The --build command recursively searches the src subdirectory for specfiles (files ending in .spec)). If found, a specfile is compiled into Bourne Shell and executed. Specfiles are written in a simplified derivative of the RPM specfile language. The ISMTool's specfile-like language compiler allows you to use existing RPM specfiles with minimal modifications.

For more information about the specfile language, see the Maximum RPM document, located at the following URL:

http://www.rpm.org/max-rpm/index.html

Example specfile

Here is an example of a simple ISM specfile for NTP 4.1.2:

###############################################
# Common Preamble
###############################################

%define ismname %(../ism/bin/ismget name)
%define version %(../ism/bin/ismget version)
%define prefix %(../ism/bin/ismget prefix)


Name: %{ismname}
Version: %{version}###############################################
# prep, build, install, files
###############################################

Source: http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.1.2.tar.gz

%prep


%setup -n ntp-4.1.2

%build

%ifos Solaris2.7
echo ‘‘do something Solaris2.7 specific’’

%endif

%ifos Linux
echo ‘‘do something Linux specific’’
%endif

./configure --prefix=%prefix
make

%install
/bin/rm -rf $ISM_BUILD_ROOT
make install prefix=$ISM_BUILD_ROOT/%{prefix}

%files
%defattr(-,root,root)
%prefix

Specfile preamble

The preamble specifies information to be fetched from the ISM with the program ismget. The following lines fetch the name, version, and prefix of the ISM.

%define ismname %(../ism/bin/ismget name)
%define version %(../ism/bin/ismget version)
%define prefix %(../ism/bin/ismget prefix)

This fetched information can be useful in the set up and compilation of sources. However, the %define commands are optional. The only required tags in the preamble are Name and Version.

%prep

The %prep section is designed to prepare sources for compilation. This involves uncompressing and untaring source distributions. A single source file is identified with the Source tag. A list of sources are identified by a vector of tags: Source0, Source1, . . . . Similarly, patches are identified by either a Patch tag or a vector of tags: Patch0, Patch1, . . . . The ISMTool duplicates the macro functionality as documented in Maximum RPM. The %setup macro controls how sources are unpacked. The %prep section can also manage patching using the %patch macro.

%build

The shell script commands in the %build section will transform the sources into binaries. Compiling from source usually involves running ./configure -prefix=%{prefix} and make. It is possible to perform configuration switching based on the platform (operating system). The platform tags are designed for backward compatibility to RPMs found in real-world installations. The following platform strings are some examples that can be used in ISMTool specfiles for platform branching:

Linux
RedHat
RedHat-Linux-7.2
RedHat-Linux-AS2.1
Solaris
Solaris2.8
Solaris-2.8
SunOS
SunOS5.7
SunOS-5.7
hpux
hpux11.00
hpux-11.00
HPUX
HPUX11.00
HPUX-11.00
aix
aix4.3
aix-4.3
AIX
AIX4.3
AIX-4.3

%install

The %install section specifies the copying of files from the build to a virtual install location. For example, if the %prefix is set to /usr/local, the following line would install NTP into /usr/local/bin:

make install prefix=$ISM_BUILD_ROOT/%{prefix}

The variable $ISM_BUILD_ROOT (or equivalently $RPM_BUILD_ROOT) is the location of a temporary directory inside the ISM's tmp directory. This temporary directory will serve as the virtual install root where the directives in the %files section will be applied.

The %install section also indicates where the files from a binary install could be extracted. In a binary install, the files resulting from a binary install on a development server can be packaged into the virtual install location. However, if that is not possible then a binary installer could be transported to the end system and installed with an ISM post-install hook. In this case, you would create a binary archive of the installer and copy it to the ISM's bar subdirectory.

%files

In the specfile, the output of the source transformation phase is a set of files indicated by the directives in the %files section. These files are archived into a cpio in the ISM’s bar subdirectory.

The final phase of the source transformation is to select the files installed into the $ISM_BUILD_ROOT. The directives in the %files section are a subset of the selection mechanisms documented in Maximum RPM. These directives specify a list of files or directories (which are recursively gathered) relative to $ISM_BUILD_ROOT. In this example, the install is into the path $ISM_BUILD_ROOT/%{prefix}. To select these files for packaging, you would simply give the %prefix as the directory to package.

In addition to selecting files by naming files or directories, meta information can be described. The line %defattr(-,root,root) tells the archive engine to use the modes it finds in the file system, but to create the archive replacing the file ownerships it finds in the file system with root,root. For full documentation of %defattr() and %attr(), see Maximum RPM.