File: rules

package info (click to toggle)
twisted-runner 0.2.0-1.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 96 kB
  • ctags: 107
  • sloc: python: 437; makefile: 94; ansic: 37
file content (110 lines) | stat: -rwxr-xr-x 2,798 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#! /usr/bin/make -f

SHELL = /bin/bash

# all versions
PYVERS	:= $(shell pyversions -vs)
VER	:= $(shell /usr/bin/python -c 'import sys; print sys.version[:3]')

build: build-stamp
build-stamp: $(PYVERS:%=build-python%)
	touch $@
build-python%:
	python$* setup.py build
	touch $@

clean:
	rm -rf *-stamp build-python* build
	rm -rf $(addprefix debian/,$(packages)) debian/files debian/substvars
	rm -rf _trial_temp test.log
	find . -name "*.pyc" |xargs -r rm
	dh_clean

install: build-stamp install-prereq $(PYVERS:%=install-python%) install-nover

install-prereq: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -k

install-python%: install-prereq
	: # python-twisted-runner
	python$* setup.py install --prefix=debian/python-twisted-runner/usr
	-find debian/python-twisted-runner -name '*.py[co]' | xargs rm -f

ifeq (0,1)
	for i in debian/python$*-twisted-runner/usr/bin/*; do \
	  mv $$i $${i}$*; \
	done
	mkdir -p debian/python$*-twisted-runner/usr/share/man/man1
	for i in doc/man/*.1; do \
	  iv=`basename $$i .1`$*.1; \
	  cp -p $$i debian/python$*-twisted-runner/usr/share/man/man1/$$iv; \
	done
endif

	: # Replace all '#!' calls to python with python
	: # and make them executable
	for i in `find debian/python-twisted-* -mindepth 3 -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

install-nover:
ifeq (0,1)
	: # python-twisted-runner
	mkdir -p debian/python-twisted-runner/usr/bin
	for i in debian/python$(VER)-twisted-runner/usr/bin/*; do \
	  iv=`basename $$i $(VER)`; \
	  ln -sf $${iv}$(VER) debian/python-twisted-runner/usr/bin/$$iv; \
	done
	mkdir -p debian/python-twisted-runner/usr/share/man/man1
	for i in debian/python$(VER)-twisted-runner/usr/share/man/man1/*; do \
	  iv=`basename $$i $(VER).1`; \
	  ln -sf $${iv}$(VER).1.gz \
	    debian/python-twisted-runner/usr/share/man/man1/$$iv.1.gz; \
	done
endif

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs -i
	dh_installdocs -i -A NEWS README
#	dh_installdocs -ppython-twisted-runner doc/examples doc/howto
	dh_installmenu -i
	dh_compress -i -X.py
	dh_fixperms -i
	dh_pycentral -i
	dh_python -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs -a -A NEWS README
	dh_installdocs -a
	dh_installmenu -a
	dh_strip -a
	dh_compress -a -X.py
	dh_fixperms -a
	dh_pycentral -a
	dh_python -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

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