DeWitt wrote:
> Hi,
>
> I am wondering if anyone has successfully used "setup.py bdist_rpm" to
> create a Django RPM.
>
> I have tried using both the 0.95 release and the SVN head release, but
> in both cases the RPM build process fails on RedHat Fedora Core 5,
> seemingly on the bytecompiled .pyo files.
>
> Does anyone have any experience with this?

Well, no experience with bdist_rpm as such,
but we do build our own django rpm's as follows:

$ svn co http://code.djangoproject.com/svn/django/trunk django
$ (cd django && svn2cl)
$ ln -sf django django-0.95
$ tar jchf django-0.95.tar.bz2 --exclude=.svn django-0.95
$ install -d -m 0775 rpmbld
$ rpmbuild --quiet -ba django.spec

Using the rpm spec file below.
We build and use our rpm's mostly on SuSE Linux 10.1
these days, but I don't think that there's anything
in there that is platform specific, so it should work
just fine on fedora 5 as well. If not, let me know.

Hope this helps
/Lars

--- Begin Included File: django.spec ---

%define _topdir    %(pwd)/rpmbld
%define _sourcedir %_topdir/..
%define _specdir   %_sourcedir
%define _tmppath   %_topdir
%define _builddir  %_topdir
%define _rpmdir    %_sourcedir
%define _srcrpmdir %_rpmdir

Name:          python-django
Version:       0.95
Release:       3903
License:       GPL
Distribution:  (none)
Vendor:        LinAdd AB
Packager:      Lars Stavholm <[EMAIL PROTECTED]>
Buildarch:     noarch
Group:         Web Development Tools
Summary:       Web application development framework by means of Python
URL:           http://djangoproject.org
Prefix:        /usr
BuildRoot:     %(pwd)/rpmbld/buildroot-%name-%version

Source0:       django-%version.tar.bz2

Requires:      python          >= 2.3
Requires:      python-docutils >  0.4
Requires:      python-mysql    >= 1.2.0
Requires:      python-sqlite   >= 1.1.6

BuildRequires: python-devel    >= 2.3

AutoReq:       0

Provides:      django = %version

%description
django is a high-level Python Web framework that encourages rapid
development and clean, pragmatic design. Developed and used over the
past two years by a fast-moving online-news operation, django was
designed from scratch to handle two challenges: the intensive deadlines
of a newsroom and the stringent requirements of experienced Web
developers.
It has convenient niceties for developing content-management systems,
but it's an excellent tool for building any Web site. django focuses
on automating as much as possible and adhering to the DRY (Dont Repeat
Yourself) principle.

%prep
%setup -q -n django-%version

%build

%install
mkdir -p %buildroot%_libdir/python/site-packages %buildroot%_bindir
cp -rp django %buildroot%_libdir/python/site-packages/
install -m 0755 django/bin/django-admin.py %buildroot%_bindir/
cd %buildroot%_bindir
ln -s django-admin.py django-admin

%clean
rm -rf %buildroot

%pre

pylib=`python -c "import os, atexit; print
os.path.dirname(atexit.__file__)"`
[ -d /usr/lib/python ] || ln -s $pylib /usr/lib/python

%post

%preun
%postun

# package is being updated...
[ $1 -eq 1 ] && \
  find %_libdir/python/site-packages/django -follow -name '*.pyc' | \
    xargs -r rm

# package is truly being removed (i.e. not updated)...
[ $1 -eq 0 ] && rm -rf %_libdir/python/site-packages/django

exit 0

%files
%defattr(-, root, root, -)
%doc docs INSTALL LICENSE README ChangeLog $(pwd)/../../*.pdf
%_bindir/*
%_libdir/python/site-packages/django

%changelog

--- End Included File: django.spec ---


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to