Opened 18 years ago

Closed 16 years ago

Last modified 16 years ago

#3338 closed (fixed)

build_rpm problems

Reported by: Dirk Datzert <dummy@…> Owned by: Jacob
Component: Uncategorized Version: dev
Severity: Keywords: build_rpm
Cc: Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I build Django rpms on different python versions and different rpm versions.
I always struggled over the INSTALLED_FILES where directories not prefixed with %dir any longer.
This stopps some rpm build process to stop packaging since files under those directories resulted in an 'File listed twice' error.

A simple rpm_install-script will fix this.

Attachments (4)

build_rpm.diff (1.0 KB ) - added by Dirk Datzert <dummy@…> 18 years ago.
rpm_install script and setup.cfg update
MANIFEST.in.diff (408 bytes ) - added by Dirk Datzert <dummy@…> 18 years ago.
I forgot that MANIFEST.in needs to include docs and scripts
MANIFEST.in.2.diff (725 bytes ) - added by Dirk Datzert <dummy@…> 18 years ago.
html-files and js/images etc also needs to be packed into sdist
3338.diff (1.5 KB ) - added by Gary Wilson <gary.wilson@…> 18 years ago.
combined patch

Download all attachments as: .zip

Change History (15)

by Dirk Datzert <dummy@…>, 18 years ago

Attachment: build_rpm.diff added

rpm_install script and setup.cfg update

by Dirk Datzert <dummy@…>, 18 years ago

Attachment: MANIFEST.in.diff added

I forgot that MANIFEST.in needs to include docs and scripts

by Dirk Datzert <dummy@…>, 18 years ago

Attachment: MANIFEST.in.2.diff added

html-files and js/images etc also needs to be packed into sdist

by Gary Wilson <gary.wilson@…>, 18 years ago

Attachment: 3338.diff added

combined patch

comment:1 by Gary Wilson <gary.wilson@…>, 18 years ago

Triage Stage: UnreviewedAccepted

When I try running python setup.py bdist_rpm, I get the following error:

tar -cf dist/Django-0.96-pre.tar Django-0.96-pre
gzip -f9 dist/Django-0.96-pre.tar
removing 'Django-0.96-pre' (and everything under it)
copying dist/Django-0.96-pre.tar.gz -> build/bdist.linux-i686/rpm/SOURCES
building RPMs
rpmbuild -ba --define _topdir /home/gdub/bzr/django/build_rpm-3338/build/bdist.linux-i686/rpm --clean build/bdist.linux-i686/rpm/SPECS/Django.spec
error: File /home/gdub/bzr/django/build_rpm-3338/build/bdist.linux-i686/rpm/SOURCES/Django-0.96_pre.tar.gz: No such file or directory
error: command 'rpmbuild' failed with exit status 1

It appears that the version set in the spec file is 0.96_pre, and can't file the tar file with this name. Instead it's getting named ./build/bdist.linux-i686/rpm/SOURCES/Django-0.96-pre.tar.gz. I've never built a python package into an RPM. Do you know what's going on here?

in reply to:  1 comment:2 by Dirk Datzert <dummy@…>, 18 years ago

Replying to Gary Wilson <gary.wilson@gmail.com>:

When I try running python setup.py bdist_rpm, I get the following error:

tar -cf dist/Django-0.96-pre.tar Django-0.96-pre
gzip -f9 dist/Django-0.96-pre.tar
removing 'Django-0.96-pre' (and everything under it)
copying dist/Django-0.96-pre.tar.gz -> build/bdist.linux-i686/rpm/SOURCES
building RPMs
rpmbuild -ba --define _topdir /home/gdub/bzr/django/build_rpm-3338/build/bdist.linux-i686/rpm --clean build/bdist.linux-i686/rpm/SPECS/Django.spec
error: File /home/gdub/bzr/django/build_rpm-3338/build/bdist.linux-i686/rpm/SOURCES/Django-0.96_pre.tar.gz: No such file or directory
error: command 'rpmbuild' failed with exit status 1

It appears that the version set in the spec file is 0.96_pre, and can't file the tar file with this name. Instead it's getting named ./build/bdist.linux-i686/rpm/SOURCES/Django-0.96-pre.tar.gz. I've never built a python package into an RPM. Do you know what's going on here?

Yes, I can verify this. In the setup.py the version is build with hyphens '-', this works fine for sdist command, but this is not allowd in the version number syntax of an rpm. I run the setup.py with version build like this:

Index: setup.py
===================================================================
--- setup.py    (Revision 4386)
+++ setup.py    (Arbeitskopie)
@@ -33,7 +33,7 @@
         file_info[0] = '/PURELIB/%s' % file_info[0]

 # Dynamically calculate the version based on django.VERSION.
-version = "%d.%d-%s" % (__import__('django').VERSION)
+version = "0.95.4386"

 setup(
     name = "Django",

comment:3 by Gary Wilson <gary.wilson@…>, 18 years ago

Triage Stage: AcceptedReady for checkin

If underscore works with both, maybe we should change the version in setup.py to use an underscore instead of a hyphen. No matter the case, the attached patch fixes this ticket, so I'm marking as ready.

comment:4 by Malcolm Tredinnick, 18 years ago

(In [4490]) Refs #3338 -- Partially fix rpm packaging problems. There is still one issue
remaining with how we construct the version numbers, but this change is useful
nonetheless. Patch from Dirk Datzert.

comment:5 by Malcolm Tredinnick, 18 years ago

Triage Stage: Ready for checkinDesign decision needed

We still need to work out whether to change our version number of change the rpm packaging script to put the right tarball name in the SPEC file and replace hyphens with something else in the package name. I'm not sure about the right approach there at the moment. I've checked in the work so far, though.

comment:6 by Gary Wilson <gary.wilson@…>, 18 years ago

Has patch: unset

The hyphen problem has no patch.

comment:7 by Malcolm Tredinnick, 18 years ago

Summary: [patch] build_rpm throws 'File listed twice' errorsbuild_rpm problems

Making the title reflect the ticket contents.

comment:8 by Malcolm Tredinnick, 18 years ago

Resolution: fixed
Status: newclosed

(In [4912]) Fixed #3338, #3536, #3796 -- Fixed a bunch of setup and build problems in a
portable fashion. That took a *lot* longer to debug than I thought it would, so
let's try not to break it.

comment:9 by John Anderson, 16 years ago

Resolution: fixed
Status: closedreopened

It appears that this is broken again in 1.1 beta 1.

comment:10 by Alex Gaynor, 16 years ago

Resolution: fixed
Status: reopenedclosed

This bug was fixed 2 years ago, if you think there's a new issue open a new ticket.

comment:11 by John Anderson, 16 years ago

For future reference, this has reopened in #9616.

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