Packaging BitKeeper
Packaging BitKeeper has turned out to be a little challenging because of two main reasons:
-
It bundles a bunch of other programs, some of them modified.
-
The build system is not standardized (i.e.
make && make installdoesn’t install things where it’s expected.
This is my attempt to provide a roadmap for making it easier to package BitKeeper for the different distributions.
Unbundling BitKeeper
BitKeeper currently consists of the following modules:
- diffutils
- patch
- Tcl/Tk – Really little-lang
- The following Tk Packages:
- Bwidget (Tcl/Tk module)
- TkCon
- TkTable
- TkTreectrl
- PCRE
- Tomcrypt
- Tommath
Diffutils & Patch
There is currently an attempt underway to drop the requirement for diffutils and patch.
PCRE
It seems it’d be relatively easy to drop the bundled PCRE as there don’t seem to be any modifications to them. We could just require libpcre-dev from the package system in order to build BitKeeper (the library is statically linked).
TomMath & TomCrypt
libtommath is only used as a requirement for libtomcrypt so I’ll only discuss libtomcrypt.
libtomcrypt is used in src/crypto.c in order to implement the bk crypto command. This command as far as I can tell, is only used for creating hashes in src/gui/tcltk/version.sh, src/build_upgrade_index.pl, src/update_buildenv, and src/win32/msysver.sh.
All of this infrastructure could be replaced with a requirement on the md5 of sha1 binary that distributions usually provide. On Windows there appears to be certUtil that can handle hashing files.[1]
The only other use for cryptographic utilities is MD5KEYS which are fundamental for BitKeeper.
Tcl/Tk and friends
The most modified package bundled with BitKeeper is Tcl/Tk. In reality, this is not Tcl/Tk but http://little-lang.org(The Little Language).
The Build System
The current build system creates a temporary holding area with all the files that will be installed in $(bk root)/src/tmp/bitkeeper. The directory can be created using the installdir target, like so:
make installdir
That installdir is designed to be a bundle, i.e. the bk executable expects to find binaries, and scripts it needs inside that path.
We should make installdir comply with the standard layout of distributions. That is, binaries in bin, libraries in lib, etc.
A Plan for Packaging
This is my first pass at a plan for packaging:
- Package little-lang so that BitKeeper can depend on it.
- Remove
diffutilsandpatchdependency and just use the system’s. - Remove
PCREas a bundle and just requirelibpcre-devto be installed. (For Windows, require it as part of MSYS, for OSX get it viabrew). - Leave
libtomcryptandlibtommathas they are. - Maybe unbundle all the Tcl/Tk stuff?
