redhat: Avoid bogus dependencies when building the srpm

By default the spec defines that both userland and kernel module
packages should be built. This results in a dependency of the form
"kernel-devel-`uname -m` = `uname -r`" being added to the source
package created by makesrpm.pl, which is bogus because the uname
values are from the system on which the srpm is built and needn't
apply to the system where it is used. While rpm and rpmbuild ignore
such dependencies of source packages, other tools don't and may fail.

Some versions of rpmbuild will also enforce those requirements when
building the srpm itself, which is pointless too.

Avoid both problems by pretending not to attempt building modules
and ignoring any dependencies when makesrpm.pl invokes rpmbuild -bs.

Change-Id: I0134e1936638c7d9c3fd9ff0ccf1cba36710d0d3
Reviewed-on: http://gerrit.openafs.org/11903
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
This commit is contained in:
Stephan Wiesand 2015-06-22 10:44:11 +02:00 committed by Benjamin Kaduk
parent db4343b870
commit 9ee5fa152b

View File

@ -159,7 +159,8 @@ if ($changelog) {
}
# Build an RPM
system("rpmbuild -bs --define \"dist %undefined\" ".
system("rpmbuild -bs --nodeps --define \"dist %undefined\" ".
"--define \"build_modules 0\" ".
"--define \"_topdir $tmpdir/rpmdir\" ".
"$tmpdir/rpmdir/SPECS/openafs.spec > /dev/null") == 0
or die "rpmbuild failed : $!\n";