4
LDFLAGS+= -Wl,--as-needed
7
ifneq ($(findstring $(DEB_BUILD_ARCH), sparc alpha),)
8
# sparc and alpha's gcc currently miscompiles; see
9
# http://lists.debian.org/debian-alpha/2007/11/msg00025.html
13
export DEB_BUILD_HARDENING=1
14
export DPKG_GENSYMBOLS_CHECK_LEVEL=4
16
# build should fail on test suite failures on all arches
17
TESTSUITE_FAIL_CMD=exit 1
23
override_dh_auto_configure:
24
dh_auto_configure -- \
25
--mandir=/usr/share/postgresql/$(MAJOR_VER)/man \
26
--with-docdir=/usr/share/doc/postgresql-doc-$(MAJOR_VER) \
27
--sysconfdir=/etc/postgresql-common \
28
--datadir=/usr/share/postgresql/$(MAJOR_VER) \
29
--bindir=/usr/lib/postgresql/$(MAJOR_VER)/bin \
30
--includedir=/usr/include/postgresql/ \
32
--enable-integer-datetimes \
33
--enable-thread-safety \
48
--with-tclconfig=/usr/lib/tcl$(TCL_VER) \
49
--with-tkconfig=/usr/lib/tk$(TCL_VER) \
50
--with-includes=/usr/include/tcl$(TCL_VER) \
51
--with-system-tzdata=/usr/share/zoneinfo \
56
override_dh_auto_build:
59
# generate POT files for translators
60
find -name nls.mk -exec sh -c "make -C \$$(dirname {}) init-po" \;
62
# build tutorial stuff
63
make -C src/tutorial NO_PGXS=1
65
override_dh_auto_install:
66
make install-world DESTDIR=$(CURDIR)/debian/tmp
68
override_dh_makeshlibs:
69
dh_makeshlibs -Xusr/lib/postgresql/$(MAJOR_VER)
71
override_dh_auto_clean:
72
[ ! -f GNUmakefile ] || dh_auto_clean
74
override_dh_installchangelogs:
75
dh_installchangelogs HISTORY
78
dh_compress -X.source -X.c
81
dh_install --fail-missing
83
if [ -d debian/postgresql-doc-$(MAJOR_VER) ]; then \
84
install src/tutorial/*.c src/tutorial/*.source src/tutorial/Makefile src/tutorial/README debian/postgresql-doc-$(MAJOR_VER)/usr/share/doc/postgresql-doc-$(MAJOR_VER)/tutorial; \
88
find debian/postgresql-$(MAJOR_VER)/usr/share/postgresql/$(MAJOR_VER)/man -type f -exec gzip -9 '{}' \;
90
find debian/postgresql-client-$(MAJOR_VER)/usr/share/postgresql/$(MAJOR_VER)/man -type f -exec gzip -9 '{}' \;
92
override_dh_auto_test:
93
ifeq (, $(findstring nocheck, $(DEB_BUILD_OPTIONS)))
94
# patch away the "don't execute as root" check for the test
95
# suite; doing it here will ensure that the actual debs have
98
patch --no-backup-if-mismatch -p1 < debian/disable-root-check.patch; \
99
make -C src/test/regress bigcheck || fail=1; \
100
patch --no-backup-if-mismatch -Rp1 < debian/disable-root-check.patch; \
101
if [ -n "$$fail" ]; then \
102
for l in regression.diffs log/initdb.log log/postmaster.log; do \
103
if [ -e src/test/regress/$$l ]; then \
104
echo "********* $$l *******"; \
105
cat src/test/regress/$$l; \
108
$(TESTSUITE_FAIL_CMD); \
113
dh_strip --dbg-package=postgresql-$(MAJOR_VER)-dbg
115
# run tests in contrib in temporary test installations, using programs
118
set -e; cd contrib; \
120
[ -d $$d/sql ] || continue; \
121
echo "============== Running tests in $$d"; \
123
if ! ../../src/test/regress/pg_regress --top-builddir=../.. --temp-install=tmp_check --dbname=contrib_regression `cd sql; ls *.sql | sed 's/.sql$$//'`; then \
124
cat regression.diffs; \
128
# run tests in contrib in temporary test installation, using programs
129
# from system installation
130
contrib-installcheck:
131
# set up temporary db
134
/usr/lib/postgresql/$(MAJOR_VER)/bin/initdb -D tmp_data
135
/usr/lib/postgresql/$(MAJOR_VER)/bin/pg_ctl -D tmp_data -l tmp_data/postgres.log -o '-k /tmp' start
136
# wait until it started up
137
while !/usr/lib/postgresql/$(MAJOR_VER)/bin/psql -h /tmp -l >/dev/null 2>&1; do sleep 1; done
139
while !/usr/lib/postgresql/$(MAJOR_VER)/bin/psql -h /tmp -l >/dev/null 2>&1; do sleep 1; done
141
-cd contrib; make installcheck
142
/usr/lib/postgresql/$(MAJOR_VER)/bin/pg_ctl -D tmp_data stop
143
# find and print the regression diffs
144
find contrib/ -name regression.diffs -exec cat '{}' \;