3

I am trying to build Bash 4.2 as an RPM package for use on Enterprise Linux 5 systems, which come by default with 3.2.25. This works successfully, however, I want both versions to co-exist on the system, to avoid conflicts with the system package, and to allow system/other scripts to continue to use bash3 which they are compatible with.

My plan is as follows:

  • Rename the package 'bash4' and do not conflict with 'bash' or provide 'sh'
  • Configure bash to build with the binary name 'bash4' and change the path of any docs or support files accordingly

In theory this is simple and Vim offers binary prefix/suffix in it's configure scripts, however bash doesn't appear to have this feature. The closest I have found is automake's EXEEXT which provides support for executable extensions (such as .exe on Windows) but this isn't really designed for what I want to do, not does it solve the doc problem.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
Stealthii
  • 33
  • 2

1 Answers1

2

Though the bash autoconf version (2.63) is a little old (Sept 2008), it supports the --program-transform-name and --program-suffix features. Sadly the bash build process does not use these features as detailed by the documentation, nor does it use parameters to allow build-time processing of the man pages.

Since the number of files and changes is small, I recommend a semi-manual approach, i.e. write a small script to make the changes pre-installation. You can optionally use installwatch to make sure you catch everything during the install, but bash really is quite minimal. (FWIW, I had a quick look at the FreeBSD bash ports, and Debian bash patches, no sign of a suitable fix.)

While generally being an interesting way to break builds, you can abuse EXEEXT here:

ac_cv_exeext=42 ./configure [...]
make
./bash42 -c 'echo $BASH_VERSION'
4.2.42(1)-release

since all it saved you was a rename, I really don't recommend it ;-)

There's a little more to be gained from:

./configure [...]
make -e Program=bash42

as that also reflects your change within the generated bashbug script (though it does not rename it).

mr.spuratic
  • 9,721
  • 26
  • 41