File: rules

package info (click to toggle)
tdbc 1.1.13-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 948 kB
  • sloc: sh: 2,258; tcl: 1,486; ansic: 978; makefile: 77
file content (97 lines) | stat: -rwxr-xr-x 3,330 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
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

TCLVERSIONS = 8.6 9.0

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

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildflags.mk
DIR = $(shell pwd)/debian/tcl-tdbc

%:
	dh $@

clean:
	echo "cleaning up source directory"; \
	rm -fv libtdbc* ; \
	rm -fv debian/source/include-binaries ; \
	rm -fv debian/autoreconf.* ; \
	for v in $(TCLVERSIONS) ; do \
		rm -frv debian/$$v ; \
	done
	dh_clean


override_dh_auto_install:
	for v in $(TCLVERSIONS) ; do \
		dh_auto_install -B$(CURDIR)/debian/$$v ; \
	done
	find $(DIR) -name 'tdbcConfig.sh' -exec \
		sed -i -e 's/.*\(\(tdbc\|TDBC\)_\(BUILD_\|SRC_DIR\)[^=]*\).*/# \1 is not defined for Debian binary package because the source\/build dir is inaccessible/' \{\} \;
	# Fix up the manpages.
	cd $(DIR)/usr/share/man/mann && \
	for f in *.[n] ; do \
	     f2=$$(echo $$f | sed -e 's/\.[3n]/.3tcl/') ; \
	     if [ -L $$f ]; then \
			l=$$(readlink -n $$f | sed -e 's/\.[3n]/.3tcl/') ; \
			rm $$f ; \
			ln -sf $$l $$f2 ; \
	     else \
			cat $$f | sed -e 's/^\.TH \([^ ]\+\|"[^"]\+"\) [3n]/.TH \1 3tcl/' \
			       -e 's/\(Tk_[0-9A-Za-z]*\)(3)/\1(3tk)/g' \
			       -e 's/\([A-Z][0-9A-Za-z_]*\)(3)/\1(3tcl)/g' \
			       -e 's/send(n)/send(3tk)/g' \
			       -e 's/text(n)/text(3tk)/g' \
			       -e 's/tk(n)/tk(3tk)/g' \
			       -e 's/winfo(n)/winfo(3tk)/g' \
			       -e 's/(n)/(3tcl)/g' \
			       -e "s/\\N'244'/\\[^o]/g" \
			 >$$f2 ; \
            mv $$f2 ../man3/ ; \
			rm $$f ; \
	     fi ; \
	done ;\
	echo " ----> $(pwd)"; \
	cd .. ;\
	rmdir mann ; \
    	cd man3 ;\
	for f in * ; do \
        echo "mangling names in $$f" ; \
		cat $$f | sed	-e 's/tdbc(n)/tdbc(3tcl)/g' \
						-e 's/tdbc::mapSqlState(n)/tdbc::mapSqlState(3tcl)/g' \
						-e 's/tdbc::tokenize(n)/tdbc::tokenize(3tcl)/g' \
						-e 's/tdbc::statement(n)/tdbc::statement(3tcl)/g' \
						-e 's/tdbc::connection(n)/tdbc::connection(3tcl)/g' \
						-e 's/tdbc::resultset(n)/tdbc::resultset(3tcl)/g' \
                        -e 's/Tdbc_Init(3tcl)/Tdbc_Init(3)/g' \
				>tmpman; \
		mv tmpman $$f ; \
	done ;\
	find $(DIR) -empty -prune -exec rmdir \{\} \; ; \
	
override_dh_auto_configure:
	for v in $(TCLVERSIONS) ; do \
		dh_auto_configure -B$(CURDIR)/debian/$$v -- \
			 --with-tcl=/usr/lib/tcl$$v     \
                         --prefix=/usr                  \
                         --includedir=/usr/include	\
                         --mandir=/usr/share/man	\
                         --infodir=/usr/share/info	\
                         --sysconfdir=/etc              \
                         --localstatedir=/var           \
                         --libdir=/usr/lib/tcltk/$(DEB_HOST_MULTIARCH) \
                         --libexecdir=/usr/lib/tcltk/$(DEB_HOST_MULTIARCH) \
                         --disable-maintainer-mode 	\
			 --disable-dependency-tracking ; \
	done

.PHONY: override_dh_auto_install override_dh_auto_configure