File: rules

package info (click to toggle)
libtk-img 1%3A1.4.8%2Bdfsg-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 36,372 kB
  • sloc: ansic: 191,258; sh: 27,200; tcl: 6,948; asm: 3,560; makefile: 1,757; cpp: 1,736; ada: 1,681; pascal: 1,139; cs: 879; awk: 782; perl: 104; xml: 95
file content (89 lines) | stat: -rwxr-xr-x 2,539 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

v=1.4.7
pkgdir=$(shell pwd)/debian/tmp
libdir=$(pkgdir)/usr/lib/$(DEB_HOST_MULTIARCH)

%:
	dh $@

override_dh_clean:
	[ ! -f Makefile ] || $(MAKE) distclean
	rm -rf libtiff/tcl/port
	rm -rf libtiff/tcl/man
	rm -rf libtiff/tcl/libtiff
	rm -f libjpeg/jconfig.h
	rm -f libtiff/tcl/tools/Makefile
	find . -name "*.so" | xargs rm -f
	find . -name "*.a" | xargs rm -f
	find . -name config.status | xargs rm -f
	find . -name config.log | xargs rm -f
	dh_clean

override_dh_auto_configure:
	cp /usr/include/$(DEB_HOST_MULTIARCH)/jconfig.h libjpeg/
	CFLAGS="$(CFLAGS)" \
	CPPFLAGS="$(CPPFLAGS)" \
	LDFLAGS="$(LDFLAGS)" \
	dh_auto_configure -- \
		--with-tcl=/usr/lib/$(DEB_HOST_MULTIARCH) \
		--with-tk=/usr/lib/$(DEB_HOST_MULTIARCH) \
		--with-tkinclude=/usr/include/tcl \
                --enable-threads

override_dh_auto_build:
	$(MAKE) TCL_INC_DIR=/usr/include/tcl/tcl-private/generic \
		TK_INC_DIR=/usr/include/tcl/tk-private/generic

override_dh_auto_install:
	$(MAKE) install INSTALL_ROOT=$(pkgdir)
	#
	# Fix file permissions
	find $(libdir) -type f | xargs chmod a-x
	#
	# Fix pkgIndex.tcl to prevent loading package to Tk 8.3 or older
	sed -i -e'1i\
	# Tcl package index file\
	#\
	# Return if Tcl/Tk is old.\
	#\
	if {[package vcompare [info tclversion] 8.5] < 0} return\
	' $(libdir)/Img*/pkgIndex.tcl
	#
	# Move library into tcltk subdirectory
	install -m 755 -d $(libdir)/../tcltk/$(DEB_HOST_MULTIARCH)
	mv $(libdir)/Img* $(libdir)/../tcltk/$(DEB_HOST_MULTIARCH)
	#
	# Fix *Config.sh
	DIR=`ls -d $(libdir)/../tcltk/$(DEB_HOST_MULTIARCH)/Img*` ; \
	PKGDIR=`basename $$DIR` ; \
	for f in $(libdir)/*Config.sh ; do \
	  sed -i -e "s:\(/[^/]*\)\+\([ /]\):/usr/lib/tcltk/$(DEB_HOST_MULTIARCH)/$$PKGDIR\2:" $$f || exit 1; \
	done
	#
	# Cleanup manpages
	(cd $(pkgdir)/usr/share/man/mann && \
	  for f in *.n ; do \
	    sed -e's/^\.TH \([^ ]\+\) n/.TH \1 3tk/' \
		-e's/\xc2\xad //' \
		$$f > `basename $$f .n`.3tk || exit 1; \
	  done)
	#
	# Rename img to img-intro since it's refered as img-intro
	mv $(pkgdir)/usr/share/man/mann/img.3tk $(pkgdir)/usr/share/man/mann/img-intro.3tk

override_dh_auto_test:
	# Disable tests because they require X

override_dh_fixperms-indep:
	dh_fixperms
	chmod a-x debian/libtk-img-doc/usr/share/doc/libtk-img-doc/examples/msgs/*

override_dh_compress:
	dh_compress -X.tcl

.PHONY: override_dh_clean override_dh_auto_build override_dh_auto_install \
	override_dh_auto_test override_dh_fixperms-indep override_dh_compress