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
|
#!/usr/bin/make -f
DEB_VERSION = $(shell dpkg-parsechangelog | sed -n -e '/^Version:/s/.*: //p')
MAJOR_VER := $(shell echo $(DEB_VERSION) | cut -f1,2 -d.)
# support both hardening-wrapper (for backports) and dpkg-buildflags
export DEB_BUILD_HARDENING = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie
DPKG_EXPORT_BUILDFLAGS = 1
-include /usr/share/dpkg/buildflags.mk
LDFLAGS+= -Wl,--as-needed
CFLAGS+= -fPIC -pie
ifneq ($(findstring $(DEB_BUILD_ARCH), sparc alpha),)
# sparc and alpha's gcc currently miscompiles; see
# http://lists.debian.org/debian-alpha/2007/11/msg00025.html
CFLAGS+=-O1
endif
COMMON_CONFIGURE_FLAGS= \
# build should fail on test suite failures on all arches
TESTSUITE_FAIL_CMD=exit 1
# hurd doesn't implement semaphores; succeed anyway so they at least have libpq5
# tests currently fail on kfreebsd-*
ifneq ($(filter $(DEB_BUILD_ARCH), hurd-i386 kfreebsd-amd64 kfreebsd-i386),)
TESTSUITE_FAIL_CMD=exit 0
endif
%:
dh $@ --parallel
override_dh_auto_configure:
./configure \
--mandir=/usr/share/postgresql/$(MAJOR_VER)/man \
--docdir=/usr/share/doc/postgresql-doc-$(MAJOR_VER) \
--sysconfdir=/etc/postgresql-common \
--datarootdir=/usr/share/ \
--datadir=/usr/share/postgresql/$(MAJOR_VER) \
--bindir=/usr/lib/postgresql/$(MAJOR_VER)/bin \
--libdir=/usr/lib/ \
--libexecdir=/usr/lib/postgresql/ \
--includedir=/usr/include/postgresql/ \
--enable-nls \
--enable-integer-datetimes \
--enable-thread-safety \
--enable-debug \
--disable-rpath \
--with-perl \
--with-gnu-ld \
--with-pgport=5432 \
--with-system-tzdata=/usr/share/zoneinfo \
--without-ossp-uuid \
--without-krb5 \
--without-gssapi \
--without-ldap \
--without-tcl \
--without-python \
--without-pam \
--without-openssl \
--without-libxml \
--without-libxslt \
CFLAGS='$(CFLAGS)' \
CPPFLAGS='$(CPPFLAGS)' \
LDFLAGS='$(LDFLAGS)'
override_dh_auto_install:
make install DESTDIR=$(CURDIR)/debian/tmp
override_dh_auto_clean:
[ ! -e GNUmakefile ] || $(MAKE) distclean
override_dh_auto_test:
ifeq (, $(findstring nocheck, $(DEB_BUILD_OPTIONS)))
if ! make -C src/pl/plperl -k check EXTRA_REGRESS_OPTS='--host=/tmp --port=$(shell perl -le 'print 1024 + int(rand(64000))')'; then \
for l in `find build -name regression.diffs -o -name initdb.log -o -name postmaster.log`; do \
echo "******** $$l ********"; \
tail -n100 $$l; \
done; \
$(TESTSUITE_FAIL_CMD); \
fi
endif
override_dh_builddeb:
dh_builddeb $(BINARY_BLACKLIST) -- -Zxz
|