File: rules

package info (click to toggle)
db5.3 5.3.28%2Bdfsg2-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 158,620 kB
  • sloc: ansic: 448,573; java: 111,824; tcl: 80,544; sh: 44,264; cs: 33,697; cpp: 21,600; perl: 14,557; xml: 10,799; makefile: 4,028; javascript: 1,998; yacc: 1,003; awk: 965; sql: 801; erlang: 342; python: 216; php: 24; asm: 14
file content (178 lines) | stat: -rwxr-xr-x 5,397 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#!/usr/bin/make -f
# -*- makefile -*-
# debian/rules for Berkeley DB defaults
# Copyright (C) 2011 Ondřej Surý
# Published under the GNU GPL license
# Partially based on previous work by Clint Adams
#
# Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

export DH_ALWAYS_EXCLUDE=.arch-ids

include /usr/share/dpkg/architecture.mk

CONFIGURE_SWITCHES =    --prefix=/usr \
			--mandir=\$${prefix}/share/man \
			--localstatedir=/var \
			--sysconfdir=/etc \
			--libexecdir=/usr/lib \
			--enable-cxx \
			--enable-compat185 \
			--disable-java \
			--disable-sql \
			--disable-stl \
			--enable-dbm

ifeq (,$(filter pkg.db5.3.notcl,$(DEB_BUILD_PROFILES)))
  ENABLE_TESTS=yes
  CONFIGURE_SWITCHES += --enable-tcl
ifneq (,$(wildcard /usr/lib/$(DEB_HOST_MULTIARCH)/tcl*))
  CONFIGURE_SWITCHES += --with-tcl=/usr/lib/$(DEB_HOST_MULTIARCH)
else
  CONFIGURE_SWITCHES += --with-tcl=/usr/lib
endif
else
  ENABLE_TESTS=no
  CONFIGURE_SWITCHES += --disable-tcl
endif

ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
  ENABLE_TESTS=no
endif

ifeq (zx86_64-linux-gnuz,z$(DEB_HOST_GNU_TYPE)z)
  CONFIGURE_SWITCHES += --with-mutex=POSIX/pthreads/library
endif

BROKEN_CPUS = zs390z
VERY_BROKEN_CPUS = zhppaz
BROKEN_SYSTEMS = zgnuz

TCLSH=/usr/bin/tclsh

package=db5.3
bdbversion=5.3

version=$(shell expr `pwd` : '.*-\([0-9.]*\)')
version_major=$(shell expr `pwd` : '.*-\([0-9]*\).[0-9.]*')

LIBTOOL_AUX_FILES=config.guess config.sub install-sh ltmain.sh
LIBTOOL_MACROS_FILES=libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4

RECONF_FILES=dist/config.hin \
             dist/configure \
             $(patsubst %,dist/%,$(LIBTOOL_AUX_FILES)) \
             $(patsubst %,dist/aclocal/%,$(LIBTOOL_MACROS_FILES))

%:
	dh $@ $(DH_PLUGINS)

override_dh_auto_configure:
	if [ ! -d $(CURDIR)/debian/s_config ]; then \
	  mkdir -p $(CURDIR)/debian/s_config/dist/aclocal/; \
	fi
	for f in $(RECONF_FILES); do \
	  if [ ! -f $(CURDIR)/debian/s_config/$$f ]; then \
	    mv $(CURDIR)/$$f $(CURDIR)/debian/s_config/`dirname $$f`; \
	  fi; \
	done
	cd dist && libtoolize -cfi
	cd dist && ./s_config
ifeq ($(ENABLE_TESTS),yes)
	dh_auto_configure -Ddist -Bbuild-test -- $(CONFIGURE_SWITCHES) --enable-test
endif
	dh_auto_configure -Ddist -Bbuild-production -- $(CONFIGURE_SWITCHES) --disable-test

override_dh_auto_clean:
ifeq ($(ENABLE_TESTS),yes)
	dh_auto_clean -Ddist -Bbuild-test
endif
	dh_auto_clean -Ddist -Bbuild-production
	rm -f $(CURDIR)/debian/build_signature.txt
	for f in $(RECONF_FILES); do \
	  if [ -f $(CURDIR)/debian/s_config/$$f ]; then \
	    mv $(CURDIR)/debian/s_config/$$f $(CURDIR)/`dirname $$f`; \
	  fi; \
	done
	if [ -d $(CURDIR)/debian/s_config/ ]; then \
	  rmdir $(CURDIR)/debian/s_config/dist/aclocal/ \
	        $(CURDIR)/debian/s_config/dist/ \
	        $(CURDIR)/debian/s_config/; \
	fi

override_dh_auto_test:
ifeq (,$(findstring z$(DEB_BUILD_GNU_CPU)z,$(VERY_BROKEN_CPUS)))
ifeq ($(ENABLE_TESTS),yes)
	cd build-test && make cutest && ./cutest
	echo 'source ../test/tcl/test.tcl; run_std;' | tclsh

ifeq (,$(findstring z$(DEB_BUILD_GNU_CPU)z,$(BROKEN_CPUS))$(findstring z$(DEB_BUILD_GNU_SYSTEM)z,$(BROKEN_SYSTEMS)))
	! grep ^FAIL build-test/ALL.OUT
else
# Testsuite failures are marked as non-fatal on $(DEB_BUILD_GNU_SYSTEM)-$(DEB_BUILD_GNU_CPU)
	grep ^FAIL build-test/ALL.OUT || true
endif
else
# Testsuite has been disabled by DEB_BUILD_OPTIONS=$(DEB_BUILD_OPTIONS)
endif
else
# Testsuite has been disabled on $(DEB_BUILD_GNU_SYSTEM)-$(DEB_BUILD_GNU_CPU)
endif

override_dh_auto_install:
	dh_auto_install -Ddist -Bbuild-production

# Remove .la files
	rm -f $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.la

# Remove libdb*-5.so from all packages, we don't provide generic libdb5 packages
	rm -f $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libdb*5.so

# Reduce duplication in duplicate .a files by symlinking
	for v in "" _cxx _tcl; do \
	  rm -f debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libdb$$v.a; \
	  ln -s libdb$$v-$(bdbversion).a $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libdb$$v.a; \
	done

# only works for the native build
ifeq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH))
# Compare built-in signature and fail build if it is different
	cc ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} \
	   -o$(CURDIR)/debian/db_signature \
	   -I$(CURDIR)/debian/tmp/usr/include \
	     $(CURDIR)/debian/db_signature.c \
	     $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libdb.a

	$(CURDIR)/debian/db_signature > $(CURDIR)/debian/build_signature_$(DEB_HOST_ARCH).txt

	echo -n "Berkeley DB signature is:"; $(CURDIR)/debian/db_signature
endif

	for i in $(CURDIR)/debian/tmp/usr/bin/db_*; do \
	  mv $$i $$(echo $$i | sed -e 's{usr/bin/db_{usr/bin/$(package)_{'); \
	done

override_dh_install:
	dh_install -a -Xusr/doc --list-missing
ifeq (,$(filter pkg.db5.3.notcl,$(DEB_BUILD_PROFILES)))
	tcltk-depends
endif

override_dh_installdocs-indep:
	dh_installdocs -pdb5.3-doc

override_dh_installdocs-arch:
	dh_installdocs --link-doc=libdb5.3t64
ifeq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH))
	# Install build_signature_$(DEB_HOST_ARCH).txt to docs
	mkdir -p $(CURDIR)/debian/libdb5.3t64/usr/share/doc/libdb5.3t64/
	install -m 644 debian/build_signature_$(DEB_HOST_ARCH).txt $(CURDIR)/debian/libdb5.3t64/usr/share/doc/libdb5.3t64/
endif

override_dh_strip:
	dh_strip -s --dbg-package=libdb5.3-dbg

override_dh_clean:
	rm -rf build
	rm -f $(CURDIR)/debian/db_signature