1From a612c481f6116955d420db5ae1fe4c1eb93eb2f2 Mon Sep 17 00:00:00 2001
2From: Marcin Niemira <marcin.niemira@gmail.com>
3Date: Sun, 9 Jun 2019 07:05:06 +1000
4Subject: [PATCH] bpo-11122: fix hardcoded path checking for rpmbuild in
5 bdist_rpm.py (GH-10594) (cherry picked from commit
6 45a14942c969ed508b35abd5e116cb18f84ce5b4)
7
8Co-authored-by: Marcin Niemira <marcin.niemira@gmail.com>
9---
10 Lib/distutils/command/bdist_rpm.py | 5 +----
11 .../next/Library/2018-11-12-19-08-50.bpo-11122.Gj7BQn.rst | 1 +
12 2 files changed, 2 insertions(+), 4 deletions(-)
13 create mode 100644 Misc/NEWS.d/next/Library/2018-11-12-19-08-50.bpo-11122.Gj7BQn.rst
14
15diff --git a/Lib/distutils/command/bdist_rpm.py b/Lib/distutils/command/bdist_rpm.py
16index 20ca7ac6dcffa..74381cc69a6ce 100644
17--- a/Lib/distutils/command/bdist_rpm.py
18+++ b/Lib/distutils/command/bdist_rpm.py
19@@ -309,10 +309,7 @@ def run(self):
20
21 # build package
22 log.info("building RPMs")
23- rpm_cmd = ['rpm']
24- if os.path.exists('/usr/bin/rpmbuild') or \
25- os.path.exists('/bin/rpmbuild'):
26- rpm_cmd = ['rpmbuild']
27+ rpm_cmd = ['rpmbuild']
28
29 if self.source_only: # what kind of RPMs?
30 rpm_cmd.append('-bs')