File: rules

package info (click to toggle)
tclreadline 2.4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,308 kB
  • sloc: tcl: 5,699; sh: 4,217; ansic: 772; makefile: 83
file content (60 lines) | stat: -rwxr-xr-x 2,060 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
#!/usr/bin/make -f

TCLVERSIONS = 9.0 8.6

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/architecture.mk

LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
export LDFLAGS

%:
	dh $@

override_dh_auto_configure:
	for v in $(TCLVERSIONS) ; do \
		dh_auto_configure -B$(CURDIR)/debian/$$v -- \
			--with-tcl=/usr/lib/tcl$$v \
			--with-tk=/usr/lib/tk$$v \
			--with-tcl-includes=/usr/include/tcl$$v \
			--enable-tclstub ; \
	done

override_dh_clean:
	dh_clean tclreadline.h tclreadline.n

override_dh_auto_install:
	for v in $(TCLVERSIONS) ; do \
		$(MAKE) -C$(CURDIR)/debian/$$v install DESTDIR=$(CURDIR)/debian/tmp ; \
		if [ "$$v" = "9.0" ] ; then \
			dest=$$(echo $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libtclreadline-*.so | sed -e 's/libtclreadline/libtcl9tclreadline/') ; \
			mv $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libtclreadline-*.so $$dest ; \
			ln -s $$(basename $$dest) $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libtcl9tclreadline.so ; \
		fi ; \
		mv $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.so $(CURDIR)/debian/tmp/usr/lib/tcltk/$(DEB_HOST_MULTIARCH)/*/ ; \
	done
	#
	# Fix up the architecture dependent include
	install -m 755 -d $(CURDIR)/debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)
	mv $(CURDIR)/debian/tmp/usr/include/*.h $(CURDIR)/debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)
	#
	# Fix up the manpage
	mv $(CURDIR)/debian/tmp/usr/share/man/mann/tclreadline.n \
	   $(CURDIR)/debian/tcl-tclreadline/usr/share/man/man3/tclreadline.3tcl
	sed -i -e 's/^\.TH tclreadline n/.TH tclreadline 3tcl/' \
	       -e 's/string ".*$(DEB_HOST_MULTIARCH).*"/directory string/g' \
	   $(CURDIR)/debian/tcl-tclreadline/usr/share/man/man3/tclreadline.3tcl
	#
	# Remove .la file
	rm $(CURDIR)/debian/tmp/usr/lib/*/*.la
	#
	# Remove empty directories
	find $(CURDIR)/debian/tmp -empty -prune -exec rmdir \{\} \;

override_dh_gencontrol:
	tcltk-depends
	dh_gencontrol

.PHONY: override_dh_auto_configure override_dh_clean override_dh_auto_install \
	override_dh_gencontrol