File: rules

package info (click to toggle)
newt 0.50-7
  • links: PTS
  • area: main
  • in suites: potato
  • size: 516 kB
  • ctags: 981
  • sloc: ansic: 6,642; python: 501; makefile: 270; sh: 167
file content (206 lines) | stat: -rwxr-xr-x 6,103 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
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
#!/usr/bin/make -f
#
# Created 20 December 1997 by Enrique Zanardi <ezanardi@ull.es>
#
# Copying and modification is unlimited, provided that the modified
# version is marked as being modified.

ARCH = $(shell dpkg --print-gnu-build-architecture)

VERSION=0.50
SONAME=0.50

PACKAGEshd=libnewt0
PACKAGEdev=libnewt-dev
PACKAGEpyt=python-newt
PACKAGEtcl=newt-tcl
PACKAGErun=whiptail

tmpshd = $(shell pwd)/debian/tmp-shd
tmpdev = $(shell pwd)/debian/tmp-dev
tmppyt = $(shell pwd)/debian/tmp-pyt
tmptcl = $(shell pwd)/debian/tmp-tcl
tmprun = $(shell pwd)/debian/tmp-run

docshd = $(tmpshd)/usr/share/doc/$(PACKAGEshd)
docdev = $(tmpdev)/usr/share/doc/$(PACKAGEdev)
docpyt = $(tmppyt)/usr/share/doc/$(PACKAGEpyt)
doctcl = $(tmptcl)/usr/share/doc/$(PACKAGEtcl)
docrun = $(tmprun)/usr/share/doc/$(PACKAGErun)

ifeq (ARCH,"alpha")
	LIBCDEV=libc6.1-dev
else
	LIBCDEV=libc6-dev
endif

build:
	$(checkdir)
	./configure --with-gpm-support
	make 
	sgml2html -s 0 tutorial.sgml
	touch build

clean:
	$(checkdir)
	-[ -f Makefile ] && make veryclean
	rm -rf  $(tmpshd) $(tmpdev) $(tmprun) $(tmppyt) $(tmptcl) build \
	        debian/files* debian/substvars debian/*.bak debian/*~ \
	        tutorial.html config.h config.log config.cache config.status \
		Makefile

binary: binary-indep binary-arch

binary-indep:
	true

binary-arch: binary-devel binary-shared binary-runtime binary-tcl binary-python

binary-shared: build checkroot
	$(checkdir)
	-[ -d $(tmpshd) ] && rm -rf $(tmpshd)

	install -d -m 755 $(tmpshd)/usr/lib
	make instroot=$(tmpshd) install-sh 
	rm -r $(tmpshd)/usr/lib/libnewt.so $(tmpshd)/usr/lib/whiptcl.so \
	   $(tmpshd)/usr/lib/python*
	strip $(tmpshd)/usr/lib/libnewt.so.$(SONAME)

	install -d -m 755 $(docshd)
	install -m 644 debian/changelog $(docshd)/changelog.Debian
	gzip -9 $(docshd)/*
	install -m 644 debian/copyright $(docshd)/
	
	install -d -m 755 $(tmpshd)/DEBIAN 
	m4 -D__PKG__=$(PACKAGEshd) <debian/postinst.shd >$(tmpshd)/DEBIAN/postinst
	chmod 755 $(tmpshd)/DEBIAN/postinst
	m4 -D__PKG__=$(PACKAGEshd) <debian/prerm >$(tmpshd)/DEBIAN/prerm
	chmod 755 $(tmpshd)/DEBIAN/prerm
	install -m 644 debian/shlibs $(tmpshd)/DEBIAN
	dpkg-shlibdeps $(tmpshd)/usr/lib/libnewt.so.$(SONAME)
	dpkg-gencontrol -isp -P$(tmpshd) -p$(PACKAGEshd)

	chmod -R go=rX $(tmpshd)
	chown -R root.root $(tmpshd)
	dpkg --build $(tmpshd) ..

binary-tcl: build checkroot
	$(checkdir)
	-[ -d $(tmptcl) ] && rm -rf $(tmptcl)

	install -d -m 755 $(tmptcl)/usr/lib
	make instroot=$(tmptcl) install-sh
	rm -r $(tmptcl)/usr/lib/libnewt* $(tmptcl)/usr/lib/python*

	install -d -m 755 $(doctcl)
	install -m 644 debian/changelog $(doctcl)/changelog.Debian
	gzip -9 $(doctcl)/*
	install -m 644 debian/copyright $(doctcl)/

	install -d -m 755 $(tmptcl)/DEBIAN
	m4 -D__PKG__=$(PACKAGEtcl) <debian/postinst >$(tmptcl)/DEBIAN/postinst
	chmod 755 $(tmptcl)/DEBIAN/postinst
	m4 -D__PKG__=$(PACKAGEtcl) <debian/prerm >$(tmptcl)/DEBIAN/prerm
	chmod 755 $(tmptcl)/DEBIAN/prerm
	dpkg-gencontrol -isp -P$(tmptcl) -p$(PACKAGEtcl)

	chmod -R go=rX $(tmptcl)
	chown -R root.root $(tmptcl)
	dpkg --build $(tmptcl) ..

binary-python: build checkroot
	$(checkdir)
	-[ -d $(tmppyt) ] && rm -rf $(tmppyt)

	install -d -m 755 $(tmppyt)/usr/lib
	make instroot=$(tmppyt) install-sh
	rm -r $(tmppyt)/usr/lib/libnewt* $(tmppyt)/usr/lib/whiptcl.so

	install -d -m 755 $(docpyt) 
	install -m 644 debian/changelog $(docpyt)/changelog.Debian
	gzip -9 $(docpyt)/* 
	install -d -m 755 $(docpyt)/examples 
	install -m 644 peanuts.py popcorn.py $(docpyt)/examples
	gzip -9 $(docpyt)/examples/* 
	install -m 644 debian/copyright $(docpyt)/

	install -d -m 755 $(tmppyt)/DEBIAN
	m4 -D__PKG__=$(PACKAGEpyt) <debian/postinst >$(tmppyt)/DEBIAN/postinst
	chmod 755 $(tmppyt)/DEBIAN/postinst
	m4 -D__PKG__=$(PACKAGEpyt) <debian/prerm >$(tmppyt)/DEBIAN/prerm
	chmod 755 $(tmppyt)/DEBIAN/prerm
	dpkg-gencontrol -isp -P$(tmppyt) -p$(PACKAGEpyt)

	chmod -R go=rX $(tmppyt)
	chown -R root.root $(tmppyt)
	dpkg --build $(tmppyt) ..

binary-runtime: build checkroot
	$(checkdir)
	-[ -d $(tmprun) ] && rm -rf $(tmprun)

	install -d -m 755 $(tmprun)/usr/share/man $(tmprun)/usr/bin
	make instroot=$(tmprun) install
	rm -rf $(tmprun)/usr/lib $(tmprun)/usr/include

	install -d -m 755 $(docrun)
	install -m 644 debian/changelog $(docrun)/changelog.Debian
	gzip -9 $(docrun)/*
	install -m 644 debian/copyright $(docrun)/

	install -d -m 755 $(tmprun)/DEBIAN
	m4 -D__PKG__=$(PACKAGErun) <debian/postinst >$(tmprun)/DEBIAN/postinst
	chmod 755 $(tmprun)/DEBIAN/postinst
	m4 -D__PKG__=$(PACKAGErun) <debian/prerm >$(tmprun)/DEBIAN/prerm
	chmod 755 $(tmprun)/DEBIAN/prerm
	dpkg-shlibdeps -pwhiptail $(tmprun)/usr/bin/whiptail
	dpkg-gencontrol -isp -P$(tmprun) -p$(PACKAGErun)

	chmod -R go=rX $(tmprun)
	chown -R root.root $(tmprun)
	dpkg --build $(tmprun) ..

binary-devel: build checkroot
	$(checkdir)
	-[ -d $(tmpdev) ] && rm -rf $(tmpdev)

	install -d -m 755 $(tmpdev)/usr/lib
	make instroot=$(tmpdev) install
	rm -rf $(tmpdev)/usr/bin $(tmpdev)/usr/share/man
	rm -rf $(tmpdev)/usr/lib/libnewt.so.$(SONAME)
	rm -rf $(tmpdev)/usr/lib/whiptcl.so
	rm -rf $(tmpdev)/usr/lib/python1.5
	strip --strip-debug $(tmpdev)/usr/lib/libnewt.a

	install -d -m 755 $(docdev)
	install -m 644 tutorial.html $(docdev)/
	install -m 644 debian/changelog $(docdev)/changelog.Debian
	gzip -9 $(docdev)/*
	install -d -m 755 $(docdev)/examples 
	install -m 644 test*.c $(docdev)/examples
	gzip -9 $(docdev)/examples/* 
	install -m 644 debian/copyright $(docdev)/

	install -d -m 755 $(tmpdev)/DEBIAN
	m4 -D__PKG__=$(PACKAGEdev) <debian/postinst >$(tmpdev)/DEBIAN/postinst
	chmod 755 $(tmpdev)/DEBIAN/postinst
	m4 -D__PKG__=$(PACKAGEdev) <debian/prerm >$(tmpdev)/DEBIAN/prerm
	chmod 755 $(tmpdev)/DEBIAN/prerm
	dpkg-gencontrol -isp -P$(tmpdev) -p$(PACKAGEdev) -Vlibcdev=$(LIBCDEV)

	chmod -R go=rX $(tmpdev)
	chown -R root.root $(tmpdev)
	dpkg --build $(tmpdev) ..

define checkdir
	test -f newt.h
endef

source diff:
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

checkroot:
	$(checkdir)
	[ `whoami` = root ]

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