File: rules

package info (click to toggle)
python-f2py 2.45.241%2B1926-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 944 kB
  • ctags: 702
  • sloc: python: 8,720; ansic: 929; fortran: 109; makefile: 61; f90: 34
file content (91 lines) | stat: -rwxr-xr-x 2,487 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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# This file is public domain software, originally written by Joey Hess. 
# Changes for f2py by José Fonseca

# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

PYVERS=2.2 2.3 2.4
BASE=$(shell pwd)/debian

build: build-stamp
build-stamp:
	dh_testdir
	
	# We do the actual compilation in install to avoid cloberring
	
	rest2html docs/usersguide/index.txt > docs/usersguide/index.html
	
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp

	rm -rf build
	find . -name "*.pyc" -exec rm {} \;
	dh_clean

install-ver:
install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs -A

	set -e; for v in $(PYVERS); do                                   \
		d=$(BASE)/python$$v-f2py;                                \
		mkdir -m 755 -p $$d/usr/share/doc/python$$v-f2py;        \
		python$$v setup.py install --prefix $$d/usr --no-compile;\
		python$$v setup.py clean --all;                          \
	done

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs -A docs/HISTORY.txt
	dh_installdocs -A docs/README.txt
	dh_installexamples 
	dh_link
	dh_compress
	dh_fixperms

	# Add man pages
	set -e; for v in $(PYVERS); do                                   \
		d=$(BASE)/python$$v-f2py;                                \
		mkdir -m 755 -p $$d/usr/share/man/man1;                  \
		cp -p f2py.1 $$d/usr/share/man/man1/f2py$$v.1;           \
		gzip -9 $$d/usr/share/man/man1/f2py$$v.1;                \
	done

	# Provide the defaults
	mkdir -m 755 -p debian/python-f2py/usr/bin
	ln -s f2py2.3 debian/python-f2py/usr/bin/f2py
	mkdir -m 755 -p debian/python-f2py/usr/share/man/man1
	ln -s f2py2.3.1.gz debian/python-f2py/usr/share/man/man1/f2py.1.gz

	# Fix executable permissions
	set -e; for i in `find debian -mindepth 2 -type f ! -perm 755`; do \
		if head -1 $$i | grep -q '^#!' ; then                    \
	    		chmod +x $$i;                                    \
		fi ;                                                     \
	done
	
	set -e; for v in $(PYVERS); do                                   \
		dh_python -ppython$$v-f2py -V $(PYVERS);                 \
	done

	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture-dependent files here.
binary-arch: build install
# We have nothing to do by default.

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install