Making packages

Michael S. Fischer Michael S. Fischer" <michael@dynamine.net
Fri, 28 Dec 2001 13:20:30 -0800


On Fri, Dec 28, 2001 at 01:02:30PM -0800, Ben Pfaff wrote:

> michael@dynamine.net (Michael S. Fischer) writes:
> 
> > I'm now working for a hardware startup in Fremont in "stealth mode",
> > whose software is placed atop a Red Hat distribution, after being
> > packaged in a custom format (which handles dependencies and multi-node
> > installations).
> 
> I don't even know what a "multi-node installation" is.

Oh, it's an extension to the package manager that passes packages to all
of the nodes in a cluster and tells the package managers on all the
nodes to install the packages as well.

> > Presently our custom software packaging system is similar to .deb's
> > (metadata, files, pre/post-install scripts) but the packages are built
> > by simply collecting a bunch of files that have been generated in various
> > places throughout the source tree.  The traditional method of building
> > Debian packages doesn't seem to fit the same paradigm.
> 
> Not sure exactly what you mean.  Can't you collect these files
> into proper subdirectories?  .deb's are basically tarballs in an
> ar archive with a fancy header.  There's no magic in building
> them.  All the magic is in dpkg, not in the building process.

I have read the New Maintainer's guide, but it's focused around dh_make,
which won't work here.

> A more elaborate description of what you're trying to do would be
> helpful.

OK, here's an example of our current package manager's config file:

[cli]
version     0.83.2
postinstall scripts/cli_post
file        etc/temp-tclshrc /root/.tclshrc
file        etc/temp-cli.sh /etc/profile.d/temp-cli.sh
file        etc/temp-cli-pwfile /root/temp-cli-pwfile
# commands start here
file        batteryage
file        batterylogreset
file        batteryskiprecharge

In this example, the package is called cli, the version is 0.83.2,
there's a post-installation script which is collected from
`pwd`/scripts/cli_post, and the rest of the files are collected from
`pwd` and `pwd`/etc and either placed in a specified directory (in the
example of .tclshrc, temp-cli.sh, and temp-cli-pwfile) or in a default
directory if not specified.

What I'd like to do is create a similar .deb package in the same manner
if at all possible.  Obviously some more things are needed to make .debs
but the above is just a starting point.
 
> Maybe you just want to create a utility that takes one of your
> custom packages and generates .deb?  No sense in working harder
> than necessary.

It's certainly worth looking into.

> > I'd like to solicit suggestions as to manual pages, documents, examples,
> > etc. I should read so that I can understand how to build Debian packages
> > in a similar fashion.  Any help would be most appreciated.
> 
> Well, there's the Debian policy manual, and then there's several
> thousand existing Debian packages as examples.  There's a manual
> for newbie developers in the "Developer's Corner" on the Debian
> website too, I think.  What else might be helpful?

Someone who has built a non-free package where the source wasn't
available (e.g. Netscape, msttcorefonts) and built it from there, as
that seems to be the closest scenario to my own (I have the source, but
it's poorly organized and bureaucratic hurdles make that difficult to
change at best).  Any of you done this?

An additional question I failed to ask earlier:  have any of you ever
tied the Changelogs in your packages to revision control systems?  Seems
silly to store the change logs twice (once in your RCS/SCCS checkin
comments and then again in the Changelog itself).

-- 
Michael S. Fischer / michael at dynamine.net / +1 650-533-4684
Lead Hacketeer, Dynamine Consulting, Silicon Valley, CA