File: rules

package info (click to toggle)
itcl3 3.4.1-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,504 kB
  • sloc: ansic: 9,891; sh: 421; tcl: 153; makefile: 115
file content (155 lines) | stat: -rwxr-xr-x 4,410 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
#!/usr/bin/make -f

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

export QUILT_PATCHES := debian/patches

vmajor=$(shell dpkg-parsechangelog | grep ^Version: | sed 's/[^0-9]*\([0-9]*\).*/\1/')
vminor=$(shell dpkg-parsechangelog | grep ^Version: | sed 's/[^0-9]*[0-9]*\.\([0-9]*\).*/\1/')
vrelease=$(shell dpkg-parsechangelog | grep ^Version: | sed 's/[^0-9]*[0-9]*\.[0-9]*\.\([0-9]*\).*/\1/')
v=$(vmajor).$(vminor)
v1=$(vmajor).$(shell expr $(vminor) + 1)
dtmp=$(shell pwd)/debian/tmp

tclv=8.5

unpatch:
	dh_testdir
	quilt pop -a || test $$? = 2
	rm -rf patch-stamp .pc

patch: patch-stamp
patch-stamp:
	dh_testdir
	quilt push -a || test $$? = 2
	touch patch-stamp

build-arch: build-stamp
build-indep: build-stamp
build: build-stamp
build-stamp: patch-stamp
	dh_testdir
	#
	sh ./configure --prefix=/usr \
		       --includedir=/usr/include/tcl$(tclv) \
		       --enable-shared \
		       --enable-threads \
		       --with-tcl=/usr/lib/tcl$(tclv)
	$(MAKE) LIBS="-Wl,-soname,\$$@.1"
	#
	touch build-stamp

clean: clean-patched unpatch
	dh_testdir
	dh_testroot
	dh_clean

clean-patched: patch-stamp
	dh_testdir
	dh_testroot
	rm -f build-stamp install-stamp
	#
	[ ! -f Makefile ] || $(MAKE) clean
	[ ! -f Makefile ] || $(MAKE) distclean
	#
	rm -f itclConfig.sh pkgIndex.tcl

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	#
	mkdir -p debian/tmp
	$(MAKE) prefix=$(dtmp)/usr \
		exec_prefix=$(dtmp)/usr \
		includedir=$(dtmp)/usr/include/tcl$(tclv) \
		install
	#
	# Fix up the itcl libraries.
	mv $(dtmp)/usr/lib/itcl*/libitcl$(v).so $(dtmp)/usr/lib/libitcl$(v).so.1
	mv $(dtmp)/usr/lib/itcl*/*.a $(dtmp)/usr/lib/
	ln -sf libitcl$(v).so.1 $(dtmp)/usr/lib/libitcl$(v).so
	#  (itclConfig.sh doesn't get installed at all, so we install it here)
	sed -e "s:^\(\(ITCL\|itcl\)_\(BUILD_\)\?LIB_SPEC\)=.*$$:\1='-L/usr/lib -litcl$(v)':" \
	    -e "s:^\(\(ITCL\|itcl\)_\(BUILD_\)\?STUB_LIB_SPEC\)=.*$$:\1='-L/usr/lib -litclstub$(v)':" \
	    -e "s:^\(\(ITCL\|itcl\)_\(BUILD_\)\?STUB_LIB_PATH\)=.*$$:\1=/usr/lib/libitclstub$(v).a:" \
	    -e "s:^\(\(ITCL\|itcl\)_SRC_DIR\)=.*$$:\1='/usr/include/tcl$(tclv)/itcl-private':" \
	    -e "s:^\(\(ITCL\|itcl\)_LIB_FILE\)=.*$$:\1=libitcl$(v).so.1:" \
	    -e "s:^\(\(ITCL\|itcl\)_STUB_LIB_FILE\)=.*$$:\1=libitclstub$(v).a:" \
	    -e "s:^\(\(ITCL\|itcl\)_VERSION\)=.*$$:\1='$(v)':" \
	    itclConfig.sh > $(dtmp)/usr/lib/itcl$(v)/itclConfig.sh
	#
	# Move the Tcl library to /usr/share/tcltk
	install -d -m 755 $(dtmp)/usr/share/tcltk
	mv $(dtmp)/usr/lib/itcl$(v) $(dtmp)/usr/share/tcltk/
	#
	# Fix up the include files.
	install -d $(dtmp)/usr/include/tcl$(tclv)/itcl-private/generic
	cp generic/*.h $(dtmp)/usr/include/tcl$(tclv)/itcl-private/generic
	#
	# Fix up the manpages.
	# - just remove the installed ones, they're all mixed together
	rm -r $(dtmp)/usr/man
	mkdir -p $(dtmp)/usr/share/man/man3
	#
	cp doc/*.n $(dtmp)/usr/share/man/man3
	cd $(dtmp)/usr/share/man/man3 && \
	  for i in *.n ; do \
	    sed -i -e'/^\.so man\.macros/d' \
		   -e'/^\.BS/d' \
		   -e'/^\.BE/d' \
		   -e'/^\.CS/d' \
		   -e'/^\.CE/d' \
	    	   -e's/^\.TH \([^ ]\+\) n /.TH \1 3itcl /' $$i ; \
	    mv $$i `echo $$i | sed -e 's/\.n/\.3itcl/'` ; \
          done
	#
	dh_movefiles -pitcl3-dev
	dh_movefiles -Nitcl3-dev
	#
	touch install-stamp

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i
	dh_installchangelogs -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installdocs -a
	install -D -m 644 debian/itcl3.lintian-override \
		  debian/itcl3/usr/share/lintian/overrides/itcl3
	dh_installchangelogs -a
	#
	# hack up the /usr/doc links for dependent packages
	rm -rf debian/itcl3-dev/usr/share/doc/itcl3-dev
	ln -sf itcl3 debian/itcl3-dev/usr/share/doc/itcl3-dev
	#
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs -a -V 'itcl3 (>= $(v)~), itcl3 (<< $(v1)~)'
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

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

binary: binary-indep binary-arch
.PHONY: patch unpatch build build-arch build-indep clean clean-patched binary-indep binary-arch binary install