Mock and old distributions

Paul Howarth paul at city-fan.org
Mon Jun 26 21:31:59 UTC 2006


Seeing that the need for elfutils in the buildroot for FC4 was discussed
in the latest FESCO meeting, I thought I'd report the results of my
efforts to build packages for various old distributions using the
current version of mock on FC5:

1. For all Fedora Core distributions before Fedora Core 5, and also Red
Hat Linux 9, an additional package, elfutils, is needed in the default
buildroot. It's needed because redhat-rpm-config turns on the creation
of debuginfo packages, and eu-strip from the elfutils package is needed
for this. In Fedora Core 5, elfutils is a dependency of rpm-build, so it
gets pulled in automatically, but this doesn't happen for earlier
distributions. There is disagreement about where the dependency should
really be (see Bug #111363, Bug #132633, and Bug #155129) so in the
meantime (and certainly for end-of-lifed distributions), it needs to be
a dependency of buildsys-build.

2. For all Fedora Core and Red Hat Linux distributions before Fedora
Core 3, runuser isn't available and so the mock configuration file
needs:

config_opts['runuser'] = '/bin/su'

3. I can't get mock to build for a Fedora Core 2 target on an x86_32
host, though I'm told it works on an x86_64 host, and it might work
with SELinux disabled (not just permissive mode). The symptom is that
it hangs up at the useradd mockbuild stage. I'd be interested to hear
from anyone that has this working.

4. To build for a target of Fedora Core 1, you need to set in the
host's /etc/sysctl.conf: 

kernel.vdso = 0

This is due to a glibc bug (Bug #121351). 

5. Building for any Red Hat Linux target requires rebuilding of many of
the original packages, which have broken dependencies due to the use of
Epoch: tags and the omission of the epoch in exact version dependencies,
such as between foo and foo-devel.

6. Building for any Red Hat Linux target older than Red Hat Linux 9
requires file, fileutils, and findutils in the buildroot rather than
coreutils (these are needed for the post-build scripts).

7. Red Hat Linux 7 does not include the redhat-rpm-config package, so it
must not be included in the buildroot.


Some of the above (e.g. the need for "su" rather than "runuser") could
be fixed in the mock package. The other items could perhaps be added to
a README or perhaps I should update the Legacy/Mock page on the wiki?

As for what's needed in the buildroot, I rolled my own buildsys-build
package, with deps as follows:

# packages that populate a buildsys chroot
Requires: bash
Requires: buildsys-macros
Requires: bzip2
Requires: cpio
Requires: diffutils
Requires: gcc
Requires: gcc-c++
Requires: gzip
Requires: make
Requires: patch
Requires: perl
Requires: rpm-build
Requires: sed
Requires: tar
Requires: unzip

# The rather long-winded format of the conditionals is needed for
compatibility
# with old rpm versions such as were supplied with Red Hat Linux 7
%if "%{?fedora}" != ""
Requires: coreutils
Requires: fedora-release
Requires: redhat-rpm-config
%if "%{?fedora}" == "4" ||  "%{?fedora}" == "3" || "%{?fedora}" == "2"
|| "%{?fedora}" == "1"
Requires: elfutils
%endif
%endif

%if "%{?rhl}" != ""
Requires: redhat-release
%if "%{?rhl}" == "9"
Requires: coreutils
Requires: elfutils
Requires: redhat-rpm-config
%else
Requires: file
Requires: fileutils
Requires: findutils
%endif
# Cater for alternative versions of buildsys-macros
%if "%{?rhl}" == "8" || "%{?rhl}" == "8.0"
Requires: redhat-rpm-config
%endif
%endif

"which" should probably be added to the list too; it was a late addition
to the buildreq exceptions list and didn't get included in my package.

Paul.




More information about the fedora-extras-list mailing list