# Package Management System Overview

This section is about the different PMS on different OS. By understanding each PMS we can find out the differences and try to make them work together under a central and hyper PMS. The main interests of following sections are to understand how to make these PMS work with TWW HPMS.

## Package Management System Compasion

| Packaging Tasks | rpm | pkgadd | sw depot | inst | OpenSolaris ips | lpp | Windows WiX | Mac OSX |
| build a package | rpmbuild -ba packagename.spec | pkgmk | | ? | ? | ? | candle.exe -> light.exe | packagemanager |
| Query installed packages | rpm -qa | pkginfo | ? | ? | ? | ? | ? | pkgutils—pkgs |
| delete a package | rpm -e pkgname | pkgrm | ? | ? | ? | ? | msiexec | Not Available. |

## MS Windows
### MS Windows PMS Architecture

* Windows installer

### MS Windows PMS References
#### Commercial Packaing tools

* Installshield

#### Open source Packaing tools

* NSIS
* MakeMSI Home
* WiX XML Toolset

## BSD
### Mac OS X

Mac OSX software distribution, it is not software package management that provide complete package life-cycle mechanism. Some mechanis still missing are
* package removal by command line.
* package automated dependency install.
* package depot.

#### Mac OSX related PMS Tools

* installer(8)
* repair_packages(8)
* packagemaker(1)
* pkgutil : is a command line tool to do package query actions.

##### Mac OS X PMS References
###### Macport

A few notes when learning macort. Macport use TCL scripting language to automate the package creating,installation and other package management processes.
* Following are some directories path for Macport build system.
* MacPort is also a Hyper Package Management System. For example, macport can generate zsh in RPM and Mac's pkg formats.
* Macport developers
* install your Darwinport PMS
* try to build gcc-4.0
* the building receipt(Portfile) for gcc40.

###### == TWW HPM on Mac OS X ==

This is not a TWW supported effort.

## Linux
### RedHat Linux
#### RPM PMS Architecture

* The logical layout of an rpm package. An rpm package contains header and payload.
* How to see a package's metadata ?
* How to check what kind of file digest is used in a package payload ?

#### RedHat KickStart overview
### SUSE/Novell
#### Suse PMS References
## Debian/Hurd
### Debian PMS References
## OpenSolaris
### Creating Your IPS depot

* opensolaris host info
Example
* become root on opensolaris
* mkdir /pub
* Run following scripts
* Check the files created under /pub
* Check if you can browse http://depotserver:80
* Add your depot as preferred depot and check preferred authority switch from opensolaris.org to localhost one.

### Create your first IPS package
## SGI IRIX
#### IRIX PMS Architecture
#### IRIX PMS References

* inst

# Cross-Platform Package Management System Overview
## homogeneous approach
### Home-grown

Using Makfile we can acturally create a CPAM system easily. Following is an example

### TWW
## non-homogeneous approach
### OpenSolaris IPS
# Package building automation
# Distributed package building
## General Tools for distributed build
### Distcc

Because distcc can only work with gcc, so it only can compile TWW's package source that utilize gcc compiler. This means we can use distcc to build pacakges for Redhat Linux.

#### How to use distcc to compile TWW's RH packages source

* We will use distcc and newly released lsdistcc to compare the performance gain of compiling RH EL kernel and crosstool on using rhel3-distcc* machines are available in a subnet.
* lsdistcc is a distcc server autodiscovery program. It relies on distcc servers being in DNS with distinctive names ending in numbers 1 through N. It is originally from http://kegel.com/distcc and will probably be included in a future release of distcc. With this helpful small lsditcc program we can dynamically assign the content of DISTCC_HOSTS to use as many available distcc hosts as possible.
* For each OS platform you want to configure as a distcc execution node, do
* add distcc nodes into your name server;increase the serial number;"ndc reload". After following aliases are edited in your forward zone file
* also make sure you have a good naming for your distcc execution hosts. ${OS}-distcc%d is the good naming scheme.
* "cc -o lsdistcc lsdistcc.c", and run a test to find out the current available RHEL3 have distcc enabled.
* put "DISTCC-HOSTS := `lsdistcc rhel3-distcc%d`"in your makefile or build script.

#### Compiling RHEL3 kernel soucce

* compiling linux-2.4 without help of distcc
* Following is a sample snapshot of "distccmon-text" output.
* compile the 2.4 kernel source on rhel3-distc6 (8CPU) machines locally.

### Electric Cloud: emake
## Vendor specific distributed build
### Sun Studio: dmake
# FAQ
# How TO
## How to automate this wiki book publishing by automated script ?

We need a perl module call "mvs", it is mediawiki client written in perl language.
* MVS
* Perl mvs support maillist at http://geekhive.net/cgi-bin/mailman/listinfo/www-mediawiki-client-l
* Install mvs from cpan
* A quick check of mvs command.
* Create a makefile to automate the login,download and upload steps.

## If you are behind corporate firewall

* set HTTP_PROXY variable to http://fw.my.com:port if no firewall account is needed.
* set HTTP_PROXY variable to http://MYaccount:MYpassword@fw.my.com:port if firewall account/password is needed.