# Software Application Management Overview

Computer applications are created by human for Computers. This human and computer interaction can be abstracted into following steps.
* Design the software for computers.
* Build the software on computers.
* Package the software for all kind of computers.
* Install/Remove the software from computers.
Last three activities can be divided into more detail steps as follows
* Software build process(SB):
** unpack source files
** patch source code
** configure source file for a particular OS
** compile source codes to generate binary and documentation
** test the compiled binary if need to
** install the binaries into installation path
** uninstall the binaries
* Package build (PB) process is much straight forward:
** prepare the scripts to take care of preinstall, postinstall, preremove and postremove required actions.
** prepare initialization script to start/stop application service
** call up local PMS to pack the binary,documentation and scripts into local PMS format.
* Package Management (PKGUTIL) Process:
** upload and administrate packages on package depot server.
** install
** remove
** upgrade/patch
** auto installation upon package dependence.

## Acronyms: CPAD, CPAM, PMS, HPMS and TWW

"The Written Words" is to describe the cross-platofrm application developement and management activities performed by System administrators. "The Written Words" is an attempt to write down tasks performed into XML language.
To provide a generic naming to describe activities, following acronyms are defined for easy reference. Also this will leave room for other packaging methods like openpkg or Portage in gentoo.
* CPAD: Cross-Plaform Application Development, a solution to enable software application developement easily for man-made,incompatible and variated operating systems. X windows, Java,OpenStep and GNUstep are examples of solutions.
* CPAM: Cross-Platform Application Management, a solution to enable easy and consistent application management. TWW's HPMS is one of the solutions.
* HPMS: Hbrid Package Management System. A wrapper solution that work with PMS to shield package developer from incompatible local PMS. It will allow package developer to consistently create and maintain software packages without knowing the details of each PMS when they don't need to.
* PMS: Package Management System. A software system designed to create,build,install,remove and upgrade software in a packed format. Examples: RPM,dpkg,inst,lpp,portage,Installsield,HP SD-UX.
* PMS format: PMS Package Format. A file or directory to include a group of compiled binaries ,documenation or script file. This file is usually in compressed form and called as software package. With this work being done, a software package can be better maintained. Example formats:rpm,msi,ipk,pkgadd,depot and GNUstep's .app.
* TWW: The Written Word of wisdom to guide you through the maze of getting an open source software built and packaged. Better yet, the words are digitalized into a xml file that can be play back and repeated by others.
* TWW Inc: A company specialize in open source building and packaging to make opensource easier to use across different OS platforms.

## What is Package Management System ?

* Every modern OS come with a PMS(Package Management System). Because we went through the pains of not having one during the age of DOS. Adding software binaries into an OS without systematic packaging is proven to be not manageable.
Following ASCI diagram depict some OS and their PMS relationship.

## What is Hybrid Package Management System ?

* Like hybrid car, it is hard to throw away old technology(burning gas in engine) and use new one(battery for electric motor) directly, Existing installed OS need a less intrusive, hybrid package management system to help us transit to new technology.
* To achieve best compatibility with existing deployed machines in an IT or Home computer environment, We need to create packages using native PMS as much as possible and use different installation path. Undo or removing existing application installation effort is usually cost prohibitive. The Written Word Inc. design and implement their HPMS for commercial open-source support. The tools can be used to package and administrate commercial packages that doesn't need to use native PMS directly. Examples are IBM/Rational's clearcase and Oracle database software. Using HPMS, we can install clearcase with "pkg-inst clearcase-6.0" or we can install a Oracle server using "pkg-inst oracle-8.1.7" without using their installers directly.
* Following is a ascii diagram to illustrate a HPMS can work on top(hyper) of existing native PMS to build , package and manage software applications.

## What is HPMS ?

* Following is ASCII diagram to illustrate the os,pms and hpms relationships when creating a native package.
* When creating a software binary from source codes.
** On Linux with RPM PMS, you will need to use rpmbuild command to parse through configure and build section of instruction in package.spec file.
** On Oracle Solaris, you usually type make command to parse Makefile that contain instruction about source code and compiler options to build the binary.
* When packaging a software for different OS.
* When removing a software for different OS.
* When installing a software for different OS.

### TWW HPMS introduction

* Package Management: The activities of creating, building, installing, removing, updating and querying the existing installation application on an OS.
* pkgutils in TWW HPMS system has following four main commands to implement package management activities.

# Getting started to use TWW package management tool
## Install TWW HPMS on a supported Operation System
### Current TWW supported OS

* Visit http://www.thewrittenword.com/evaluate/ to see the current supported OS. Following listing may be outdated.
* If your beloved OS is not listed, why not port it to make it CPAM compatible?

### Procedures to install TWW HPMS

* Go to http://www.thewrittenword.com/evaluate/
* On the right side of OS menu, click on the OS version you need
* Following the instruction on web page you clicked on.

## pkg-inst

pkg-inst install the packages. It will handle package dependency automatically. The automation is achieved by package dependency description in pkg-db.xml on application repository server. following example commands are the most usded ones.
* pkg-inst bash : This is a very simple syntax to install a package comparing to "pkg-get -i bash", "rpm -i bash".
* pkg-inst -N bash : -N is to do dry-run without install the actural package. a good way to see what is going to happened in advance.
* pkg-inst—tempdir=/tmp clearcase: /var is used by default to store downloaded package, we can specify other directory as temporary directory when /var/ is tool small to hold the package we want to install.

## pkg-rm

* pkg-rm bash : A simple syntax to remove package comparing to "pkg-get -d bash", "rpm -e bash".
* pkg-rm -N bash : -N is to do dry-run without install the actural package.
* pkg-rm clearcase: /var is used by default to store downloaded package, we can specify other directory as temporary directory when /var/ is tool small to hold the package we want to install.

## pkg-info

* "pkg-info bash"
* "pkg-info -N bash" : -N is to do dry-run with out install the actual package. a good way to see what is going to happened in advance.
* "pkg-info": find out what is available on applicaton repository server.