Actually, this is exactly what the 'pkgutils' tools do in Slackware......
The package maker is called 'makepkg' which tarballs and compresses an entre pkg tree into a '.tgz' package (but you can modify it to use any extension, I suppose)....
Next is 'installpkg' which, as it's name implies, installs the pkg created with 'makepkg', and creates a log of the metadata and list of files installed into /var/log/packages, and also adds the postinstall script (called 'doinst.sh') if one if found into /var/log/scripts.......
Then there's 'removepkg' which removes the installed pkg by reading the log file for the file list, then removes the package log (and script log if one is present).......
Then you have 'upgradepkg', which will upgrade an existing package.....
Finally, there's 'pkgtool', which is a curses-based wrapper for the others one can use to find all about the installed packages, install new packages, upgrade existing ones......
These are all shell scripts used by Slackware......
Also, Crux has a script for making packages in it's 'pkgtools' package, called 'pkgmk'.......Though, I think the install util is a C program......I can't remember as it's been a while since I used Crux.......
---thegeekster
PS: I'm also working on a shell script package manager for an LFS setup I'm creating........
