File: rules

package info (click to toggle)
python-stdlib-extensions 2.4.4-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 480 kB
  • ctags: 875
  • sloc: ansic: 8,958; python: 1,186; makefile: 61
file content (93 lines) | stat: -rwxr-xr-x 2,429 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
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

#rel_ext	= $(strip $(shell dpkg-parsechangelog | awk -F- '/^Version:/ {print $$NF}'))
#pkgver	= 2.4.3-$(shell expr $(rel_ext) + 0)
#pkgver	= 2.4.3-3ubuntu1

PYVERS	= $(sort $(shell pyversions -vs) 2.5)
PWD	:= $(shell pwd)

CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

p_tk	= python-tk
p_gdbm	= python-gdbm
d_tk	= debian/$(p_tk)
d_gdbm	= debian/$(p_gdbm)

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

build-python%:
	dh_testdir
	cd $* && python$* setup.py build
	touch build$*-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f *stamp
	rm -rf 2.?/build
	dh_clean 

install: build install-prereq $(PYVERS:%=install-python%)
	rm -rf $(d_tk)/usr/share/pycentral
	rm -rf $(d_gdbm)/usr/share/pycentral

install-prereq:
	dh_testdir
	dh_testroot
	dh_clean -k 

install-python%: build%-stamp
	cd $* && python$* setup.py install --prefix=$(PWD)/$(d_tk)/usr
	mkdir -p $(d_tk)/usr/lib/python$*/lib-dynload
	mv $(d_tk)/usr/lib/python$*/site-packages/_tkinter.so \
		$(d_tk)/usr/lib/python$*/lib-dynload/
	mkdir -p $(d_gdbm)/usr/lib/python$*/lib-dynload
	mv $(d_tk)/usr/lib/python$*/site-packages/gdbm.so \
		$(d_gdbm)/usr/lib/python$*/lib-dynload/
	rm -rf $(d_tk)/usr/lib/python$*/site-packages
#	cp -a $*/Lib/lib-tk $(d_tk)/usr/lib/python$*/

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

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_installdocs -p$(p_gdbm) debian/README.Debian
	dh_installdocs -p$(p_tk) debian/README.Tk
	dh_strip
	DH_PYCENTRAL=nomove dh_pycentral
	dh_python
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	sed -i -e 's/<< 2.5/<< 2.6/;s/python2.5 [^,]*//;s/, *,/,/;s/, *$$//' debian/*.substvars
#	dh_gencontrol -u-v$(pkgver)
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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