File: rules

package info (click to toggle)
tix 8.4.3-10
  • links: PTS
  • area: main
  • in suites: bullseye, buster
  • size: 9,080 kB
  • ctags: 7,129
  • sloc: ansic: 28,082; tcl: 22,774; python: 7,577; makefile: 331; cs: 253; sh: 210; perl: 128
file content (228 lines) | stat: -rwxr-xr-x 7,001 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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
#!/usr/bin/make -f
# Sample debian.rules file - for GNU Hello (1.3).
# Copyright 1994,1995 by Ian Jackson.
# I hereby give you perpetual unlimited permission to copy,
# modify and relicense this file, provided that you do not remove
# my name from the file itself.  (I assert my moral right of
# paternity under the Copyright, Designs and Patents Act 1988.)
# This file may have to be extensively modified

# There used to be `source' and `diff' targets in this file, and many
# packages also had `changes' and `dist' targets.  These functions
# have been taken over by dpkg-source, dpkg-genchanges and
# dpkg-buildpackage in a package-independent way, and so these targets
# are obsolete.

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

SHELL=/bin/bash

CFLAGS := -Wall $(shell dpkg-buildflags --get CFLAGS)
CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)

DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

groff_version=`groff -v| grep "groff version"| sed -e 's/GNU groff version //'`
tk_version = 8.6
tix_version = 8.4.3
soname=libTix$(tix_version).so.1

p_run	= tix
p_dev	= $(p_run)-dev

d_run	= debian/$(p_run)
d_dev	= debian/$(p_dev)

build: build-static build-shared

build-static: build-static-stamp
build-static-stamp:
	dh_testdir
	rm -rf build-static
	mkdir build-static
	cd build-static && ../configure \
	    CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
	    --prefix=/usr \
	    --mandir=\$${prefix}/share/man \
	    --disable-shared \
	    --with-tclconfig=/usr/lib/$(DEB_HOST_MULTIARCH)/tcl$(tk_version) \
	    --with-tclinclude=/usr/include/tcl$(tk_version)/tcl-private \
	    --with-tkconfig=/usr/lib/$(DEB_HOST_MULTIARCH)/tk$(tk_version) \
	    --with-tkinclude=/usr/include/tcl$(tk_version)/tk-private

	$(MAKE) -C build-static

	touch build-static-stamp

build-shared: build-shared-stamp
build-shared-stamp:
	dh_testdir
	rm -rf build-shared
	mkdir build-shared
	cd build-shared && ../configure \
	    CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
	    --prefix=/usr \
	    --mandir=\$${prefix}/share/man \
	    --enable-shared \
	    --with-tclconfig=/usr/lib/$(DEB_HOST_MULTIARCH)/tcl$(tk_version) \
	    --with-tclinclude=/usr/include/tcl$(tk_version)/tcl-private \
	    --with-tkconfig=/usr/lib/$(DEB_HOST_MULTIARCH)/tk$(tk_version) \
	    --with-tkinclude=/usr/include/tcl$(tk_version)/tk-private

	$(MAKE) -C build-shared \
		PKG_LIB_FILE=libTix$(tix_version).so.1 \
		LDFLAGS_DEFAULT="-Wl,-soname,$(soname),--export-dynamic"

	touch build-shared-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f *-stamp
	rm -rf build-*
	dh_clean

install:
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	dh_installdirs -p$(p_run) \
		usr/lib \
		usr/share/man/man1 \
		usr/share/doc/$(p_run)
	dh_installdirs -p$(p_dev) \
		usr/lib \
		usr/include \
		usr/share/man/man3 \
		usr/share/doc/$(p_run) \
		usr/share/tix$(tix_version)

	: # Install the package
	$(MAKE) -C build-static install \
		DESTDIR=$(shell pwd)/$(d_run) \
		pkglibdir=/usr/lib/tix$(tix_version) \

	$(MAKE) -C build-shared install \
		DESTDIR=$(shell pwd)/$(d_run) \
		pkglibdir=/usr/lib/tix$(tix_version) \
		PKG_LIB_FILE=libTix$(tix_version).so.1 \

	: # install missing tix.h
	cp $(CURDIR)/generic/tix.h $(d_dev)/usr/include

	: # Move things around

	mv $(d_run)/usr/lib/tix$(tix_version)/*.so* $(d_run)/usr/lib/
	mv $(d_run)/usr/lib/tix$(tix_version)/*.a $(d_dev)/usr/lib/
	ln -sf libTix$(tix_version).so.1 \
		$(d_dev)/usr/lib/libTix$(tix_version).so

	mkdir -p $(d_run)/usr/share/tcltk/tcl$(tk_version)
	mv $(d_run)/usr/lib/tix$(tix_version) \
		$(d_run)/usr/share/tcltk/tcl$(tk_version)/Tix$(tix_version)
	ln -sf ../share/tcltk/tcl$(tk_version)/Tix$(tix_version) $(d_run)/usr/lib/Tix$(tix_version)

	sed -i -e '/^package/s/\$$dir/\$$dir ../' \
		$(d_run)/usr/share/tcltk/tcl$(tk_version)/Tix$(tix_version)/pkgIndex.tcl
	sed -i -e 's/\$$dir/\/usr\/lib/' \
		$(d_run)/usr/share/tcltk/tcl$(tk_version)/Tix$(tix_version)/pkgIndex.tcl

	rm  -f $(d_run)/usr/share/tcltk/tcl$(tk_version)/Tix$(tix_version)/license.terms

	install -m755 tools/tixindex $(d_run)/usr/bin/tixindex

	# remove tixwish man pages (close #407212)
	# cp -p man/tixwish.1 $(d_run)/usr/share/man/man1/
	cp -p debian/tixindex.1 $(d_run)/usr/share/man/man1/

	#  sed -i -e 's/man.macros/tixman.macros/g' $(d_run)/usr/share/man/man1/tixwish.1
	sed -i -e 's/.TH TIXINDEX/.TH TIX/g' $(d_run)/usr/share/man/man1/tixindex.1

#	for i in man/*.n; do \
#	  cp -p $$i $(d_dev)/usr/share/man/man3/`basename $$i .n`.3; \
#	  sed -i -e 's/.so man.macros/.mso tix.tmac/g' $(d_dev)/usr/share/man/man3/`basename $$i .n`.3; \
#	  perl -pi -e "s|\.TH \w+ n|\.TH TIX 3|g" $(d_dev)/usr/share/man/man3/`basename $$i .n`.3; \
#	done

	for i in man/*.n; do \
	  cp -p $$i $(d_dev)/usr/share/man/man3/`basename $$i .n`.3; \
	  perl -pi -e "s|\.TH \w+ n|\.TH TIX 3|g" $(d_dev)/usr/share/man/man3/`basename $$i .n`.3; \
	done

	rm -f $(d_run)/usr/lib/tix$(tix_version)/README.txt
	rm -f $(d_run)/usr/lib/tix$(tix_version)/license.terms
	rm -rf $(d_run)/usr/lib/tix$(tix_version)/html

	chmod ugo-x $(d_run)/usr/share/tcltk/tcl$(tk_version)/Tix$(tix_version)/pref/WmDefault.tcl

#	sed 's,-L[^ ]*,,' $(d_run)/usr/lib/tixConfig.sh \
#		> $(d_dev)/usr/share/tix$(tix_version)/tixConfig.sh
#	rm -f $(d_run)/usr/lib/tixConfig.sh

	: # Replace all '#!' calls to tclsh with /usr/bin/tclsh
	: # and make them executable
	for i in `find debian -mindepth 3 -type f`; do \
	  sed '1s,#!.*tclsh[^ ]*\(.*\),#! /usr/bin/tclsh\1,' \
		$$i > $$i.temp; \
	  if cmp --quiet $$i $$i.temp; then \
	    rm -f $$i.temp; \
	  else \
	    mv -f $$i.temp $$i; \
	    chmod 755 $$i; \
	    echo "fixed interpreter: $$i"; \
	  fi; \
	done

	: # remove empty directories, when all components are in place
	for d in `find debian -depth -type d -empty 2> /dev/null`; do \
	    while rmdir $$d 2> /dev/null; do d=`dirname $$d`; done; \
	done


binary-indep: build
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch: build install
	dh_testdir
	dh_testroot

	dh_installdocs -p$(p_run) \
		ABOUT.html README.txt \
		docs/pdf/TixUser.pdf \
		docs/FAQ.* docs/Files.txt \

	mkdir -p $(d_dev)/usr/share/doc/$(p_run)/
	cp -p docs/pdf/TixBook.pdf $(d_dev)/usr/share/doc/$(p_run)/
	ln -sf $(p_run) $(d_dev)/usr/share/doc/$(p_dev)
	mkdir -p $(d_dev)/usr/share/groff/$(groff_version)/tmac
	cp -p man/man.macros $(d_dev)/usr/share/groff/$(groff_version)/tmac/tix.tmac

	dh_installchangelogs -p$(p_run) ChangeLog

	dh_installexamples -p$(p_dev) demos/*

	dh_strip -a
	dh_link -a
	dh_compress -a -Xexamples -X.pdf -Xmacros
	dh_fixperms -a
	dh_makeshlibs -p$(p_run) -V 'tix (>= 8.4)'
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a


binary:	binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean

#Local variables:
#mode: makefile
#End: