Commit 1b618f36 authored by Martin v. Löwis's avatar Martin v. Löwis

Patch #1360200: Use unmangled_version RPM spec field to deal with

file name mangling.
Will backport to 2.5.
parent 5a83e912
...@@ -391,6 +391,7 @@ class bdist_rpm (Command): ...@@ -391,6 +391,7 @@ class bdist_rpm (Command):
spec_file = [ spec_file = [
'%define name ' + self.distribution.get_name(), '%define name ' + self.distribution.get_name(),
'%define version ' + self.distribution.get_version().replace('-','_'), '%define version ' + self.distribution.get_version().replace('-','_'),
'%define unmangled_version ' + self.distribution.get_version(),
'%define release ' + self.release.replace('-','_'), '%define release ' + self.release.replace('-','_'),
'', '',
'Summary: ' + self.distribution.get_description(), 'Summary: ' + self.distribution.get_description(),
...@@ -412,9 +413,9 @@ class bdist_rpm (Command): ...@@ -412,9 +413,9 @@ class bdist_rpm (Command):
# but only after it has run: and we create the spec file before # but only after it has run: and we create the spec file before
# running "sdist", in case of --spec-only. # running "sdist", in case of --spec-only.
if self.use_bzip2: if self.use_bzip2:
spec_file.append('Source0: %{name}-%{version}.tar.bz2') spec_file.append('Source0: %{name}-%{unmangled_version}.tar.bz2')
else: else:
spec_file.append('Source0: %{name}-%{version}.tar.gz') spec_file.append('Source0: %{name}-%{unmangled_version}.tar.gz')
spec_file.extend([ spec_file.extend([
'License: ' + self.distribution.get_license(), 'License: ' + self.distribution.get_license(),
...@@ -489,7 +490,7 @@ class bdist_rpm (Command): ...@@ -489,7 +490,7 @@ class bdist_rpm (Command):
# are just text that we drop in as-is. Hmmm. # are just text that we drop in as-is. Hmmm.
script_options = [ script_options = [
('prep', 'prep_script', "%setup"), ('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"),
('build', 'build_script', def_build), ('build', 'build_script', def_build),
('install', 'install_script', ('install', 'install_script',
("%s install " ("%s install "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment