.. --*-- rest --*--
.. NB! Keep this document a valid restructured document.

Packaging Scipy
===============

:Author: Pearu Peterson <pearu@cens.ioc.ee>
:Last changed: $Date: 2004/01/04 11:01:04 $
:Revision: $Revision: 1.7 $
:Discussions to: scipy-dev@scipy.org

Introduction
------------

People who have tried to create a distribution of a Scipy package have
been faced with complex dependency issues between ``scipy`` and
``f2py2e`` modules. Namely, both Scipy and F2py tar-balls provide
``scipy_distutils`` module that may have different time stamps, for
instance, not to mention that packaging tools (e.g. debian apt) don't
like such cases at all. Scipy_distutils is part of the Scipy package
while F2py ships ``scipy_distutils`` for the convenience of F2py
users.  So, the issue of distributing Scipy and F2py have been brought
up in Scipy and F2py mailing lists many times and the purpose of this
document is to provide instructions for the packagers how to overcome
this issue.

Any suggestions, especially from the packagers, to improve these
instructions are most welcome. Please, send your comments or patches
to scipy-dev@scipy.org.

Packaging Scipy and friends
---------------------------

Instead of using tar-balls from web, currently it is highly
recommended getting scipy and other software from their CVS
repository. Usually CVS versions are more stable than tar-balls
(sometimes not but any issues will be quickly fixed), also core
developers do not test tar-balls very frequently and occasionally some
important files may be missing.

1. Get Scipy, F2py and their dependencies from CVS::

     export CVSROOT=:pserver:anonymous@scipy.org:/home/cvsroot
     cvs -z7 co scipy

     export CVSROOT=:pserver:anonymous@cens.ioc.ee:/home/cvs
     cvs -z7 co f2py2e

2. Create source tar-balls::

     cd f2py2e
     python setup.py sdist
     cp dist/F2PY-*.tar.gz ..
     cd ..

     cd scipy
     python setup.py sdist
     cp scipy_core/dist/Scipy_core-*.tar.gz ..
     cp dist/SciPy-*.tar.gz ..
     cd ..

   The resulting gzipped tar-files do not contain software overlaps
   anymore and should be suitable for packaging.

3. Install ``scipy_core``, ``f2py2e``, and ``scipy`` strictly in the
   given order. Unpack all tar-ball sources and run::

     cd Scipy_core-*
     python setup.py install
     cd ..

     cd F2PY-*
     python setup.py install
     cd ..

     cd SciPy-*
     python setup.py install
     cd ..

That's it!

RPMs for Scipy and friends
--------------------------

Follow the items 1-2 above and then continue as follows:

3. Create RPMs::

     cd f2py2e
     # run buildhtml.py script provided by docutils to generate
     # HTML documentation of f2py.
     python setup.py bdist_rpm --fix-python
     cp dist/F2PY-*.rpm ..
     cd ..

     cd scipy
     python setup.py bdist_rpm --fix-python
     cp scipy_core/dist/Scipy_core-*.rpm ..
     cp dist/SciPy-*.rpm ..
     cd ..

4. Install RPMs in the usual way but keep the order as in item 4.
