# CPAM with TWW/Developer Guide
## TWW HPMS introduction

Packager using this HPMS tool can capture all their package-specific knowledge in a programmatic, reusable way by digitializing the knowledge in XML file.
TWW Inc. has three tools to automate the package management processes, i.e. software building,packaging and package installation and removal.
* Softeware build
** sbutils
* Package build
** pbutils
* Package Management
** pkgutils

## Create the hello-world TWW package

In this tutorial, we will use tranditional hello world example to illustrate the digition of software package creation process. Said, you read the news update from stepwise about TN2137 on configuring hello-world example from GNU to be a fatbinary executable which contains ppc and i386 binary code.
We can increase the digitation degree more on tn3127 document by automate the process into hello-2.1.1/sb-db.xml. Once the process is digitized we can repeat the accurate result of achieving goals in tn3127.

### Flow chart of a TWW package creation

Above diagram is the process of creating a TWW package and upload to application repository server.
* Install the TWW development tool.
* Create a package template from newtww.sh script.
* Build the software by "sb small-1.0.sb" which will go through the following steps.
** sb -u hello-2.1.1.sb : unpack compressed source.
** sb -C hello-2.1.1.sb : configure the source tree to have fat binary.
** sb -B hello-2.1.1.sb : call up make command to build the source.
** sb -i hello-2.1.1.sb : install the binaries to installation directory.
** sb -t hello-2.1.1.sb : test the installed binaries on installed directory
* pb -1 hello-2.1.1.pb will package the binaries in installation directory into native PMS format.
* We then turn the native PMS (Solaris pkgadd in this case) a zip file.
* Generate a MD5 sum file so have a way to make sure the integrity of the file.
* Upload the small-1.0.pkgadd.pkg-inst, small-1.0.pkgadd.pkg-inst.md5sum to package repository server.
* Add an entry in pkg-db.xml in package repository server.
* Package is now ready for retrieval by simple "pkg-inst hello" command from Solaris machine.

## Package Management Systems

* Brief introduction of a few PMS and its package format
** RPM
** Solaris pkgadd
** HP-UX SD-UX
** GNUstep pkg
** MacOS X pkg
** Debian dpkg
** ipkg for Embeded Linux system.
* Comparison of PMS
* Comparison of HPMS

## Vendor Compilers

* Sun WorkShop, Sun Studio, Sun Forte for sparc
** Compiler flags
* Sun Compiler for intel
* Gnu Compier
* HP ANSI Compiler

## Porting TWW HPMS to other OS

These are tasks need to be done when porting TWW HPMS tools to other OS.
* Porting the TWW HPMS tool itself.
** sb need to add in new OS indentication code.
** pb need to have a new python module to deal with the new PMS.
* Porting the package sources.
** The packages source contain instruction for a particular OS. We need to add the new supported OS to the package source.
* The makefile to automate the TWW tools porting.
** Same as Makefile, each makefile contain instruction for a perticular OS, if a new OS is added then the Makefile need to be updated as well.

### Linksys NSLU2

* A Makefile to build TWW sbutils tools for nslu2 from sbutils python/C source codes.
* compile sbtuils tool to generate sb
* use sb to compile and build pb and pkgutils
* Porting sbtools

### Mac OS X

* Package Budild Architecture: Comparsion of using Mac OS X wayd and ported TWW pb for Mac OS X.
* A Makefile to build TWW tools for MacOS X.
* compile sbtuils tool to generate sb
* use sb to compile and build pb and pkgutils
* Porting sbtools

### Win 32

* Package Build Architecture:
* Procedure
* A Makefile to build TWW tools for Win32 .
* compile sbtuils tool to generate sb
* use sb to compile and build pb and pkgutils
* Porting sbtools
* Gábor DEÁK JAHN maintains a WiX tutorial.
* WiX 2.x and 3.x Download

### FreeBSD

* A Makefile to build TWW tools for FreeBSD.
* compile sbtuils tool to generate sb
* use sb to compile and build pb and pkgutils
* Porting sbtools

### Debian/HURD

* A Makefile to build TWW tools for Debian.
* compile sbtuils tool to generate sb
* use sb to compile and build pb and pkgutils
* Porting sbtools