Last updated 31st July 2009
It really does need a new name. There is already a pbuild out there, if not several, and at least one is for building software. I was thinking of bean, but Java has beans and people might get confused. Something that suggests "slack" might be better, but I can't think of anything just now.
Downloading source tarballs is now automated. Package versions can be updated with a single command. Source compression format is automatically converted if required.
There are many Free and Open Source software projects that are interesting, useful and fun to use, but which may not have binary packages for your (or any) Linux (or other unix-like OS) distribution. Building from source is usually fairly easy (configure, make, make install) but it can soon become time-consuming to do manually. For larger projects that consist of multiple smaller packages, upgrading, remembering configuration options and removing old versions can be very tedious. I have written a build and packaging system of my own to solve many of these problems. The idea is to build binaries quickly, simply and cleanly for my personal machines without using any cryptic package formats using only the Bourne Again Shell (bash) and the standard GNU tools.
Runs on Slackware 10.x, 11.x, 12.x, Slamd64-12.x, Solaris Nevada (11)
and possibly most unix-like operating systems with the GNU tools.
Uses tar for binary packages (no rpm or deb mayhem)
All utilities and the build system (install, remove etc.) are written in
bash so there's no compilation, no extra interpreters or
infrastructure required and bash is Free of course
Choice of compression algorithms (and easily extended to support new
ones)
Multi-processor support (build gcc -j many and compress with
parallel bzip2 implementations)
Plain text package database
No stinking PERL or XML!
Runs happily in a chroot jail (isolate the OS from accidents)
Builds from standard tarballs
Automated source tarball retrieval
Free-as-in-Speech (GPL)
Packages build while-u-sleep. Wake up to freshly-baked binaries!
Incorporates a prototype bash unit test framework (20 lines)!
It's possible for a single maintainer to look after 50+ packages in a few spare minutes once or twice a week.
At my previous job I had a dual core intel PC running Slackware 10.2 and a single-core AMD PC at home running Slackware 11.0. I had a Slackware 10.2 chroot jail set up on the home PC where I could build all my packages, burn them to CD and install them on the machine at work. This saved me a lot of time and trouble.
It's still pretty primitive and untidy, but here it is in all its
glory:
pbuild-unified-20090723.tar.bz2
README
Copying
Changelog
Cheap-Jail-HowTo
Test-Driven Development Mini-HowTo
The README was written at high speed and omits some important details.
Why all the Solaris stuff all of a sudden? It's a very good high-end OS and it's free and open source now. It hardly gets the credit it deserves (and I used to work on it (at Sun) years ago).
gcc builds do not work on Solaris because I have not put in the required bodges (kludges) to the build scripts. I have build gcc-4.2.4 "by hand" on my SunBlade 100 and it took a long time. I'd like to put the binary up here for download but I don't have space on this site.
Here's how to do it.
You are using bash, aren't you? OK, make sure that you have /usr/sfw/bin in your PATH:
export PATH=/usr/sfw/bin:$PATH
Extract the source from the tarball:
gtar jxf gcc-4.2.4.tar.bz2
Make a directory for the build:
mkdir gcc-4.2.4-build
Fix the configure script. Don't bother using CONFIG_SHELL. The build
will break several times and have to be restarted because the shell path
is not substituted correctly in some of the dynamically-generated
scripts. Last time I looked on the Internet, this was a known bug and no
one could be bothered to fix it.
cd gcc-4.2.4
cp configure configure.orig
sed -e 's,/bin/sh,/bin/bash,g' configure.orig > configure
Now run configure. This will put the binaries in /opt/gcc-4.2.4 (which
is as good a place as any) and should build C, C++ and Objective-C:
cd ../gcc-4.2.4-build
../gcc-4.2.4/configure --prefix=/opt/gcc-4.2.4 --enable-languages=c,c++,objc
Now run the build. I did a "profiled bootstrap build" which is alleged
to make a compiler tuned for your system. I haven't had time to test
this claim yet, but it does make the build incredibly slow. If you
really want to do this do:
time gmake profiledbootstrap > build_log.1 2>&1
You can follow the build with tail -f as usual.
If you are more sensible and would like a binary some time the same
year, you might like a plain bootstrap build:
time gmake bootstrap > build_log.1 2>&1
The profiled bootstrap build took:
real 2758m49.489s
user 753m53.233s
sys 1049m15.944s
on my antediluvian system (other tasks were running). When the wailing
and gnashing of teeth is over, install it:
su
bash
export PATH=/usr/sfw/bin:$PATH
gmake install
exit
Now, save your precious binary tree for posterity in case you need to
reinstall it:
gtar cvf gcc-4.2.4-solaris-sparc.tar /opt/gcc-4.2.4
bzip2 gcc-4.2.4-solaris-sparc.tar
When compiling using this compiler, you'll need to add
/opt/gcc-4.2.4/lib to LD_LIBRARY_PATH.
Expected build times vary enormously depending on the spec of the machine and the packages built.
Here's a table of sample timings for some of the machines on my network.
| Name | OS | CPU Type | No. of CPUs/Cores | Frequency | RAM Size | Disk Type | Load | Build | Time |
| delphinus | Slamd64-12.2 | AMD Athlon 64 X2 | 2 | 2.6 GHz | 4GB | SATA | SETI@home | sequence.list | real 232m42.000s user 277m41.501s sys 30m14.613s |
| zubenelgenubi | Slackware-12.2 | AMD Athlon XP2000+ | 1 | 1.67 GHz | 512MB | IDE | SETI@home | sequence.list | real 712m2.948s user 515m36.429s sys 44m45.920s |
| orion | Slackware-12.2 | intel Pentium III | 2 | 550 MHz | 192MB | IDE | none | sequence.list | real 2073m0.247s user 1756m21.130s sys 190m56.856s |
| leviathan | Solaris 11/Nevada b104 | UltraSPARC IIi | 1 | 500 MHz | 512MB | IDE | none | sparc-sequence.list | real 821m21.543s user 473m28.833s sys 279m57.403s |
| phobos | Solaris 11/Nevada b114 | UltraSPARC IIi | 4 | 450 MHz | 2GB | SCSI | none | sparc-sequence.list | real 315m11.294s user 247m49.910s sys 77m38.028s |
Note that the Java webconsole had been turned off on the Solaris box, and prevented from automatically starting at boot time:
/usr/sbin/smcwebserver stop
/usr/sbin/smcwebserver disable
I've got a K6-2/500 with 512MB RAM running Gentoo, but I haven't tried that yet.