-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython-bdist_rpm.patch
More file actions
50 lines (48 loc) · 2.77 KB
/
Copy pathpython-bdist_rpm.patch
File metadata and controls
50 lines (48 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
diff -urNp -x '*.orig' Python-2.7.18.org/Lib/distutils/command/bdist_rpm.py Python-2.7.18/Lib/distutils/command/bdist_rpm.py
--- Python-2.7.18.org/Lib/distutils/command/bdist_rpm.py 2020-04-19 23:13:39.000000000 +0200
+++ Python-2.7.18/Lib/distutils/command/bdist_rpm.py 2021-09-26 12:34:38.927912757 +0200
@@ -338,6 +338,16 @@ class bdist_rpm (Command):
if self.rpm3_mode:
rpm_cmd.extend(['--define',
'_topdir %s' % os.path.abspath(self.rpm_base)])
+ rpm_cmd.extend(['--define',
+ '_specdir %s/SPECS' % os.path.abspath(self.rpm_base)])
+ rpm_cmd.extend(['--define',
+ '_sourcedir %s/SOURCES' % os.path.abspath(self.rpm_base)])
+ rpm_cmd.extend(['--define',
+ '_builddir %s/BUILD' % os.path.abspath(self.rpm_base)])
+ rpm_cmd.extend(['--define',
+ '_rpmdir %s/RPMS' % os.path.abspath(self.rpm_base)])
+ rpm_cmd.extend(['--define',
+ '_srcrpmdir %s/SRPMS' % os.path.abspath(self.rpm_base)])
if not self.keep_temp:
rpm_cmd.append('--clean')
@@ -351,7 +361,7 @@ class bdist_rpm (Command):
# list is empty)
nvr_string = "%{name}-%{version}-%{release}"
src_rpm = nvr_string + ".src.rpm"
- non_src_rpm = "%{arch}/" + nvr_string + ".%{arch}.rpm"
+ non_src_rpm = nvr_string + ".%{arch}.rpm"
q_cmd = r"rpm -q --qf '%s %s\n' --specfile '%s'" % (
src_rpm, non_src_rpm, spec_path)
diff -urNp -x '*.orig' Python-2.7.18.org/Lib/distutils/tests/test_bdist_rpm.py Python-2.7.18/Lib/distutils/tests/test_bdist_rpm.py
--- Python-2.7.18.org/Lib/distutils/tests/test_bdist_rpm.py 2020-04-19 23:13:39.000000000 +0200
+++ Python-2.7.18/Lib/distutils/tests/test_bdist_rpm.py 2021-09-26 12:34:38.927912757 +0200
@@ -54,6 +54,8 @@ class BuildRpmTestCase(support.TempdirMa
'the rpm command is not found')
@unittest.skipIf(find_executable('rpmbuild') is None,
'the rpmbuild command is not found')
+ @unittest.skipIf(os.environ.get("WITHIN_PYTHON_RPM_BUILD"),
+ 'building the python rpm')
def test_quiet(self):
# let's create a package
tmp_dir = self.mkdtemp()
@@ -98,6 +100,8 @@ class BuildRpmTestCase(support.TempdirMa
'the rpm command is not found')
@unittest.skipIf(find_executable('rpmbuild') is None,
'the rpmbuild command is not found')
+ @unittest.skipIf(os.environ.get("WITHIN_PYTHON_RPM_BUILD"),
+ 'building the python rpm')
def test_no_optimize_flag(self):
# let's create a package that breaks bdist_rpm
tmp_dir = self.mkdtemp()