File: rules

package info (click to toggle)
tdom 0.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,928 kB
  • sloc: ansic: 46,086; xml: 19,231; tcl: 3,405; sh: 630; makefile: 84; cpp: 30
file content (135 lines) | stat: -rwxr-xr-x 4,907 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
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
#export DH_OPTIONS=-v

# Hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# Multiarch support
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

%:
	dh  $@

# Obtaining the source
version=0.9.0

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

# Extract version information from autoconf meta-data

VERSION=$(shell grep -m 1 AC_INIT configure.in | sed -e 's/AC_INIT(\[tdom\], \[//g' -e 's/\])//g')
DEV=$(CURDIR)/debian/tdom-dev
ARCH_DEPENDENT=$(CURDIR)/debian/tdom/usr/lib/tcltk/$(DEB_HOST_MULTIARCH)

override_dh_auto_configure:
	# Add here commands to configure the package.
	( cd unix ; ../configure --host=$(DEB_HOST_GNU_TYPE) \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--prefix=$(CURDIR)/debian/tdom/usr \
		--mandir=\$${prefix}/share/man \
		--infodir=\$${prefix}/share/info \
		--with-tcl=/usr/lib/$(DEB_HOST_MULTIARCH)/ \
		--libdir=\$${prefix}/lib/tcltk/$(DEB_HOST_MULTIARCH) \
		--enable-threads \
		--includedir=$(DEV)/usr/include/tdom \
		--with-expat=/usr \
		--enable-html5 )

	( cd extensions/tnc ; ./configure \
		--host=$(DEB_HOST_GNU_TYPE) \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--prefix=$(CURDIR)/debian/tdom/usr \
		--mandir=\$${prefix}/share/man \
		--infodir=\$${prefix}/share/info \
		--with-tcl=/usr/lib/$(DEB_HOST_MULTIARCH)/ \
		--libdir=\$${prefix}/lib/tcltk/$(DEB_HOST_MULTIARCH) \
		--enable-threads \
		--includedir=$(DEV)/usr/include/tdom )

	( cd extensions/tdomhtml ; ./configure \
		--host=$(DEB_HOST_GNU_TYPE) \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--prefix=$(CURDIR)/debian/tdom/usr \
		--mandir=\$${prefix}/share/man \
		--infodir=\$${prefix}/share/info \
		--libdir=\$${prefix}/lib/tcltk/$(DEB_HOST_MULTIARCH) \
		--includedir=$(DEV)/usr/include/tdom )

override_dh_auto_build:
	# Add here commands to compile the package.
	( cd unix ; $(MAKE) )
	( cd extensions/tnc ; $(MAKE) )
	( cd extensions/tdomhtml ; $(MAKE) )
	#/usr/bin/docbook-to-man debian/tdom.sgml > tdom.1
	touch build-stamp

override_dh_clean:
	rm -f build-stamp

	# Add here commands to clean up after the build process.
	-( cd unix; [ ! -f Makefile ] || $(MAKE) distclean; )
	-( cd extensions/tnc; [ ! -f Makefile ] || $(MAKE) distclean; )
	-( cd extensions/tdomhtml; [ ! -f Makefile ] || $(MAKE) distclean; )

	dh_clean config.log config.status config.cache config.guess config.sub

override_dh_auto_install:
	# Add here commands to install the package into debian/tdom.
	# ( cd unix/ ; $(MAKE) install DESTDIR=$(CURDIR)/debian/tdom/ )
	( cd unix/ ; $(MAKE) install )
	( cd extensions/tnc ; $(MAKE) install )
	( cd extensions/tdomhtml ; $(MAKE) install)

	# remove >empty< man page for tdomhtml extension (note, there
	# is no --without-man target available)
	rm -f $(CURDIR)/debian/tdom/usr/share/man/mann/tdomhtml.n

	# fix man pages (mann > man3)
	mv $(CURDIR)/debian/tdom/usr/share/man/mann \
	$(CURDIR)/debian/tdom/usr/share/man/man3
	(cd $(CURDIR)/debian/tdom/usr/share/man/man3 && \
		for f in ./*; do \
		     	f2=$$(echo $$f | sed -e 's/\.n/\.3tcl/'); \
		 	cat $$f | sed -e 's/^\.TH \([^ ]\+\|"[^"]\+"\) \(3\|n\)/.TH \1 3tcl/' > $$f2; \
			rm $$f; \
		done)
	# tdom-dev
	# install -d -m 755 -o root -g root $(DEV)/usr/include/tdom
	# cp -R $(TARGET)/usr/include/tdom/* $(DEV)/usr/include/tdom

	# move and fix tdomConfig.sh
	install -d -m 755 -o root -g root $(DEV)/usr/lib/tcltk/$(DEB_HOST_MULTIARCH)/tdom$(VERSION)
	mv $(ARCH_DEPENDENT)/tdomConfig.sh $(DEV)/usr/lib/tcltk/$(DEB_HOST_MULTIARCH)/tdom$(VERSION)/

	perl -i -p \
	-e "s|^(TDOM_BUILD_STUB_LIB_SPEC)=.*$$|\1='-L/usr/lib/tcltk/$(DEB_HOST_MULTIARCH)/tdom$(VERSION) -ltdomstub$(VERSION)'|;" \
	-e "s|^(TDOM_BUILD_STUB_LIB_PATH)=.*$$|\1='/usr/lib/tcltk/$(DEB_HOST_MULTIARCH)/tdom$(VERSION)/libtdomstub$(VERSION).a'|;" \
	-e "s|^(TDOM_STUB_LIB_SPEC)=.*$$|\1='-L/usr/lib/tcltk/$(DEB_HOST_MULTIARCH)/tdom$(VERSION) -ltdomstub$(VERSION)'|;" \
	-e "s|^(TDOM_STUB_LIB_PATH)=.*$$|\1='/usr/lib/tcltk/$(DEB_HOST_MULTIARCH)/tdom$(VERSION)/libtdomstub$(VERSION).a'|;" \
	$(DEV)/usr/lib/tcltk/$(DEB_HOST_MULTIARCH)/tdom$(VERSION)/tdomConfig.sh

	#install -d -m 755 -o root -g root $(DEV)/usr/lib/tcltk/tdom$(VERSION)

	# `- provide symlinks
	(cd $(DEV)/usr/lib/$(DEB_HOST_MULTIARCH); \
	ln -sf ../../lib/tcltk/$(DEB_HOST_MULTIARCH)/tdom$(VERSION)/tdomConfig.sh;)

	# move tDOM stub library
	mv $(ARCH_DEPENDENT)/tdom$(VERSION)/*.a $(DEV)/usr/lib/tcltk/$(DEB_HOST_MULTIARCH)/tdom$(VERSION)/

override_dh_installchangelogs:
	dh_installchangelogs ChangeLog

override_dh_installdeb:
	dh_installdeb
	tcltk-depends

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	(cd unix/; $(MAKE) test)
endif