File: rules

package info (click to toggle)
python-gammu 0.26-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 648 kB
  • ctags: 643
  • sloc: ansic: 9,254; python: 1,770; makefile: 77; sh: 8
file content (89 lines) | stat: -rwxr-xr-x 2,028 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
#!/usr/bin/make -f

#export DH_VERBOSE=1

PYVERSIONS=$(shell pyversions -r)
# default is first version
DEFAULTPY=$(shell pyversions -d -v)

build: build-stamp

build-stamp:
	dh_testdir
	# Build normal modules
	set -e; \
	for python in $(PYVERSIONS) ; do \
		$$python setup.py build ; \
	done
	# Build documentation
	set -e; \
	cd build/lib*$(DEFAULTPY) ; \
		epydoc --verbose --name python-gammu --url http://cihar.com/gammu/python/ gammu gammu.Core ; \
		mv html ../../ ; \
		rm gammu/*.pyc
	# Build debug modules
	set -e; \
	for python in $(PYVERSIONS) ; do \
		$$python-dbg setup.py build ; \
	done
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	rm -rf build
	rm -rf html
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	# Install normal modules
	set -e; \
	for python in $(PYVERSIONS) ; do \
		PYTMP="debian/python-gammu" ; \
		$$python setup.py install --no-compile --root=$$PYTMP ; \
	done
	# Install debug modules
	set -e; \
	for python in $(PYVERSIONS) ; do \
		PYTMP="debian/python-gammu-dbg" ; \
		$$python-dbg setup.py install --no-compile --root=$$PYTMP ; \
		find $$PYTMP \( -name '*.py' -o -name '*.egg-info' \) -print0 | xargs -0 rm ; \
	done


# Used by later rules in another make process
binary-common:
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs
	dh_installexamples 
ifeq (,$(findstring -a, $(DH_OPTIONS)))
	DH_OPTIONS= dh_strip -ppython-gammu --dbg-package=python-gammu-dbg
	rm -rf debian/python-gammu-dbg/usr/share/doc/python-gammu-dbg
	mkdir -p debian/python-gammu-dbg/usr/share/doc
	ln -s python-gammu debian/python-gammu-dbg/usr/share/doc/python-gammu-dbg
endif
	dh_pycentral
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-indep: install
	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
	
binary-arch: install
	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common

binary: binary-indep binary-arch

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