File: rules

package info (click to toggle)
itcl3.0 3.0.1-6
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 10,128 kB
  • ctags: 3,519
  • sloc: tcl: 32,416; ansic: 12,683; sh: 3,917; makefile: 692; awk: 273; perl: 265
file content (126 lines) | stat: -rwxr-xr-x 3,399 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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independent
# package.

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

# This is the debhelper compatability version to use.
export DH_COMPAT=3

v = 3.0
vv = 3.0.0
tcltk = 8.0

build: build-stamp
build-stamp:
	dh_testdir

# Make sure the proper Tcl/Tk is installed.
	test -d /usr/include/tk$(tcltk)

	sh ./configure --prefix=/usr --enable-shared \
	  --with-tcl=/usr/lib/tcl$(tcltk) --with-tk=/usr/lib/tcl$(tcltk)
	$(MAKE) CFLAGS="-g -O2 -D_REENTRANT"
# Build the static library.
	cd itcl/unix && \
	  ar cr libitcl$(v).a *.o && \
	  ar d libitcl$(v).a tclAppInit.o && \
	  ranlib libitcl$(v).a
	cd itk/unix && \
	  ar cr libitk$(v).a *.o && \
	  ar d libitk$(v).a 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) INSTALL_ROOT=`pwd`/debian/tmp install
# Fix up the itcl libraries.
	cp itcl/unix/libitcl$(v).a debian/tmp/usr/lib
	ln -sf libitcl$(v).so.1 debian/tmp/usr/lib/libitcl$(v).so
	perl -i -p \
	  -e "s|^(ITCL_BUILD_LIB_SPEC)=.*$$|\1='-L/usr/lib -litcl$(v)'|;" \
	  -e "s|^(ITCL_SRC_DIR)=.*$$|\1='/usr/include/itcl$(v)'|" \
	  debian/tmp/usr/lib/itclConfig.sh
# Fix up the itk libraries.
	cp itk/unix/libitk$(v).a debian/tmp/usr/lib
	ln -sf libitk$(v).so.1 debian/tmp/usr/lib/libitk$(v).so
	perl -i -p \
	  -e "s|^(ITK_BUILD_LIB_SPEC)=.*$$|\1='-L/usr/lib -litk$(v)'|;" \
	  -e "s|^(ITK_SRC_DIR)=.*$$|\1='/usr/include/itk$(v)'|" \
	  debian/tmp/usr/lib/itkConfig.sh
# Fix up the include files.
	install -d debian/tmp/usr/include/itcl$(v)/generic
	cp itcl/generic/*.h debian/tmp/usr/include/itcl$(v)/generic
	install -d debian/tmp/usr/include/itk$(v)/generic
	cp itk/generic/*.h debian/tmp/usr/include/itk$(v)/generic
# Fix up the manpages.
	cd debian/tmp/usr/share/man/man1 && \
	  mv itclsh.1 itclsh$(v).1 && \
	  mv itkwish.1 itkwish$(v).1
	cd debian/tmp/usr/share/man/man3 && \
	  for f in *.nitcl ; do \
	    mv $$f `echo $$f | sed -e 's/\.nitcl/.3itcl/'` ; \
	  done ; \
	  for f in *.nitk ; do \
	    mv $$f `echo $$f | sed -e 's/\.nitk/.3itk/'` ; \
	  done

	dh_movefiles
	touch install-stamp

# Build architecture-independent files here.
binary-indep: build install
# none in this package.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	dh_installdocs -a
	for f in itcl$(v)-dev itk$(v) itk$(v)-dev ; do \
	  rm -rf debian/$$f/usr/share/doc/$$f ; \
	  ln -sf itcl$(v) debian/$$f/usr/share/doc/$$f ; \
	done
#	dh_installexamples -a
#	dh_installmenu -a
#	dh_installmanpages -a
#	dh_undocumented
	dh_installchangelogs -pitcl$(v) -k CHANGES
	dh_strip -a
#	dh_link -a
	dh_compress -a
	dh_fixperms -a
	dh_makeshlibs -pitcl$(v) -V 'itcl$(v)'
	dh_makeshlibs -pitk$(v) -V 'itk$(v)'
	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