Commit 1c5aaf13 authored by PJ Eby's avatar PJ Eby

Kludges to make building packages with '-' in their version work with

bdist_rpm.  This still doesn't address the issue of building RPMs that
don't effectively install as multi-version eggs, but at least now
building RPMs for development eggs is possible.

--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041482
parent e218cf0c
......@@ -21,7 +21,24 @@ class bdist_rpm(_bdist_rpm):
_bdist_rpm.run(self)
def _make_spec_file(self):
version = self.distribution.get_version()
rpmversion = version.replace('-','_')
spec = _bdist_rpm._make_spec_file(self)
line23 = '%define version '+version
line24 = '%define version '+rpmversion
spec = [
line.replace(
"Source0: %{name}-%{version}.tar",
"Source0: %{name}-%{unmangled_version}.tar"
).replace(
"%setup",
"%setup -n %{name}-%{unmangled_version}"
).replace(line23,line24)
for line in spec
]
spec.insert(spec.index(line24)+1, "%define unmangled_version "+version)
if not self.no_egg:
return spec
......@@ -31,3 +48,35 @@ class bdist_rpm(_bdist_rpm):
"setup.py install ","setup.py install --old-and-unmanageable "
) for line in spec
]
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