CPAM with TWW/Developer Guide
TWW HPMS introduction
editPackager 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
[root] ls -l /opt/TWWfsw/sbutils12/bin/ total 164 -rwxr-xr-x 1 root root 38551 Dec 1 15:17 gen-sb-db -rwxr-xr-x 1 root root 44418 Dec 1 15:17 sb [root]
- Package build
- pbutils
[root] ls -l /opt/TWWfsw/pbutils11/bin/ total 186 -rwxr-xr-x 1 root root 29975 Apr 30 2004 gen-pb-db -rwxr-xr-x 1 root root 29169 Apr 30 2004 gen-pkg-db -rwxr-xr-x 1 root root 34023 Apr 30 2004 pb [root]
- Package Management
- pkgutils
[root] ls -l /opt/TWWfsw/pkgutils15/bin/ total 542 -rwxr-xr-x 1 root root 32434 Jan 25 2004 chk-pkg-updates -rwxr-xr-x 1 root root 18751 Jan 25 2004 pkg-config -rwxr-xr-x 1 root root 48281 Jan 25 2004 pkg-info -rwxr-xr-x 1 root root 70570 Jan 25 2004 pkg-inst -rwxr-xr-x 1 root other 68887 May 18 2003 pkg-inst~ -rwxr-xr-x 1 root root 35692 Jan 25 2004 pkg-rm [root]
Create the hello-world TWW package
editIn 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
editAbove 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.
Hyper PMS Architecture
editHPMS TWW PMS RPM PKGADD WiX SD-UX --------- ----------- ----------- ---------- | Linux | | Solaris | | Windows | | HP-UX | OS | | | | | | | | -------- ---------- ----------- ----------
TWW tools architecture
editPackage Management Systems
edit- 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
edit- Sun WorkShop, Sun Studio, Sun Forte for sparc
- Compiler flags
cc -I. -I. -mr -Qn -xstrconst -xO2 -xtarget=generic -DHAVE_CONFIG_H -I./popt -c rsync.c -o rsync.o -mr : -Qn : -xstrconst : -xO2 : -xtarget :
- Sun Compiler for intel
-m : -
- Gnu Compier
- HP ANSI Compiler
Porting TWW HPMS to other OS
editThese 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
edit- 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
edit- Package Budild Architecture: Comparsion of using Mac OS X wayd and ported TWW pb for Mac OS X.
HPMS way MacOS X way -------------------------------------------- | SimpleFirst.pb = SimpleFirst | -------------------------------------------- | | | - TWW pb/Mac OS X ----------------------- | | pbuild | -------------------------------------------- | SimpleFirst.app | -------------------------------------------- | 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
edit- Package Build Architecture:
-------------------------------------------- | SimpleFirst.pb | |----------------------------------------- | | pb that support WiX | | -----------------------------------------| | candle.exe | |----------------------------------------- | | light.exe | |------------------------------------------| | MingW | |----------------------------------------- | | Win32 OS | --------------------------------------------
- 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
FreeBSD
edit- 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
edit- 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