Opened 9 years ago

Closed 6 years ago

Last modified 6 years ago

#3338 closed (fixed)

build_rpm problems

Reported by: Dirk Datzert <dummy@…> Owned by: jacob
Component: Uncategorized Version: master
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: UI/UX:

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@…> 9 years ago.
rpm_install script and setup.cfg update
MANIFEST.in.diff (408 bytes) - added by Dirk Datzert <dummy@…> 9 years ago.
I forgot that MANIFEST.in needs to include docs and scripts
MANIFEST.in.2.diff (725 bytes) - added by Dirk Datzert <dummy@…> 9 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@…> 9 years ago.
combined patch

Download all attachments as: .zip

Change History (15)

Changed 9 years ago by Dirk Datzert <dummy@…>

rpm_install script and setup.cfg update

Changed 9 years ago by Dirk Datzert <dummy@…>

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

Changed 9 years ago by Dirk Datzert <dummy@…>

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

Changed 9 years ago by Gary Wilson <gary.wilson@…>

combined patch

comment:1 follow-up: Changed 9 years ago by Gary Wilson <gary.wilson@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

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?

comment:2 in reply to: ↑ 1 Changed 9 years ago by Dirk Datzert <dummy@…>

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 Changed 9 years ago by Gary Wilson <gary.wilson@…>

  • Triage Stage changed from Accepted to Ready 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 Changed 9 years ago by mtredinnick

(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 Changed 9 years ago by mtredinnick

  • Triage Stage changed from Ready for checkin to Design 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 Changed 9 years ago by Gary Wilson <gary.wilson@…>

  • Has patch unset

The hyphen problem has no patch.

comment:7 Changed 9 years ago by mtredinnick

  • Summary changed from [patch] build_rpm throws 'File listed twice' errors to build_rpm problems

Making the title reflect the ticket contents.

comment:8 Changed 8 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(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 Changed 6 years ago by guitarmanvt

  • Resolution fixed deleted
  • Status changed from closed to reopened

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

comment:10 Changed 6 years ago by Alex

  • Resolution set to fixed
  • Status changed from reopened to closed

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

comment:11 Changed 6 years ago by guitarmanvt

For future reference, this has reopened in #9616.

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