File: rules

package info (click to toggle)
itcl3 3.2.1-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,452 kB
  • ctags: 967
  • sloc: ansic: 13,746; sh: 1,394; tcl: 1,022; makefile: 206
file content (143 lines) | stat: -rwxr-xr-x 4,111 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
#!/usr/bin/make -f

v = 3.2
vv = 3.2.1
tcltk = 8.4
dtmp=$(shell pwd)/debian/tmp

build: build-stamp
build-stamp:
	dh_testdir

	sh ./configure --prefix=/usr --includedir=/usr/include/tcl$(tcltk) \
	  --enable-shared --enable-threads --with-tcl=/usr/lib/tcl$(tcltk) \
	  --with-tk=/usr/lib/tk$(tcltk)
	$(MAKE)
# Build the static library.
	cd itcl && \
	  ar cr libitcl$(v).a *.o && \
	  ar d libitcl$(v).a itclStubLib.o tclAppInit.o && \
	  ranlib libitcl$(v).a
	cd itk && \
	  ar cr libitk$(v).a *.o && \
	  ar d libitk$(v).a itkStubLib.o tkAppInit.o && \
	  ranlib libitk$(v).a

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp install-stamp

	-$(MAKE) clean
	-$(MAKE) distclean

	dh_clean

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$(tcltk) install

# Fix up the itcl libraries.
	cp itcl/libitcl$(v).a $(dtmp)/usr/lib
	mv $(dtmp)/usr/lib/libitcl$(v).so $(dtmp)/usr/lib/libitcl$(v).so.1
	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)
	perl -p \
	  -e "s|^(ITCL_BUILD_LIB_SPEC)=.*$$|\1='-L/usr/lib -litcl$(v)'|;" \
	  -e "s|^(ITCL_BUILD_STUB_LIB_SPEC)=.*$$|\1='-L/usr/lib -litclstub$(v)'|;" \
	  -e "s|^(ITCL_SRC_DIR)=.*$$|\1='/usr/include/tcl$(tcltk)/itcl-private'|" \
	  itcl/itclConfig.sh > $(dtmp)/usr/lib/itcl$(v)/itclConfig.sh
#	mv $(dtmp)/usr/lib/itcl*.sh $(dtmp)/usr/lib/itcl$(v)

# Fix up the itk libraries.
	cp itk/libitk$(v).a $(dtmp)/usr/lib
	mv $(dtmp)/usr/lib/libitk$(v).so $(dtmp)/usr/lib/libitk$(v).so.1
	ln -sf libitk$(v).so.1 $(dtmp)/usr/lib/libitk$(v).so
#  (itkConfig.sh doesn't get installed at all, so we install it here)
	perl -p \
	  -e "s|^(ITK_BUILD_LIB_SPEC)=.*$$|\1='-L/usr/lib -litk$(v)'|;" \
	  -e "s|^(ITK_BUILD_STUB_LIB_SPEC)=.*$$|\1='-L/usr/lib -litkstub$(v)'|;" \
	  -e "s|^(ITK_SRC_DIR)=.*$$|\1='/usr/include/tcl$(tcltk)/itk-private'|" \
	  itk/itkConfig.sh > $(dtmp)/usr/lib/itk$(v)/itkConfig.sh
#	mv $(dtmp)/usr/lib/itk*.sh $(dtmp)/usr/lib/itk$(v)

# Fix up the include files.
	install -d $(dtmp)/usr/include/tcl$(tcltk)/itcl-private/generic
	cp itcl/generic/*.h $(dtmp)/usr/include/tcl$(tcltk)/itcl-private/generic
	install -d $(dtmp)/usr/include/tcl$(tcltk)/itk-private/generic
	cp itk/generic/*.h $(dtmp)/usr/include/tcl$(tcltk)/itk-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 itcl/doc/*.n $(dtmp)/usr/share/man/man3
	cd $(dtmp)/usr/share/man/man3 && \
	  for i in *.n ; do \
	    mv $$i `echo $$i | sed -e 's/\.n/\.3itcl/'` ; \
          done
	cp itk/doc/*.n $(dtmp)/usr/share/man/man3
	cd $(dtmp)/usr/share/man/man3 && \
	  for i in *.n ; do \
	    mv $$i `echo $$i | sed -e 's/\.n/\.3itk/'` ; \
          done

	dh_movefiles

	touch install-stamp

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir -i
	dh_testroot -i
	dh_installdocs -i
	#dh_installexamples -i
	dh_installchangelogs -pitcl3-doc -pitk3-doc ChangeLog
	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
	dh_installchangelogs -a ChangeLog

# hack up the /usr/doc links for dependent packages
	for f in itcl3-dev itk3 ; do \
	  rm -rf debian/$${f}/usr/share/doc/$${f} ; \
	  ln -sf itcl3 debian/$${f}/usr/share/doc/$${f} ; \
	done
	rm -rf debian/itk3-dev/usr/share/doc/itk3-dev
	ln -sf itk3 debian/itk3-dev/usr/share/doc/itk3-dev

	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs -pitcl3 -V 'itcl3'
	dh_makeshlibs -pitk3 -V 'itk3'
	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: build clean binary-indep binary-arch binary install