File: rules

package info (click to toggle)
python-event 0.3%2Bsvn60-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 492 kB
  • ctags: 677
  • sloc: python: 159; makefile: 88
file content (86 lines) | stat: -rwxr-xr-x 2,340 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
#!/usr/bin/make -f 
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
include /usr/share/dpatch/dpatch.make

PYVERS=$(shell pyversions -vr)

PACKAGE = python-event
URL:=http://pyevent.googlecode.com/svn/trunk/
SRC_VERSION := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p')
SVN_REVISION := $(shell echo $(SRC_VERSION) | awk -F"+" '{ print $$2 }' | sed 's/svn//' )
TARBALL = $(PACKAGE)_$(SRC_VERSION).orig.tar.gz

clean: unpatch
	dh_testdir
	
#	for python in $(PYVERS); do 
	python$* setup.py clean; 
#	done
	
	rm -f build-stamp
	rm -f *.pyc *.pyo
	
	dh_clean install-stamp build-stamp \
                $(PYVERS:%=install-python%) $(PYVERS:%=build-python%) \
                $(PYVERS:%=install-debug-python%) $(PYVERS:%=build-debug-python%)

install: $(PYVERS:%=install-python%) $(PYVERS:%=install-debug-python%)

install-python%: build
	python$* setup.py install --prefix=/usr \
		--skip-build --root=$(CURDIR)/debian/python-event;
	touch $@

install-debug-python%: build
	python$*-dbg setup.py install --prefix=/usr \
		--skip-build --root=$(CURDIR)/debian/python-event-dbg/
	find $(CURDIR)/debian/python-event-dbg/usr/lib/python$*/ ! -type d ! -name '*_d\.so' -delete
	find $(CURDIR)/debian/python-event-dbg/usr/lib/python$*/ -depth -empty -delete
	touch $@

build: build-stamp

build-stamp: patch-stamp $(PYVERS:%=build-python%) $(PYVERS:%=build-debug-python%)
	touch $@
	touch patch-stamp

build-python%:
	python$* setup.py build
	touch $@

build-debug-python%:
	python$*-dbg setup.py build
	touch $@

binary-indep: build

binary-arch: install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs README
	dh_pysupport
	dh_compress
	dh_strip
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

get-orig-source:
	@@dh_testdir
	@@rm -rf $(TARBALL)
	@@mkdir get-orig-source
	@@svn export -r $(SVN_REVISION) $(URL) \
	       get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig
	@@echo Cleaning up ...
	@@rm -rf get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig/pyevent
	@@GZIP=--best tar czf $(TARBALL) -C get-orig-source $(PACKAGE)-$(SRC_VERSION).orig
	@@rm -rf get-orig-source
	@@echo "  "$(TARBALL)" created; move it to the right destination to build the package"

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