| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
export DH_VERBOSE=1 |
| 10 |
|
| 11 |
export DEB_CFLAGS_MAINT_APPEND=-std=gnu17 |
| 12 |
|
| 13 |
export DH_ALWAYS_EXCLUDE=.arch-ids |
| 14 |
|
| 15 |
include /usr/share/dpkg/architecture.mk |
| 16 |
|
| 17 |
CONFIGURE_SWITCHES = --prefix=/usr \ |
| 18 |
--mandir=\$${prefix}/share/man \ |
| 19 |
--localstatedir=/var \ |
| 20 |
--sysconfdir=/etc \ |
| 21 |
--libexecdir=/usr/lib \ |
| 22 |
--enable-cxx \ |
| 23 |
--enable-compat185 \ |
| 24 |
--disable-java \ |
| 25 |
--disable-sql \ |
| 26 |
--disable-stl \ |
| 27 |
--enable-dbm |
| 28 |
|
| 29 |
ifeq (,$(filter pkg.db5.3.notcl,$(DEB_BUILD_PROFILES))) |
| 30 |
ENABLE_TESTS=yes |
| 31 |
CONFIGURE_SWITCHES += --enable-tcl |
| 32 |
ifneq (,$(wildcard /usr/lib/$(DEB_HOST_MULTIARCH)/tcl*)) |
| 33 |
CONFIGURE_SWITCHES += --with-tcl=/usr/lib/$(DEB_HOST_MULTIARCH) |
| 34 |
else |
| 35 |
CONFIGURE_SWITCHES += --with-tcl=/usr/lib |
| 36 |
endif |
| 37 |
else |
| 38 |
ENABLE_TESTS=no |
| 39 |
CONFIGURE_SWITCHES += --disable-tcl |
| 40 |
endif |
| 41 |
|
| 42 |
ifneq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 43 |
ENABLE_TESTS=no |
| 44 |
endif |
| 45 |
|
| 46 |
ifeq (zx86_64-linux-gnuz,z$(DEB_HOST_GNU_TYPE)z) |
| 47 |
CONFIGURE_SWITCHES += --with-mutex=POSIX/pthreads/library |
| 48 |
endif |
| 49 |
|
| 50 |
BROKEN_CPUS = zs390z |
| 51 |
VERY_BROKEN_CPUS = zhppaz |
| 52 |
BROKEN_SYSTEMS = zgnuz |
| 53 |
|
| 54 |
TCLSH=/usr/bin/tclsh |
| 55 |
|
| 56 |
package=db5.3 |
| 57 |
bdbversion=5.3 |
| 58 |
|
| 59 |
version=$(shell expr `pwd` : '.*-\([0-9.]*\)') |
| 60 |
version_major=$(shell expr `pwd` : '.*-\([0-9]*\).[0-9.]*') |
| 61 |
|
| 62 |
LIBTOOL_AUX_FILES=config.guess config.sub install-sh ltmain.sh |
| 63 |
LIBTOOL_MACROS_FILES=libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 lt~obsolete.m4 |
| 64 |
|
| 65 |
RECONF_FILES=dist/config.hin \ |
| 66 |
dist/configure \ |
| 67 |
$(patsubst %,dist/%,$(LIBTOOL_AUX_FILES)) \ |
| 68 |
$(patsubst %,dist/aclocal/%,$(LIBTOOL_MACROS_FILES)) |
| 69 |
|
| 70 |
%: |
| 71 |
dh $@ $(DH_PLUGINS) |
| 72 |
|
| 73 |
override_dh_auto_configure: |
| 74 |
if [ ! -d $(CURDIR)/debian/s_config ]; then \ |
| 75 |
mkdir -p $(CURDIR)/debian/s_config/dist/aclocal/; \ |
| 76 |
fi |
| 77 |
for f in $(RECONF_FILES); do \ |
| 78 |
if [ ! -f $(CURDIR)/debian/s_config/$$f ]; then \ |
| 79 |
mv $(CURDIR)/$$f $(CURDIR)/debian/s_config/`dirname $$f`; \ |
| 80 |
fi; \ |
| 81 |
done |
| 82 |
cd dist && libtoolize -cfi |
| 83 |
cd dist && ./s_config |
| 84 |
ifeq ($(ENABLE_TESTS),yes) |
| 85 |
dh_auto_configure -Ddist -Bbuild-test -- $(CONFIGURE_SWITCHES) --enable-test |
| 86 |
endif |
| 87 |
dh_auto_configure -Ddist -Bbuild-production -- $(CONFIGURE_SWITCHES) --disable-test |
| 88 |
|
| 89 |
override_dh_auto_clean: |
| 90 |
ifeq ($(ENABLE_TESTS),yes) |
| 91 |
dh_auto_clean -Ddist -Bbuild-test |
| 92 |
endif |
| 93 |
dh_auto_clean -Ddist -Bbuild-production |
| 94 |
rm -f $(CURDIR)/debian/build_signature.txt |
| 95 |
for f in $(RECONF_FILES); do \ |
| 96 |
if [ -f $(CURDIR)/debian/s_config/$$f ]; then \ |
| 97 |
mv $(CURDIR)/debian/s_config/$$f $(CURDIR)/`dirname $$f`; \ |
| 98 |
fi; \ |
| 99 |
done |
| 100 |
if [ -d $(CURDIR)/debian/s_config/ ]; then \ |
| 101 |
rmdir $(CURDIR)/debian/s_config/dist/aclocal/ \ |
| 102 |
$(CURDIR)/debian/s_config/dist/ \ |
| 103 |
$(CURDIR)/debian/s_config/; \ |
| 104 |
fi |
| 105 |
|
| 106 |
override_dh_auto_test: |
| 107 |
ifeq (,$(findstring z$(DEB_BUILD_GNU_CPU)z,$(VERY_BROKEN_CPUS))) |
| 108 |
ifeq ($(ENABLE_TESTS),yes) |
| 109 |
cd build-test && make cutest && ./cutest |
| 110 |
echo 'source ../test/tcl/test.tcl; run_std;' | tclsh |
| 111 |
|
| 112 |
ifeq (,$(findstring z$(DEB_BUILD_GNU_CPU)z,$(BROKEN_CPUS))$(findstring z$(DEB_BUILD_GNU_SYSTEM)z,$(BROKEN_SYSTEMS))) |
| 113 |
! grep ^FAIL build-test/ALL.OUT |
| 114 |
else |
| 115 |
|
| 116 |
grep ^FAIL build-test/ALL.OUT || true |
| 117 |
endif |
| 118 |
else |
| 119 |
|
| 120 |
endif |
| 121 |
else |
| 122 |
|
| 123 |
endif |
| 124 |
|
| 125 |
override_dh_auto_install: |
| 126 |
dh_auto_install -Ddist -Bbuild-production |
| 127 |
|
| 128 |
|
| 129 |
rm -f $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/*.la |
| 130 |
|
| 131 |
|
| 132 |
rm -f $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libdb*5.so |
| 133 |
|
| 134 |
|
| 135 |
for v in "" _cxx _tcl; do \ |
| 136 |
rm -f debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libdb$$v.a; \ |
| 137 |
ln -s libdb$$v-$(bdbversion).a $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libdb$$v.a; \ |
| 138 |
done |
| 139 |
|
| 140 |
|
| 141 |
ifeq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH)) |
| 142 |
|
| 143 |
cc ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} \ |
| 144 |
-o$(CURDIR)/debian/db_signature \ |
| 145 |
-I$(CURDIR)/debian/tmp/usr/include \ |
| 146 |
$(CURDIR)/debian/db_signature.c \ |
| 147 |
$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libdb.a |
| 148 |
|
| 149 |
$(CURDIR)/debian/db_signature > $(CURDIR)/debian/build_signature_$(DEB_HOST_ARCH).txt |
| 150 |
|
| 151 |
echo -n "Berkeley DB signature is:"; $(CURDIR)/debian/db_signature |
| 152 |
endif |
| 153 |
|
| 154 |
for i in $(CURDIR)/debian/tmp/usr/bin/db_*; do \ |
| 155 |
mv $$i $$(echo $$i | sed -e 's{usr/bin/db_{usr/bin/$(package)_{'); \ |
| 156 |
done |
| 157 |
|
| 158 |
override_dh_install: |
| 159 |
dh_install -a -Xusr/doc --list-missing |
| 160 |
ifeq (,$(filter pkg.db5.3.notcl,$(DEB_BUILD_PROFILES))) |
| 161 |
tcltk-depends |
| 162 |
endif |
| 163 |
|
| 164 |
override_dh_installdocs-indep: |
| 165 |
dh_installdocs -pdb5.3-doc |
| 166 |
|
| 167 |
override_dh_installdocs-arch: |
| 168 |
dh_installdocs --link-doc=libdb5.3t64 |
| 169 |
ifeq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH)) |
| 170 |
|
| 171 |
mkdir -p $(CURDIR)/debian/libdb5.3t64/usr/share/doc/libdb5.3t64/ |
| 172 |
install -m 644 debian/build_signature_$(DEB_HOST_ARCH).txt $(CURDIR)/debian/libdb5.3t64/usr/share/doc/libdb5.3t64/ |
| 173 |
endif |
| 174 |
|
| 175 |
override_dh_strip: |
| 176 |
dh_strip -s --dbg-package=libdb5.3-dbg |
| 177 |
|
| 178 |
override_dh_clean: |
| 179 |
dh_clean |
| 180 |
rm -rf build |
| 181 |
rm -f $(CURDIR)/debian/db_signature |