File: rules

package info (click to toggle)
pycxx 5.3.2-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 460 kB
  • ctags: 1,131
  • sloc: cpp: 2,148; makefile: 82; python: 68; sh: 9; ansic: 8
file content (161 lines) | stat: -rwxr-xr-x 4,511 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#!/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.
#
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets  by Bill Allombert 2001

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

# This has to be exported to make some magic below work.
export DH_OPTIONS



CFLAGS = -Wall -g

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

PWD	= $(shell pwd)

p23_cxx	= python2.3-cxx
p24_cxx	= python2.4-cxx

d23_cxx	= debian/$(p23_cxx)
d24_cxx	= debian/$(p24_cxx)

defver	= $(shell /usr/bin/python -c 'import sys; print sys.version[:3]')

#Architecture 
build: build-arch build-indep

build-arch: build-arch-stamp
build-arch-stamp: build-indep-stamp
#	cd Demo && \
#	  CFLAGS="-I$(PWD)" \
#	  SUPPORT_DIR=$(PWD)/Src \
#	  /usr/bin/python2.3 setup.py build --build-base $(PWD)

#	$(MAKE) -f example_common.mak \
#		CCC="g++ -c" \
#		CCCFLAGS="$(CFLAGS) -fPIC -I/usr/include/python2.3 -I." \
#		LDSHARED="g++ -shared" \
#		LDLIBS= \
#		PYTHON=/usr/bin/python2.3
	touch build-arch-stamp

build-indep: build-indep-stamp
build-indep-stamp:
	/usr/bin/python2.3 setup.py build
	/usr/bin/python2.4 setup.py build
#	$(MAKE) doc
	touch build-indep-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-arch-stamp build-indep-stamp
	-$(MAKE) -f example_common.mak clean
	rm -rf build
	rm -rf Demo/build
	dh_clean 

install: install-indep install-arch
install-indep:
	dh_testdir
	dh_testroot
	dh_clean -k -i 
	dh_installdirs -i
	/usr/bin/python2.3 setup.py install --root=$(shell pwd)/$(d23_cxx)
	mkdir -p $(d23_cxx)-dev/usr/share/
	mv $(d23_cxx)/usr/share/python2.3 $(d23_cxx)-dev/usr/share/
	mv $(d23_cxx)/usr/include $(d23_cxx)-dev/usr/

	/usr/bin/python2.4 setup.py install --root=$(shell pwd)/$(d24_cxx)
	mkdir -p $(d24_cxx)-dev/usr/share/
	mv $(d24_cxx)/usr/share/python2.4 $(d24_cxx)-dev/usr/share/
	mv $(d24_cxx)/usr/include $(d24_cxx)-dev/usr/

#	dh_install -i

install-arch:
	dh_testdir
	dh_testroot
#	dh_clean -k -s 
#	dh_installdirs -s
#	cd Demo && \
#	  CFLAGS="-I$(PWD)" \
#	  SUPPORT_DIR=$(PWD)/Src \
#	  /usr/bin/python2.3 setup.py install --root=$(shell pwd)/$(d23_cxx)
#	dh_install -s

# Build architecture independant packages
binary-indep: build-indep install-indep
	dh_testdir
	dh_testroot
	dh_installchangelogs -i

	dh_installdocs -p$(p23_cxx) README.html Doc/PyCXX.html
	cp -p debian/README.Ubuntu $(d23_cxx)/usr/share/doc/$(p23_cxx)

	dh_installdocs -p$(p24_cxx) README.html Doc/PyCXX.html
	cp -p debian/README.Ubuntu $(d24_cxx)/usr/share/doc/$(p24_cxx)

	rm -rf $(d23_cxx)-dev/usr/share/doc/$(p23_cxx)-dev
	ln -sf $(p23_cxx) $(d23_cxx)-dev/usr/share/doc/$(p23_cxx)-dev
	mkdir -p $(d23_cxx)-dev/usr/share/doc/$(p23_cxx)
	cp -a Demo $(d23_cxx)-dev/usr/share/doc/$(p23_cxx)/examples/
	chmod 644 $(d23_cxx)-dev/usr/share/doc/$(p23_cxx)/examples/*.?xx
	rm -rf $(d23_cxx)-dev/usr/share/doc/$(p23_cxx)/examples/build

	rm -rf $(d24_cxx)-dev/usr/share/doc/$(p24_cxx)-dev
	ln -sf $(p24_cxx) $(d24_cxx)-dev/usr/share/doc/$(p24_cxx)-dev
	mkdir -p $(d24_cxx)-dev/usr/share/doc/$(p24_cxx)
	cp -a Demo $(d24_cxx)-dev/usr/share/doc/$(p24_cxx)/examples/
	chmod 644 $(d24_cxx)-dev/usr/share/doc/$(p24_cxx)/examples/*.?xx
	rm -rf $(d24_cxx)-dev/usr/share/doc/$(p24_cxx)/examples/build

	rm -rf debian/python-cxx-dev/usr/share/doc/*
	ln -sf python$(defver)-cxx-dev debian/python-cxx-dev/usr/share/doc/python-cxx-dev

	rm -rf debian/python-cxx/usr/share/doc/*
	ln -sf python$(defver)-cxx debian/python-cxx/usr/share/doc/python-cxx

	dh_compress -i
	dh_fixperms -i
	dh_python -i -n -Npython-cxx -Npython-cxx-dev
	dh_python -i -n -V $(defver) -ppython-cxx -ppython-cxx-dev
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture dependant packages
binary-arch: build-arch install-arch
#	dh_testdir
#	dh_testroot
#	dh_installchangelogs -a
#	dh_installdocs -a
#	dh_installexamples -a
#	dh_strip -a
#	dh_compress -a 
#	dh_fixperms -a
#	dh_python -a
#	dh_installdeb -a
#	dh_shlibdeps -a
#	dh_gencontrol -a
#	dh_md5sums -a
#	dh_builddeb -a

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