[SJF Logo]
Steve Friedl's Weblog

May 10, 2003
Building packages from source

I build virtually all my "important" packages - defined as anything that touches the internet - directly from source obtained from the package's home site, and I have come across a system that works really well for me.

  1. All source code is parked in the /source directory, which is a symlink to whatever place has enough room (/usr/source, /home/source, etc.). This makes it consistent from machine to machine.
  2. All source bundles are fetched with wget to the /source/tarballs directory - this keeps them all in one easy place.
  3. Obviously, the packages are all extracted relative to /source, so we end up with paths like /source/proftpd-1.2.8/.
  4. Almost all packages use the configure script, and each has its own requirements. Rather than try to remember which options are required to build a new version, I always make a small script in the main /source directory called (for instance) /source/configure-proftpd. This little script contains comments and the actual configure command required, and I usually start by filling the file with configure's help output:
    ./configure --help > ../configure-proftpd
    and then edit the file to start it with
    exec ./configure --whatever --something --etc
    Now I have a ready reference to tune the options. When ready to build the thing, from inside the source directory I just run
    ../configure-proftpd
    and it does what's required.
When this is most helpful is when I need to build this again on some other platform, or build an updated version on this one - I just grab the little configure wrapper and I don't have to guess the options needed a gain.

apt-get and rpm are for wimps :-)

Posted by Steve at May 10, 2003 12:02 PM | TrackBack
Comments

Well, you can always use apt-get to fetch source .deb files and then compile yourself.

Posted by: Jeremy Zawodny on May 10, 2003 01:56 PM

Why would I rely on some third party to gather the source code I need when I can always get it directly from the authoritative source?

In addition, I build this software on lots of different platforms (various Linux, Unixware, BSD, etc.) and it serves me well to have more or less the same procedure for all of them. This is a very portable skill.

Posted by: Steve Friedl on May 10, 2003 02:00 PM

Unless you never use mirrors, you already rely on a third party. At least you'd know that the debian packages are all GPG signed.

But, yeah, if you have to do it on many platforms, you must do something custom.

Posted by: Jeremy Zawodny on May 10, 2003 03:17 PM

Actually, no: mirrors are agents of the first party, and they offer no meaningful delay in propogation of the code. Parties such as Red Hat have to "do stuff" to create their distributions, so this adds delay, chance for errors, and no value for me at all.

Posted by: Steve Friedl on May 10, 2003 03:39 PM
Post a comment
Name:


Email Address:


URL:


Comments:


Remember info?