3
3
# Created 20 December 1997 by Enrique Zanardi <ezanardi@ull.es>
4
# Modified 2002-2004 by Alastair McKinstry, <mckinstry@debian.org>
5
6
# Copying and modification is unlimited, provided that the modified
6
7
# version is marked as being modified.
8
ARCH = $(shell dpkg --print-gnu-build-architecture)
9
# Uncomment this to turn on verbose mode.
12
DEB_BUILD_GNU_SYSTEM = $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
13
DEB_BUILD_GNU_CPU = $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
19
LIB_PKG=libnewt$(SONAME)
23
PYTHON_PKG=python-newt
26
# This is the debhelper compatability version to use.
31
include /usr/share/dbs/dbs-build.mk
33
ifeq (,$(DEB_BUILD_GNU_TYPE))
34
include /usr/share/dbs/dpkg-arch.mk
36
ARCH=$(shell dpkg --print-architecture)
18
38
# get the items created here.
19
ifeq (newt,$(NEWT_TARGET))
21
PACKAGEdev=libnewt-dev
22
buildtarget=build-nonutf8-stamp
23
39
binarytarget=binary-devel binary-shared binary-runtime binary-tcl \
24
40
binary-python binary-pic
25
export BUILDINGUTF8=false
27
PACKAGErun=whiptail-utf8
28
PACKAGEdev=libnewt-utf8-dev
29
buildtarget=build-utf8-stamp
30
binarytarget=binary-shared-utf8 \
34
export BUILDINGUTF8=true
40
PACKAGEpyt=python-newt
42
PACKAGEpic=libnewt-pic
43
PACKAGEutf8shd=libnewt-utf8-0
44
PACKAGEutf8pic=libnewt-utf8-pic
46
tmpshd = $(shell pwd)/debian/tmp-shd
47
tmpdev = $(shell pwd)/debian/tmp-dev
48
tmppyt = $(shell pwd)/debian/tmp-pyt
49
tmptcl = $(shell pwd)/debian/tmp-tcl
50
tmprun = $(shell pwd)/debian/tmp-run
51
tmppic = $(shell pwd)/debian/tmp-pic
52
tmputf8shd = $(shell pwd)/debian/tmp-utf8shd
53
tmputf8pic = $(shell pwd)/debian/tmp-utf8pic
55
docshd = $(tmpshd)/usr/share/doc/$(PACKAGEshd)
56
docdev = $(tmpdev)/usr/share/doc/$(PACKAGEdev)
57
docpyt = $(tmppyt)/usr/share/doc/$(PACKAGEpyt)
58
doctcl = $(tmptcl)/usr/share/doc/$(PACKAGEtcl)
59
docrun = $(tmprun)/usr/share/doc/$(PACKAGErun)
60
docpic = $(tmppic)/usr/share/doc/$(PACKAGEpic)
61
docutf8shd = $(tmputf8shd)/usr/share/doc/$(PACKAGEutf8shd)
62
docutf8pic = $(tmputf8pic)/usr/share/doc/$(PACKAGEutf8pic)
42
#target specific configurations come here:
46
ifeq ($(DEB_BUILD_GNU_SYSTEM),linux)
47
GPMSUPPORT= --with-gpm-support
49
ifeq ($(DEB_BUILD_GNU_CPU),alpha)
52
ifeq ($(DEB_BUILD_GNU_CPU),ia64)
57
ifeq ($(DEB_BUILD_GNU_SYSTEM),gnu)
61
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
62
NOSTRIP=--with-nostrip=no
64
NOSTRIP=--with-nostrip=yes
73
./configure --with-gpm-support
78
sgmltools --backend html tutorial.sgml
81
build-nonutf8-stamp: configure-stamp build-document-stamp
84
ar cqv libnewt_pic.a shared/*.o
87
build-utf8-stamp: configure-stamp build-document-stamp
90
ar cqv libnewt-utf8_pic.a utf8shared/*.o
67
build-stamp=$(STAMP_DIR)/build-stamp
68
configure-stamp=$(STAMP_DIR)/configure-stamp
70
$(configure-stamp): $(patched)
72
( cd $(BUILD_TREE) && ./configure $(GPMSUPPORT) $(NOSTRIP) )
76
$(build-stamp): $(configure-stamp)
78
( cd $(BUILD_TREE) && sgmltools --backend html tutorial.sgml )
79
$(MAKE) -C $(BUILD_TREE)
80
( cd $(BUILD_TREE) && ar cqv libnewt_pic.a shared/*.o )
99
-[ -f Makefile ] && make veryclean
100
rm -rf $(tmpshd) $(tmpdev) $(tmprun) $(tmppyt) $(tmptcl) $(tmppic) \
101
$(tmputf8shd) $(tmputf8pic) \
102
*-stamp build debian/files* debian/substvars debian/*.bak debian/*~ *~ \
103
tutorial shared utf8shared config.h config.log \
104
config.cache config.status Makefile libnewt_pic.a \
106
-[ -f debian/create-utf8.sh ] && chmod a+x debian/create-utf8.sh
87
rm -rf $(SOURCE_DIR) $(STAMP_DIR)
88
# rm -rf debian/substvars debian/*.bak debian/*~ *~
108
90
binary: binary-indep binary-arch
113
binary-arch: $(binarytarget)
115
binary-shared: build checkroot
117
-[ -d $(tmpshd) ] && rm -rf $(tmpshd)
119
install -d -m 755 $(tmpshd)/usr/lib
120
make instroot=$(tmpshd) install-sh
121
rm -r $(tmpshd)/usr/lib/libnewt.so $(tmpshd)/usr/lib/whiptcl.so \
122
$(tmpshd)/usr/lib/python*
123
strip $(tmpshd)/usr/lib/libnewt.so.$(VERSION)
125
install -d -m 755 $(docshd)
126
install -m 644 debian/changelog $(docshd)/changelog.Debian
128
install -m 644 debian/copyright $(docshd)/
130
install -d -m 755 $(tmpshd)/DEBIAN
131
m4 -D__PKG__=$(PACKAGEshd) <debian/postinst.shd >$(tmpshd)/DEBIAN/postinst
132
chmod 755 $(tmpshd)/DEBIAN/postinst
133
m4 -D__PKG__=$(PACKAGEshd) <debian/prerm >$(tmpshd)/DEBIAN/prerm
134
chmod 755 $(tmpshd)/DEBIAN/prerm
135
install -m 644 debian/shlibs $(tmpshd)/DEBIAN
136
dpkg-shlibdeps $(tmpshd)/usr/lib/libnewt.so.$(VERSION)
137
dpkg-gencontrol -isp -P$(tmpshd) -p$(PACKAGEshd)
139
chmod -R go=rX $(tmpshd)
140
chown -R root.root $(tmpshd)
141
dpkg --build $(tmpshd) ..
143
binary-tcl: build checkroot
145
-[ -d $(tmptcl) ] && rm -rf $(tmptcl)
147
install -d -m 755 $(tmptcl)/usr/lib
148
make instroot=$(tmptcl) install-sh
149
rm -r $(tmptcl)/usr/lib/libnewt* $(tmptcl)/usr/lib/python*
151
install -d -m 755 $(doctcl)
152
install -m 644 debian/changelog $(doctcl)/changelog.Debian
154
install -m 644 debian/copyright $(doctcl)/
156
install -d -m 755 $(tmptcl)/DEBIAN
157
m4 -D__PKG__=$(PACKAGEtcl) <debian/postinst >$(tmptcl)/DEBIAN/postinst
158
chmod 755 $(tmptcl)/DEBIAN/postinst
159
m4 -D__PKG__=$(PACKAGEtcl) <debian/prerm >$(tmptcl)/DEBIAN/prerm
160
chmod 755 $(tmptcl)/DEBIAN/prerm
161
dpkg-gencontrol -isp -P$(tmptcl) -p$(PACKAGEtcl)
163
chmod -R go=rX $(tmptcl)
164
chown -R root.root $(tmptcl)
165
dpkg --build $(tmptcl) ..
167
binary-python: build checkroot
169
-[ -d $(tmppyt) ] && rm -rf $(tmppyt)
171
install -d -m 755 $(tmppyt)/usr/lib
172
make instroot=$(tmppyt) install-sh
173
rm -r $(tmppyt)/usr/lib/libnewt* $(tmppyt)/usr/lib/whiptcl.so
175
install -d -m 755 $(docpyt)
176
install -m 644 debian/changelog $(docpyt)/changelog.Debian
178
install -d -m 755 $(docpyt)/examples
179
install -m 644 peanuts.py popcorn.py $(docpyt)/examples
180
#gzip -9 $(docpyt)/examples/*
181
install -m 644 debian/copyright $(docpyt)/
183
install -d -m 755 $(tmppyt)/DEBIAN
184
m4 -D__PKG__=$(PACKAGEpyt) -D__PYVER__=$(PYVER) \
185
<debian/postinst.pyt >$(tmppyt)/DEBIAN/postinst
186
chmod 755 $(tmppyt)/DEBIAN/postinst
187
m4 -D__PKG__=$(PACKAGEpyt) -D__PYVER__=$(PYVER) \
188
<debian/prerm.pyt >$(tmppyt)/DEBIAN/prerm
189
chmod 755 $(tmppyt)/DEBIAN/prerm
190
dpkg-gencontrol -isp -P$(tmppyt) -p$(PACKAGEpyt)
192
chmod -R go=rX $(tmppyt)
193
chown -R root.root $(tmppyt)
194
dpkg --build $(tmppyt) ..
196
binary-runtime: build checkroot
198
-[ -d $(tmprun) ] && rm -rf $(tmprun)
200
install -d -m 755 $(tmprun)/usr/share/man $(tmprun)/usr/bin
201
make instroot=$(tmprun) install
202
rm -rf $(tmprun)/usr/lib $(tmprun)/usr/include
204
install -d -m 755 $(docrun)
205
install -m 644 debian/changelog $(docrun)/changelog.Debian
207
install -m 644 debian/copyright $(docrun)/
209
install -d -m 755 $(tmprun)/DEBIAN
210
m4 -D__PKG__=$(PACKAGErun) <debian/postinst >$(tmprun)/DEBIAN/postinst
211
chmod 755 $(tmprun)/DEBIAN/postinst
212
m4 -D__PKG__=$(PACKAGErun) <debian/prerm >$(tmprun)/DEBIAN/prerm
213
chmod 755 $(tmprun)/DEBIAN/prerm
214
dpkg-shlibdeps -pwhiptail $(tmprun)/usr/bin/whiptail
215
dpkg-gencontrol -isp -P$(tmprun) -p$(PACKAGErun)
217
chmod -R go=rX $(tmprun)
218
chown -R root.root $(tmprun)
219
dpkg --build $(tmprun) ..
221
binary-devel: build checkroot
223
-[ -d $(tmpdev) ] && rm -rf $(tmpdev)
225
install -d -m 755 $(tmpdev)/usr/lib
226
make instroot=$(tmpdev) install
227
rm -rf $(tmpdev)/usr/bin $(tmpdev)/usr/share/man
228
rm -rf $(tmpdev)/usr/lib/libnewt.so.$(VERSION)
229
rm -rf $(tmpdev)/usr/lib/libnewt.so.$(SONAME)
230
rm -rf $(tmpdev)/usr/lib/whiptcl.so
231
rm -rf $(tmpdev)/usr/lib/python$(PYVER)
232
strip --strip-debug $(tmpdev)/usr/lib/libnewt.a
234
install -d -m 755 $(docdev)
235
install -m 644 debian/changelog $(docdev)/changelog.Debian
237
install -d -m 755 $(docdev)/tutorial.html
238
install -m 644 tutorial/* $(docdev)/tutorial.html/
239
ln -si t1.html $(docdev)/tutorial.html/index.html
240
install -d -m 755 $(docdev)/examples
241
install -m 644 test*.c $(docdev)/examples
242
gzip -9 $(docdev)/examples/*
243
install -m 644 debian/copyright $(docdev)/
245
install -d -m 755 $(tmpdev)/DEBIAN
246
m4 -D__PKG__=$(PACKAGEdev) <debian/postinst >$(tmpdev)/DEBIAN/postinst
247
chmod 755 $(tmpdev)/DEBIAN/postinst
248
m4 -D__PKG__=$(PACKAGEdev) <debian/prerm >$(tmpdev)/DEBIAN/prerm
249
chmod 755 $(tmpdev)/DEBIAN/prerm
250
dpkg-gencontrol -isp -P$(tmpdev) -p$(PACKAGEdev) -Vlibcdev=$(LIBCDEV)
252
chmod -R go=rX $(tmpdev)
253
chown -R root.root $(tmpdev)
254
dpkg --build $(tmpdev) ..
256
binary-pic: build checkroot
258
-[ -d $(tmppic) ] && rm -rf $(tmppic)
260
install -d -m 755 $(tmppic)/usr/lib
261
install -m 644 libnewt_pic.a $(tmppic)/usr/lib
263
install -d -m 755 $(docpic)
264
install -m 644 debian/changelog $(docpic)/changelog.Debian
266
install -m 644 debian/copyright $(docpic)/
268
install -d -m 755 $(tmppic)/DEBIAN
269
m4 -D__PKG__=$(PACKAGEpic) <debian/postinst >$(tmppic)/DEBIAN/postinst
270
chmod 755 $(tmppic)/DEBIAN/postinst
271
m4 -D__PKG__=$(PACKAGEpic) <debian/prerm >$(tmppic)/DEBIAN/prerm
272
chmod 755 $(tmppic)/DEBIAN/prerm
273
dpkg-gencontrol -isp -P$(tmppic) -p$(PACKAGEpic)
275
chmod -R go=rX $(tmppic)
276
chown -R root.root $(tmppic)
277
dpkg --build $(tmppic) ..
279
binary-shared-utf8: build checkroot
281
-[ -d $(tmputf8shd) ] && rm -rf $(tmputf8shd)
283
install -d -m 755 $(tmputf8shd)/usr/lib
284
make instroot=$(tmputf8shd) install-utf8sh
285
strip $(tmputf8shd)/usr/lib/libnewt-utf8.so.$(VERSION)
287
install -d -m 755 $(docutf8shd)
288
install -m 644 debian/changelog $(docutf8shd)/changelog.Debian
289
gzip -9 $(docutf8shd)/*
290
install -m 644 debian/copyright $(docutf8shd)/
292
install -d -m 755 $(tmputf8shd)/DEBIAN
293
m4 -D__PKG__=$(PACKAGEutf8shd) <debian/postinst.shd >$(tmputf8shd)/DEBIAN/postinst
294
chmod 755 $(tmputf8shd)/DEBIAN/postinst
295
m4 -D__PKG__=$(PACKAGEutf8shd) <debian/prerm >$(tmputf8shd)/DEBIAN/prerm
296
chmod 755 $(tmputf8shd)/DEBIAN/prerm
297
install -m 644 debian/shlibs $(tmputf8shd)/DEBIAN
298
dpkg-shlibdeps $(tmputf8shd)/usr/lib/libnewt-utf8.so.$(VERSION)
299
dpkg-gencontrol -isp -P$(tmputf8shd) -p$(PACKAGEutf8shd)
301
chmod -R go=rX $(tmputf8shd)
302
chown -R root.root $(tmputf8shd)
303
dpkg --build $(tmputf8shd) ..
305
binary-pic-utf8: build checkroot
307
-[ -d $(tmputf8pic) ] && rm -rf $(tmputf8pic)
309
install -d -m 755 $(tmputf8pic)/usr/lib
310
install -m 644 libnewt-utf8_pic.a $(tmputf8pic)/usr/lib
312
install -d -m 755 $(docutf8pic)
313
install -m 644 debian/changelog $(docutf8pic)/changelog.Debian
314
gzip -9 $(docutf8pic)/*
315
install -m 644 debian/copyright $(docutf8pic)/
317
install -d -m 755 $(tmputf8pic)/DEBIAN
318
m4 -D__PKG__=$(PACKAGEutf8pic) <debian/postinst >$(tmputf8pic)/DEBIAN/postinst
319
chmod 755 $(tmputf8pic)/DEBIAN/postinst
320
m4 -D__PKG__=$(PACKAGEutf8pic) <debian/prerm >$(tmputf8pic)/DEBIAN/prerm
321
chmod 755 $(tmputf8pic)/DEBIAN/prerm
322
dpkg-gencontrol -isp -P$(tmputf8pic) -p$(PACKAGEutf8pic)
324
chmod -R go=rX $(tmputf8pic)
325
chown -R root.root $(tmputf8pic)
326
dpkg --build $(tmputf8pic) ..
333
@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
339
.PHONY: binary-arch clean source diff checkroot binary binary-indep
94
binary-arch: $(LIB_PKG) $(DEV_PKG) $(PIC_PKG) $(TCL_PKG) $(PYTHON_PKG) $(WHIPTAIL_PKG)
100
dh_install -p $@ --sourcedir=$(BUILD_TREE)
101
chmod +x $(BUILD_TREE)/mkinstalldirs
102
$(MAKE) -C $(BUILD_TREE)/po \
103
DESTDIR=../../../debian/$@/usr HAVE_XGETTEXT=yes install
106
dh_shlibdeps -L $(LIB_PKG) -l debian/$@/usr/lib
107
dh_installdocs -p $@ -p $@ $(BUILD_TREE)/newt.spec
108
dh_link -p $@ /usr/lib/libnewt.so.$(VERSION) /usr/lib/libnewt.so.$(SONAME)
109
rm debian/$@/usr/lib/libnewt.so
110
# Currently disabled, as debian-test has been removed.
111
# chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh
112
dh_installchangelogs -p $@ $(BUILD_TREE)/CHANGES
124
dh_install -p $@ --sourcedir=$(BUILD_TREE)
127
dh_installdocs -p $@ -p $@ $(BUILD_TREE)/newt.spec
128
# Currently disabled, as debian-test has been removed.
129
# chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh
130
dh_installchangelogs -p $@ $(BUILD_TREE)/CHANGES
132
dh_shlibdeps -p $@ -ldebian/$@/usr/lib
143
dh_install -p $@ --sourcedir=$(BUILD_TREE)
146
dh_installdocs -p $@ -p $@ $(BUILD_TREE)/newt.spec
147
dh_link -p $@ /usr/lib/libnewt.so.$(VERSION) /usr/lib/libnewt.so
149
/usr/share/doc/libnewt-dev/tutorial.html/t1.html \
150
/usr/share/doc/libnewt-dev/tutorial.html/index.html
151
# Currently disabled, as debian-test has been removed.
152
# chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh
153
dh_installchangelogs -p $@ $(BUILD_TREE)/CHANGES
154
dh_installexamples -p $@
156
dh_shlibdeps -p $@ -ldebian/$@/usr/lib
167
dh_install -p $@ --sourcedir=$(BUILD_TREE)
170
dh_installdocs -p $@ -p $@ $(BUILD_TREE)/newt.spec
171
# Currently disabled, as debian-test has been removed.
172
# chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh
173
dh_installchangelogs -p $@ $(BUILD_TREE)/CHANGES
175
dh_shlibdeps -p $@ -ldebian/$@/usr/lib
186
dh_install -p $@ --sourcedir=$(BUILD_TREE)
190
dh_installdocs -p $@ -p $@ $(BUILD_TREE)/newt.spec
191
# Currently disabled, as debian-test has been removed.
192
# chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh
193
dh_installchangelogs -p $@ $(BUILD_TREE)/CHANGES
194
dh_installexamples -p $@
196
dh_shlibdeps -p $@ -ldebian/$@/usr/lib
203
$(WHIPTAIL_PKG): build
207
dh_install -p $@ --sourcedir=$(BUILD_TREE)
210
dh_installdocs -p $@ -p $@ $(BUILD_TREE)/newt.spec debian/README.whiptail
211
dh_installman -p $@ $(BUILD_TREE)/whiptail.1
212
# Currently disabled, as debian-test has been removed.
213
# chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh
214
dh_installchangelogs -p $@ $(BUILD_TREE)/CHANGES
216
dh_shlibdeps -p $@ -ldebian/$@/usr/lib -L $(LIB_PKG) -l debian/$(LIB_PKG)/usr/lib
223
.PHONY: binary-arch clean source diff binary binary-indep