File: rules

package info (click to toggle)
newt 0.52.2-10%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 836 kB
  • ctags: 27
  • sloc: makefile: 186; sh: 5
file content (239 lines) | stat: -rwxr-xr-x 6,872 bytes parent folder | download | duplicates (2)
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
#!/usr/bin/make -f
#
# Created 20 December 1997 by Enrique Zanardi <ezanardi@ull.es>
# Modified 2002-2004 by Alastair McKinstry, <mckinstry@debian.org>
#
# Copying and modification is unlimited, provided that the modified
# version is marked as being modified.

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

DEB_BUILD_GNU_SYSTEM = $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
DEB_BUILD_GNU_CPU = $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)

VERSION=0.52.2
SONAME=0.52
PYVERS=$(shell pyversions -vr debian/control)

LIB_PKG=libnewt$(SONAME)
DEV_PKG=libnewt-dev
PIC_PKG=libnewt-pic
TCL_PKG=newt-tcl
PYTHON_PKG=python-newt
WHIPTAIL_PKG=whiptail

# This is the debhelper compatability version to use.
export DH_COMPAT=5

# the dbs rules
TAR_DIR=newt-$(VERSION)
include /usr/share/dbs/dbs-build.mk

ifeq (,$(DEB_BUILD_GNU_TYPE))
 include /usr/share/dbs/dpkg-arch.mk
endif
ARCH=$(shell dpkg --print-architecture)

# get the items created here.
binarytarget=binary-devel binary-shared binary-runtime binary-tcl \
	binary-python binary-pic 

#target specific configurations come here:
LIBCDEV=libc-dev
GPMSUPPORT=

ifeq ($(DEB_BUILD_GNU_SYSTEM),linux)
GPMSUPPORT= --with-gpm-support
LIBCDEV=libc6-dev
ifeq ($(DEB_BUILD_GNU_CPU),alpha)
LIBCDEV=libc6.1-dev
endif
ifeq ($(DEB_BUILD_GNU_CPU),ia64)
LIBCDEV=libc6.1-dev
endif
endif

ifeq ($(DEB_BUILD_GNU_SYSTEM),gnu)
LIBCDEV=libc0.3-dev
endif

ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
NOSTRIP=--with-nostrip=no
else
NOSTRIP=--with-nostrip=yes
endif

build-stamp=$(STAMP_DIR)/build-stamp
configure-stamp=$(STAMP_DIR)/configure-stamp

$(configure-stamp):  $(patched)
	dh_testdir
	cp newt.spec $(BUILD_TREE)
	rm -f $(BUILD_TREE)/.depend
	( cd $(BUILD_TREE) && autoconf --force -i )
	( cd $(BUILD_TREE) && ./configure $(GPMSUPPORT) $(NOSTRIP) )
	touch $@

build: $(build-stamp)
$(build-stamp): $(configure-stamp)
	dh_testdir
	( cd $(BUILD_TREE) && sgmltools --backend html tutorial.sgml )
	$(MAKE) -C $(BUILD_TREE)
	( cd $(BUILD_TREE) && ar cqv libnewt_pic.a shared/*.o )
	# build POT file for translators
	make -C $(BUILD_TREE)/po newt.pot
	touch $@

clean:
	dh_testdir
	dh_testroot
	dh_clean 
	rm -rf $(SOURCE_DIR) $(STAMP_DIR)
	rm -f debian/python-newt.dirs debian/python-newt.install debian/python-newt.postinst
	# rm -rf   debian/substvars debian/*.bak debian/*~ *~ 

binary: binary-indep binary-arch

binary-indep:

binary-arch: $(LIB_PKG) $(DEV_PKG) $(PIC_PKG) $(TCL_PKG) $(PYTHON_PKG) $(WHIPTAIL_PKG)

$(LIB_PKG): build
	dh_testdir
	dh_testroot 
	dh_installdirs -p $@ 
	dh_install -p $@ --sourcedir=$(BUILD_TREE)
	chmod +x $(BUILD_TREE)/mkinstalldirs
	$(MAKE) -C $(BUILD_TREE)/po prefix=/usr  \
		DESTDIR=../../../debian/$@ HAVE_XGETTEXT=yes install
	dh_strip -p $@
	dh_makeshlibs -p $@
	dh_shlibdeps -L $(LIB_PKG) -l debian/$@/usr/lib
	dh_installdocs -p $@  -p $@ $(BUILD_TREE)/newt.spec
	dh_link -p $@  /usr/lib/libnewt.so.$(VERSION) /usr/lib/libnewt.so.$(SONAME)
	rm debian/$@/usr/lib/libnewt.so
	# Currently disabled, as debian-test has been removed.
	# chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh
	dh_installchangelogs -p $@ 
	dh_compress -p $@
	dh_installdeb  -p $@
	dh_fixperms -p $@
	dh_gencontrol -p $@ 
	dh_md5sums -p $@
	dh_builddeb -p $@

$(PIC_PKG): build
	dh_testdir
	dh_testroot 
	dh_installdirs -p $@
	dh_install -p $@ --sourcedir=$(BUILD_TREE)
	dh_strip -p $@
	dh_makeshlibs -p $@
	dh_installdocs -p $@  -p $@ $(BUILD_TREE)/newt.spec
	# Currently disabled, as debian-test has been removed.
	# chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh
	dh_installchangelogs -p $@ 
	dh_compress -p $@
	dh_shlibdeps -p $@  -ldebian/$@/usr/lib
	dh_fixperms -p $@
	dh_installdeb  -p $@
	dh_gencontrol -p $@ 
	dh_md5sums -p $@
	dh_builddeb -p $@

$(DEV_PKG): build
	dh_testdir
	dh_testroot 
	dh_installdirs -p $@
	dh_install -p $@ --sourcedir=$(BUILD_TREE)
	dh_strip -p $@
	dh_makeshlibs -p $@
	dh_installdocs -p $@  -p $@ $(BUILD_TREE)/newt.spec
	dh_link -p $@ /usr/lib/libnewt.so.$(VERSION) /usr/lib/libnewt.so
	dh_link -p $@ \
	  /usr/share/doc/libnewt-dev/tutorial.html/t1.html \
	  /usr/share/doc/libnewt-dev/tutorial.html/index.html	
	# Currently disabled, as debian-test has been removed.
	# chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh
	dh_installchangelogs -p $@
	dh_installexamples -p $@ 
	dh_compress -p $@
	dh_shlibdeps -p $@ -ldebian/$@/usr/lib
	dh_fixperms -p $@
	dh_installdeb  -p $@
	dh_gencontrol -p $@ 
	dh_md5sums -p $@
	dh_builddeb -p $@

$(TCL_PKG): build
	dh_testdir
	dh_testroot 
	dh_installdirs -p $@
	dh_install -p $@ --sourcedir=$(BUILD_TREE)
	dh_strip -p $@
	dh_makeshlibs -p $@
	dh_installdocs -p $@  -p $@ $(BUILD_TREE)/newt.spec
	# Currently disabled, as debian-test has been removed.
	# chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh
	dh_installchangelogs -p $@ 
	dh_compress -p $@
	dh_shlibdeps -p $@ -ldebian/$@/usr/lib
	dh_fixperms -p $@
	dh_installdeb  -p $@
	dh_gencontrol -p $@ 
	dh_md5sums -p $@
	dh_builddeb -p $@

$(PYTHON_PKG): build
	dh_testdir
	dh_testroot 
	for v in $(PYVERS); do \
		echo usr/lib/python$$v/site-packages >> debian/$@.dirs; \
		echo python$$v/_snackmodule.so usr/lib/python$$v/site-packages \
		>> debian/$@.install; \
		echo snack.py usr/lib/python$$v/site-packages \
		>> debian/$@.install; \
	done
	dh_installdirs -p $@ 
	dh_install -p $@ --sourcedir=$(BUILD_TREE)
	dh_strip -p $@
	dh_makeshlibs -p $@
	dh_link -p $@ usr/lib/python2.4/site-packages/snack.py usr/lib/python2.3/site-packages/snack.py
	dh_link -p $@ usr/lib/python2.4/site-packages/_snackmodule.so usr/lib/python2.3/site-packages/_snackmodule.so
	dh_python -p $@
	DH_PYCENTRAL=nomove dh_pycentral -p $@
	dh_installdocs -p $@  -p $@ $(BUILD_TREE)/newt.spec
	# Currently disabled, as debian-test has been removed.
	# chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh
	dh_installchangelogs -p $@ 
	dh_installexamples -p $@
	dh_compress -p $@
	dh_shlibdeps -p $@ -ldebian/$@/usr/lib
	dh_fixperms -p $@
	dh_installdeb  -p $@
	dh_gencontrol -p $@ 
	dh_md5sums -p $@
	dh_builddeb -p $@

$(WHIPTAIL_PKG): build
	dh_testdir
	dh_testroot 
	dh_installdirs -p $@
	dh_install -p $@ --sourcedir=$(BUILD_TREE)
	dh_strip -p $@
	dh_makeshlibs   -V
	dh_installdocs -p $@  -p $@ $(BUILD_TREE)/newt.spec debian/README.whiptail
	dh_installman -p $@ $(BUILD_TREE)/whiptail.1
	# Currently disabled, as debian-test has been removed.
	# chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh
	dh_installchangelogs -p $@
	dh_compress -p $@
	dh_shlibdeps -p $@  -L $(LIB_PKG) -l debian/$(LIB_PKG)/usr/lib
	dh_fixperms -p $@
	dh_installdeb  -p $@
	dh_gencontrol -p $@ 
	dh_md5sums -p $@
	dh_builddeb -p $@

.PHONY: binary-arch clean source diff  binary binary-indep