Gawk in buildroot

A few packages need the awk program to build correctly. I don't know how many, and that's not the point. The maintainers of these packages could solve their problem by adding Buildrequire: gawk to their spec files.

But It is very probable that the number of these packages will grow rapidly in the next few years. In the course of 2 or 3 years, more than 1/2 of Fedora packages will need awk to build.

In short, the reason is that, with the next release of Autoconf, the configure scriot won't work if awk is not available. As we know, most of the Fedora packages are using Autoconf, so as soon as the upstream maintainer of a package upgrades, that package will require awk to build. So the number will grow and grow.

You might reply: "But hey, it's an indirect requirement, so we resolve this by adding Requires: gawk to autoconf.spec." Well this won't work.

The explanation why this won't wotr is somewhat longer, so please bear with me:

Let's start with one example: perl.spec:

The upstream tarball contains script "Configure" that has to be called as the first step of the build. The script doesn't work without awk.

"Oh, well," you might say, "that's because the perl developpers wrote it this way." -- Well, that's almost right. I said "almost," because the perl developers have not used their vi or emacs to write the script. Instead, they used a tool called metaconfig to generate the huge shell script.

So is it metaconfig which should "require" gawk? No. Actually, Fedora even does not package metaconfig. The only instance of metaconfig involved here is /usr/local/bin/metaconfig on machine john.perl-hackers.net which John Doe used just before he released the perl-5.8.8.tar.gz tarball.

Now let's proceed to another example, say gnumeric.

Again, the first step to build gnumeric is to run a script for automated configuration. In this case, the script is called configure, with lowercase 'c'. And again, this many-thousands-lines long script was not crafted by the gnumeric developers. They use a tool called Autoconf to create the script.

The current gnumeric/configure script probably does not use awk at all. But the Autoconf project has accepted an interesting patch few months ago: some of the slow code which used sed was replaced by a more effective code which uses awk. I do not mean the code of autoconf script itself, I mean the code which Autoconf spits out to the configure.

So when the gnumeric developers upgrade to the next version of Autoconf and make a release, the situation will change:

This time, the ./configure won't work without awk. And like in the case of metaconfig, though Autoconf is the guilty one, it won't help if we add a Requires: to autoconf.spec. Like in the previous example, the only installation of Autoconf involved here is the one on the machine of gnumeric package. And he even does not use Fedora!

So the only solution will be to obediently add "Buildrequires: gawk" to our gnumeric.spec.

And likewise for every package with the new Autoconf. After some time, most spec files will contain the same Buildrequire tag.

With this perspective, wouldn't it be better to guarantee that the minimal koji buildroot always contain gawk?