]> granicus.if.org Git - python/commitdiff
Patch #808120: Add --force-arch=ARCH to bdist_rpm.py.
authorMartin v. Löwis <martin@v.loewis.de>
Fri, 10 Sep 2004 06:32:54 +0000 (06:32 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Fri, 10 Sep 2004 06:32:54 +0000 (06:32 +0000)
Lib/distutils/command/bdist_rpm.py
Misc/ACKS
Misc/NEWS

index 11fd9f184c0644d06961e6e7b9a0de12a29ec918..559fcb9f7387e7a702f3c4be0ea221dc6be78966 100644 (file)
@@ -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',
index 1dc50a3048b8dba524c6153f1cc14b3aef842a70..04114bf8ffd34cd7210dca6fc0ff3786ef424e24 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -91,6 +91,7 @@ Lee Busby
 Ralph Butler
 Jp Calderone
 Daniel Calvelo
+Tony Campbell
 Brett Cannon
 Mike Carlton
 Terry Carroll
index f583ac93ca431baaf0bf912aa49bf90780ee897f..af0d1f2d6487207522c726c71d6016899e9333eb 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -22,8 +22,9 @@ Extension modules
 Library
 -------
 
-- bdist_rpm now supports command line options {pre,post}-install, 
-  {pre,post}-uninstall, and {prep,build,install,clean,verify}-script.
+- bdist_rpm now supports command line options --force-arch, 
+  {pre,post}-install,  {pre,post}-uninstall, and 
+  {prep,build,install,clean,verify}-script.
 - SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now support
   decoding incomplete input (when the input stream is temporarily exhausted).
   ``codecs.StreamReader`` now implements buffering, which enables proper