diff options
author | PJ Eby <distutils-sig@python.org> | 2005-11-19 19:36:29 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2005-11-19 19:36:29 +0000 |
commit | 1c5aaf1332c6c00139883eeffe44c563737176ae (patch) | |
tree | 88e67a37702edd0d0a3423c41a7be93d56520ebe /setuptools/command/bdist_rpm.py | |
parent | e218cf0c77bcd66bfd5b9e30aee73f4787ed5b21 (diff) | |
download | external_python_setuptools-1c5aaf1332c6c00139883eeffe44c563737176ae.tar.gz external_python_setuptools-1c5aaf1332c6c00139883eeffe44c563737176ae.tar.bz2 external_python_setuptools-1c5aaf1332c6c00139883eeffe44c563737176ae.zip |
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
Diffstat (limited to 'setuptools/command/bdist_rpm.py')
-rwxr-xr-x | setuptools/command/bdist_rpm.py | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index 2cc3fb18..4db04a32 100755 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -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 ] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |