Opened 16 years ago

Closed 16 years ago

#9630 closed (duplicate)

Building RPM from svn checkout (of 1.0.1 tag) fails

Reported by: robinbowes Owned by: nobody
Component: Uncategorized Version: 1.0
Severity: Keywords: rpm
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I checked out v1.0.1 from the svn tag and tried to build it using python setup.py bdist_rpm

It failed with the following msg:

...
hard linking extras/django_bash_completion -> Django-1.0.1-final/extras
hard linking scripts/rpm-install.sh -> Django-1.0.1-final/scripts
tar -cf dist/Django-1.0.1-final.tar Django-1.0.1-final
gzip -f9 dist/Django-1.0.1-final.tar
removing 'Django-1.0.1-final' (and everything under it)
copying dist/Django-1.0.1-final.tar.gz -> build/bdist.linux-x86_64/rpm/SOURCES
building RPMs
rpmbuild -ba --define _topdir /var/software/django/1.0.1/build/bdist.linux-x86_64/rpm --clean build/bdist.linux-x86_64/rpm/SPECS/Django.spec
error: File /var/software/django/1.0.1/build/bdist.linux-x86_64/rpm/SOURCES/Django-1.0.1_final.tar.gz: No such file or directory
error: command 'rpmbuild' failed with exit status 1

Upon further investigation, this is because of a mis-match between the version string generated by setuptools and written into the spec file:

%define version 1.0.1_final

and code in setup.py:

...
version = __import__('django').get_version()
if u'SVN' in version:
    version = ' '.join(version.split(' ')[:-1])

setup(
    name = "Django",
    version = version.replace(' ', '-'),
...

which generates a version of 1.0.1-final

Notice that one uses _ (underscore) while the other uses - (hyphen).

I fixed this by changing version.replace(' ', '-') to version.replace(' ', '_') in setup.py, but I don't know enough about the rest of your naming convention to determine whether or not this is an appropriate fix.

Change History (1)

comment:1 by robinbowes, 16 years ago

Resolution: duplicate
Status: newclosed

Duplicate of #9616

Note: See TracTickets for help on using tickets.
Back to Top