Django

Code

Ticket #3338 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

build_rpm problems

Reported by: Dirk Datzert <dummy@habmalnefrage.de> Assigned to: jacob
Milestone: Component: Uncategorized
Version: SVN Keywords: build_rpm
Cc: Triage Stage: Design decision needed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

build_rpm.diff (1.0 kB) - added by Dirk Datzert <dummy@habmalnefrage.de> on 01/20/07 12:04:41.
rpm_install script and setup.cfg update
MANIFEST.in.diff (408 bytes) - added by Dirk Datzert <dummy@habmalnefrage.de> on 01/20/07 13:07:45.
I forgot that MANIFEST.in needs to include docs and scripts
MANIFEST.in.2.diff (0.7 kB) - added by Dirk Datzert <dummy@habmalnefrage.de> on 01/20/07 13:11:12.
html-files and js/images etc also needs to be packed into sdist
3338.diff (1.5 kB) - added by Gary Wilson <gary.wilson@gmail.com> on 01/21/07 15:26:21.
combined patch

Change History

01/20/07 12:04:41 changed by Dirk Datzert <dummy@habmalnefrage.de>

  • attachment build_rpm.diff added.

rpm_install script and setup.cfg update

01/20/07 13:07:45 changed by Dirk Datzert <dummy@habmalnefrage.de>

  • attachment MANIFEST.in.diff added.

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

01/20/07 13:11:12 changed by Dirk Datzert <dummy@habmalnefrage.de>

  • attachment MANIFEST.in.2.diff added.

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

01/21/07 15:26:21 changed by Gary Wilson <gary.wilson@gmail.com>

  • attachment 3338.diff added.

combined patch

(follow-up: ↓ 2 ) 01/21/07 15:32:48 changed by Gary Wilson <gary.wilson@gmail.com>

  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • needs_docs changed.

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 ) 01/21/07 15:50:56 changed by Dirk Datzert <dummy@habmalnefrage.de>

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",

01/30/07 23:30:53 changed by Gary Wilson <gary.wilson@gmail.com>

  • 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.

02/11/07 18:33:24 changed 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.

02/11/07 18:35:59 changed by mtredinnick

  • 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.

02/27/07 15:26:00 changed by Gary Wilson <gary.wilson@gmail.com>

  • has_patch deleted.

The hyphen problem has no patch.

02/28/07 03:40:35 changed by mtredinnick

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

Making the title reflect the ticket contents.

04/03/07 07:28:20 changed by mtredinnick

  • status changed from new to closed.
  • resolution set to fixed.

(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.


Add/Change #3338 (build_rpm problems)




Change Properties
Action