diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2004-09-10 06:32:54 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2004-09-10 06:32:54 (GMT) |
commit | 23c48a12d9a6f80e948a7f00fa01f9e6407b557a (patch) | |
tree | 7746595d18b3c7e97146b44fc1879ceec733af9e /Lib/distutils | |
parent | 641d64812cdb52c7e3bbc17644e403d030baad30 (diff) | |
download | cpython-23c48a12d9a6f80e948a7f00fa01f9e6407b557a.zip cpython-23c48a12d9a6f80e948a7f00fa01f9e6407b557a.tar.gz cpython-23c48a12d9a6f80e948a7f00fa01f9e6407b557a.tar.bz2 |
Patch #808120: Add --force-arch=ARCH to bdist_rpm.py.
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/command/bdist_rpm.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Lib/distutils/command/bdist_rpm.py b/Lib/distutils/command/bdist_rpm.py index 11fd9f1..559fcb9 100644 --- a/Lib/distutils/command/bdist_rpm.py +++ b/Lib/distutils/command/bdist_rpm.py @@ -120,6 +120,9 @@ class bdist_rpm (Command): ('verify-script=', None, "Specify a script for the VERIFY phase of the RPM build"), + # Allow a packager to explicitly force an architecture + ('force-arch=', None, + "Force an architecture onto the RPM build process"), ] boolean_options = ['keep-temp', 'use-rpm-opt-flags', 'rpm3-mode'] @@ -170,6 +173,8 @@ class bdist_rpm (Command): self.use_rpm_opt_flags = 1 self.rpm3_mode = 1 + self.force_arch = None + # initialize_options() @@ -250,6 +255,7 @@ class bdist_rpm (Command): self.ensure_string_list('build_requires') self.ensure_string_list('obsoletes') + self.ensure_string('force_arch') # finalize_package_data () @@ -389,9 +395,12 @@ class bdist_rpm (Command): 'BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot', 'Prefix: %{_prefix}', ]) - # noarch if no extension modules - if not self.distribution.has_ext_modules(): - spec_file.append('BuildArchitectures: noarch') + if not self.force_arch: + # noarch if no extension modules + if not self.distribution.has_ext_modules(): + spec_file.append('BuildArch: noarch') + else: + spec_file.append( 'BuildArch: %s' % self.force_arch ) for field in ('Vendor', 'Packager', |