File: rules

package info (click to toggle)
python3-stdlib-extensions 3.2.3-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 220 kB
  • sloc: ansic: 3,148; python: 586; makefile: 93
file content (124 lines) | stat: -rwxr-xr-x 3,672 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/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}'))

PYVERS	= $(shell py3versions -vs)
#PYVERS	= 3.2

CFLAGS = -Wall -g

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

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

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

build-python%:
	dh_testdir
	ln -sf /usr/lib/libBLT.2.4.so.8.5 $*/libBLT85.so
	ln -sf /usr/lib/libBLT.2.4.so.8.5 $*/libBLT85.so.8.5
	cd $* && python$* setup.py build
	touch build$*-stamp

dbg-build-stamp%:
	dh_testdir
	ln -sf /usr/lib/libBLT.2.4.so.8.5 $*/libBLT85.so
	ln -sf /usr/lib/libBLT.2.4.so.8.5 $*/libBLT85.so.8.5
	cd $* && python$*-dbg setup.py build
	touch dbg-build$*-stamp

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

install: build install-prereq $(PYVERS:%=install-python%) $(PYVERS:%=dbg-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 \
		--root=$(CURDIR)/$(d_tk) --install-layout=deb
	mkdir -p $(d_tk)/usr/lib/python$*/lib-dynload
	mv $(d_tk)/usr/lib/python3/*-packages/_tkinter*.so \
		$(d_tk)/usr/lib/python$*/lib-dynload/
	mkdir -p $(d_gdbm)/usr/lib/python$*/lib-dynload
	mv $(d_tk)/usr/lib/python3/*-packages/_gdbm*.so \
		$(d_gdbm)/usr/lib/python$*/lib-dynload/
	rm -rf $(d_tk)/usr/lib/python3/*-packages

dbg-install-python%:
	cd $* && python$*-dbg setup.py install \
		--root=$(CURDIR)/$(d_tk)-dbg --install-layout=deb
	mkdir -p $(d_tk)-dbg/usr/lib/python$*/lib-dynload
	mv $(d_tk)-dbg/usr/lib/python3/*-packages/_tkinter*.so \
		$(d_tk)-dbg/usr/lib/python$*/lib-dynload/
	mkdir -p $(d_gdbm)-dbg/usr/lib/python$*/lib-dynload
	mv $(d_tk)-dbg/usr/lib/python3/*-packages/_gdbm*.so \
		$(d_gdbm)-dbg/usr/lib/python$*/lib-dynload/
	rm -rf $(d_tk)-dbg/usr/lib/python3/*-packages

# 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
	rm -rf $(d_gdbm)-dbg/usr/share/doc/$(p_gdbm)-dbg
	ln -s $(p_gdbm) $(d_gdbm)-dbg/usr/share/doc/$(p_gdbm)-dbg
	rm -rf $(d_tk)-dbg/usr/share/doc/$(p_tk)-dbg
	ln -s $(p_tk) $(d_tk)-dbg/usr/share/doc/$(p_tk)-dbg
	dh_strip -p$(p_gdbm) --dbg-package=$(p_gdbm)-dbg
	dh_strip -p$(p_tk) --dbg-package=$(p_tk)-dbg
	( \
	  echo 'python3:Depends=python3 (>= 3.2), python3 (<< 3.3)'; \
	  echo 'python3:Versions=3.2'; \
	  echo 'python3:Provides=python3.2-gdbm'; \
	) >> debian/python3-gdbm.substvars
	( \
	  echo 'python3:Depends=python3 (>= 3.2), python3 (<< 3.3)'; \
	  echo 'python3:Versions=3.2'; \
	  echo 'python3:Provides=python3.2-tk'; \
	) >> debian/python3-tk.substvars
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

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