From: stevenknight Date: Wed, 27 Nov 2002 03:52:20 +0000 (+0000) Subject: Fix for Red Hat 8.0: use rpmbuild instead of rpm (if it exists). (Terrel Shumway) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5a93634c6a72fabf4ede1fe73946040fb619ce20;p=scons.git Fix for Red Hat 8.0: use rpmbuild instead of rpm (if it exists). (Terrel Shumway) git-svn-id: http://scons.tigris.org/svn/scons/trunk@508 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/SConstruct b/SConstruct index 866da6b5..a88d19db 100644 --- a/SConstruct +++ b/SConstruct @@ -68,7 +68,7 @@ aesub = whereis('aesub') dh_builddeb = whereis('dh_builddeb') fakeroot = whereis('fakeroot') gzip = whereis('gzip') -rpm = whereis('rpm') +rpmbuild = whereis('rpmbuild') or whereis('rpm') unzip = whereis('unzip') zip = whereis('zip') @@ -266,6 +266,9 @@ env = Environment( ZCAT = zcat, + RPMBUILD = rpmbuild, + RPM2CPIO = 'rpm2cpio', + TEST_DEB_DIR = test_deb_dir, TEST_RPM_DIR = test_rpm_dir, TEST_SRC_TAR_GZ_DIR = test_src_tar_gz_dir, @@ -641,7 +644,7 @@ for p in [ scons ]: os.path.join(unpack_zip_dir, pkg_version, 'setup.py'), ]) - if rpm: + if rpmbuild: topdir = os.path.join(os.getcwd(), build, 'build', 'bdist.' + platform, 'rpm') @@ -653,14 +656,14 @@ for p in [ scons ]: specfile = os.path.join(SPECSdir, "%s-1.spec" % pkg_version) sourcefile = os.path.join(SOURCESdir, "%s.tar.gz" % pkg_version); - rpm = os.path.join(RPMSdir, "%s-1.noarch.rpm" % pkg_version) + noarch_rpm = os.path.join(RPMSdir, "%s-1.noarch.rpm" % pkg_version) src_rpm = os.path.join(SRPMSdir, "%s-1.src.rpm" % pkg_version) env.InstallAs(specfile, os.path.join('rpm', "%s.spec" % pkg)) env.InstallAs(sourcefile, tar_gz) - targets = [ rpm, src_rpm ] - cmd = "rpm --define '_topdir $(%s$)' -ba $SOURCES" % topdir + targets = [ noarch_rpm, src_rpm ] + cmd = "$RPMBUILD --define '_topdir $(%s$)' -ba $SOURCES" % topdir if not os.path.isdir(BUILDdir): cmd = ("$( mkdir -p %s; $)" % BUILDdir) + cmd env.Command(targets, specfile, cmd) @@ -671,8 +674,8 @@ for p in [ scons ]: dfiles = map(lambda x, d=test_rpm_dir: os.path.join(d, 'usr', x), dst_files) env.Command(dfiles, - rpm, - "rpm2cpio $SOURCES | (cd $TEST_RPM_DIR && cpio -id)") + noarch_rpm, + "$RPM2CPIO $SOURCES | (cd $TEST_RPM_DIR && cpio -id)") if dh_builddeb and fakeroot: # Our Debian packaging builds directly into build/dist,