I just finished packaging scipy (www.scipy.org). Scipy uses a pretty
complicated setup.py file that manages running f2py, compiling f77
code, compiling several helper modules (including a patched copy of
Numeric), etc.
Most of the python modules I have seen packaged for debian use a
makefile rather than setup.py. I really don't want to rewrite the
complicated build logic into a makefile.
What is the best way to use the setup.py in the debian/rules?
Here are some fragments from the debian/rules file I have so far. It
seems to work, but any suggestions would be appreciated.
- JMR
configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
touch configure-stamp
build: configure-stamp build-stamp
build-stamp:
dh_testdir
# Add here commands to compile the package.
python setup.py build
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp
# Add here commands to clean up after the build process.
-python setup.py clean
-rm -rf build
-rm -rf dist
-rm *.pyc *.pyo */*.pyc */*.pyo
dh_clean -Xincluded_functions.html.orig
install: build
dh_testdir
dh_testroot
dh_clean -k -Xincluded_functions.html.orig
dh_installdirs
# Add here commands to install the package into debian/scipy.
-mkdir debian/scipy
-python setup.py bdist
cd debian/scipy && tar zxvf ../../dist/SciPy-0.2.0.linux-*.tar.gz
--
Joseph M. Reinhardt, Ph.D. Department of Biomedical Engineering
joe-re...@uiowa.edu University of Iowa, Iowa City, IA 52242
Telephone: 319-335-5634 FAX: 319-335-5631
--
To UNSUBSCRIBE, email to debian-pyt...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
The install command takes a --prefix argument. That might be cleaner
than using bdist.
Neil
--
Misha
On Mon, Dec 17, 2001 at 08:14:46PM -0600, Joe Reinhardt wrote:
> What is the best way to use the setup.py in the debian/rules?
Added lines marked with "+++"
+++ PYTHON=python2.1
+++ PACKAGE=scipy
> configure: configure-stamp
> configure-stamp:
> dh_testdir
> # Add here commands to configure the package.
+++ $(PYTHON) setup.py configure
> touch configure-stamp
>
> build: configure-stamp build-stamp
> build-stamp:
> dh_testdir
>
> # Add here commands to compile the package.
+++ $(PYTHON) setup.py build
> touch build-stamp
>
> clean:
> dh_testdir
> dh_testroot
> rm -f build-stamp configure-stamp
>
> # Add here commands to clean up after the build process.
+++ Distutils choke on dangling symlinks, which are sometimes
+++ generated (eg. by dh_undocumented).
+++ So if you use dh_undocumented, remove the symlink hardcoded
+++ at this point.
+++ -$(PYTHON) setup.py clean --all
+++ You should not need the next three lines, or the above line
+++ forgot to clean some files, which is a setup.py error.
> -rm -rf build
> -rm -rf dist
> -rm *.pyc *.pyo */*.pyc */*.pyo
>
> dh_clean -Xincluded_functions.html.orig
>
> install: build
> dh_testdir
> dh_testroot
> dh_clean -k -Xincluded_functions.html.orig
> dh_installdirs
>
> # Add here commands to install the package into debian/scipy.
+++ $(PYTHON) setup.py install --root=$(CURDIR)/debian/$(PACKAGE) --no-compi
le
+++ move around files into proper directories (examples, CGI scripts,
+++ binaries...)
For the rest, have a look at the linkchecker package.
Greetings, Bastian