File: rules

package info (click to toggle)
python-numpy 1%3A1.1.0-3%2Blenny1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 9,548 kB
  • ctags: 14,321
  • sloc: ansic: 73,119; python: 59,655; cpp: 822; makefile: 179; fortran: 121; f90: 42
file content (95 lines) | stat: -rwxr-xr-x 3,671 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/make -f
# Sample debian/rules that uses cdbs.  Originaly written by Robert Millan.
# This file is public domain.

DEB_AUTO_CLEANUP_RCS            := yes

DEB_PYTHON_SYSTEM=pycentral
PYVERS=$(shell pyversions -vr debian/control)

DEB_MAKE_CLEAN_TARGET    := clean
DEB_DH_INSTALL_SOURCEDIR := debian/tmp

DEB_DESTDIR=$(CURDIR)/debian/tmp

DEB_INSTALL_MANPAGES_python-f2py  := numpy/f2py/f2py.1
DEB_INSTALL_DOCS_python-numpy := DEV_README.txt THANKS.txt

DEB_PYTHON_PACKAGES_EXCLUDE=python-numpy-dbg

unexport LDFLAGS

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk
include /usr/share/cdbs/1/rules/simple-patchsys.mk

clean::
	-rm -rf `find -name build -type d`
	-rm -rf `find . -name "*.pyc" -type f`

install/python-numpy::
	: # Adding documentation
	install -d $(CURDIR)/debian/python-numpy/usr/share/doc/python-numpy
	cp -r $(DEB_DESTDIR)/usr/lib/python$(cdbs_python_current_version)/site-packages/numpy/doc/* \
		$(CURDIR)/debian/python-numpy/usr/share/doc/python-numpy/
	cp $(DEB_DESTDIR)/usr/lib/python$(cdbs_python_current_version)/site-packages/numpy/doc/README.txt \
		$(CURDIR)/debian/python-numpy/usr/share/doc/python-numpy/README.doc.txt

	: # Adding links to manpages
	mkdir -p debian/python-numpy/usr/share/man/man1
	for v in $(PYVERS); do \
	  ln -sf f2py.1 debian/python-numpy/usr/share/man/man1/f2py$$v.1; \
	  ln -sf f2py.1 debian/python-numpy/usr/share/man/man1/f2py$$v-dbg.1; \
	done

	: # Add unversioned numpy script
	mv $(DEB_DESTDIR)/usr/bin/f2py $(DEB_DESTDIR)/usr/bin/f2py$(cdbs_python_current_version)
	ln -s f2py$(cdbs_python_current_version) debian/python-numpy/usr/bin/f2py

	: # Make Python scripts executable
	for i in `find debian/tmp -type f`; do \
	  sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python\1,' \
		$$i > $$i.temp; \
	  if cmp --quiet $$i $$i.temp; then \
	    rm -f $$i.temp; \
	  else \
	    mv -f $$i.temp $$i; \
	    chmod 755 $$i; \
	    echo "fixed interpreter: $$i"; \
	  fi; \
	done
	for i in $(cdbs_python_build_versions); do \
	[ -d $(CURDIR)/debian/python-numpy/usr/include/python$$i ] || \
		mkdir -p $(CURDIR)/debian/python-numpy/usr/include/python$$i; \
		dh_link usr/share/pyshared/numpy/core/include/numpy usr/include/python$$i/numpy; \
	done
	for i in $(cdbs_python_build_versions); do \
	[ -d $(CURDIR)/debian/python-numpy/usr/include/python$${i}_d ] || \
		mkdir -p $(CURDIR)/debian/python-numpy/usr/include/python$${i}_d; \
		dh_link usr/share/pyshared/numpy/core/include/numpy usr/include/python$${i}_d/numpy; \
	done

binary-install/python-numpy-doc::
	cp -r $(CURDIR)/numpy/doc/html/* $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)
	mkdir $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/f2py
	rst2html numpy/f2py/docs/usersguide/index.txt > $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/f2py/index.html
	cp -r $(CURDIR)/numpy/f2py/docs/* $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/f2py
	chmod -x $(CURDIR)/debian/$(cdbs_curpkg)/usr/share/doc/$(cdbs_curpkg)/f2py/usersguide/setup_example.py

build/python-numpy-dbg::
	set -e; \
	for i in $(cdbs_python_build_versions); do \
	  python$$i-dbg ./setup.py build; \
	done

install/python-numpy-dbg::
	for i in $(cdbs_python_build_versions); do \
	  python$$i-dbg ./setup.py install --root $(CURDIR)/debian/python-numpy-dbg; \
	done
	find debian/python-numpy-dbg \
		! -type d ! -name '*_d.so' | xargs rm -f
	find debian/python-numpy-dbg -depth -empty -exec rmdir {} \;

binary-predeb/python-numpy-dbg::
	rm -rf debian/python-numpy-dbg/usr/share/doc/python-numpy-dbg
	ln -s python-numpy debian/python-numpy-dbg/usr/share/doc/python-numpy-dbg