~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-39rdwwu19bi24cw5
Tags: 9.1~beta1-2
* debian/control: Add missing ${misc:Depends} to -dbg.
* Bump Standards-Version to 3.9.2 (no changes necessary).
* debian/rules: Fix FTBFS with only-binary (-B) builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f 
 
2
TCL_VER := 8.5
 
3
MAJOR_VER := 9.1
 
4
LDFLAGS+= -Wl,--as-needed
 
5
CFLAGS+= -fPIC
 
6
 
 
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
 
10
    CFLAGS+=-O1
 
11
endif
 
12
 
 
13
export DEB_BUILD_HARDENING=1
 
14
export DPKG_GENSYMBOLS_CHECK_LEVEL=4
 
15
 
 
16
# build should fail on test suite failures on all arches
 
17
TESTSUITE_FAIL_CMD=exit 1
 
18
 
 
19
 
 
20
%:
 
21
        dh $@
 
22
 
 
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/ \
 
31
  --enable-nls \
 
32
  --enable-integer-datetimes \
 
33
  --enable-thread-safety \
 
34
  --enable-debug \
 
35
  --disable-rpath \
 
36
  --with-tcl \
 
37
  --with-perl \
 
38
  --with-python \
 
39
  --with-pam \
 
40
  --with-krb5 \
 
41
  --with-gssapi \
 
42
  --with-openssl \
 
43
  --with-libxml \
 
44
  --with-libxslt \
 
45
  --with-ldap \
 
46
  --with-ossp-uuid \
 
47
  --with-gnu-ld \
 
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 \
 
52
  --with-pgport=5432 \
 
53
  CFLAGS='$(CFLAGS)' \
 
54
  LDFLAGS='$(LDFLAGS)'
 
55
 
 
56
override_dh_auto_build:
 
57
        make world
 
58
 
 
59
        # generate POT files for translators
 
60
        find -name nls.mk -exec sh -c "make -C \$$(dirname {}) init-po" \;
 
61
 
 
62
        # build tutorial stuff
 
63
        make -C src/tutorial NO_PGXS=1
 
64
 
 
65
override_dh_auto_install:
 
66
        make install-world DESTDIR=$(CURDIR)/debian/tmp
 
67
 
 
68
override_dh_makeshlibs:
 
69
        dh_makeshlibs -Xusr/lib/postgresql/$(MAJOR_VER)
 
70
 
 
71
override_dh_auto_clean:
 
72
        [ ! -f GNUmakefile ] || dh_auto_clean   
 
73
 
 
74
override_dh_installchangelogs:
 
75
        dh_installchangelogs HISTORY
 
76
 
 
77
override_dh_compress:
 
78
        dh_compress -X.source -X.c
 
79
 
 
80
override_dh_install:
 
81
        dh_install --fail-missing
 
82
 
 
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; \
 
85
        fi
 
86
 
 
87
        # compress manpages
 
88
        find debian/postgresql-$(MAJOR_VER)/usr/share/postgresql/$(MAJOR_VER)/man -type f -exec gzip -9 '{}' \;
 
89
 
 
90
        find debian/postgresql-client-$(MAJOR_VER)/usr/share/postgresql/$(MAJOR_VER)/man -type f -exec gzip -9 '{}' \;
 
91
 
 
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
 
96
        # the check.
 
97
        set -e; \
 
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; \
 
106
                fi; \
 
107
            done; \
 
108
            $(TESTSUITE_FAIL_CMD); \
 
109
        fi
 
110
endif
 
111
 
 
112
override_dh_strip:
 
113
        dh_strip --dbg-package=postgresql-$(MAJOR_VER)-dbg
 
114
 
 
115
# run tests in contrib in temporary test installations, using programs
 
116
# from local tree
 
117
contrib-check:
 
118
        set -e; cd contrib; \
 
119
        for d in *; do \
 
120
            [ -d $$d/sql ] || continue; \
 
121
            echo "==============  Running tests in $$d"; \
 
122
            (cd $$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; \
 
125
            fi); \
 
126
        done
 
127
 
 
128
# run tests in contrib in temporary test installation, using programs
 
129
# from system installation
 
130
contrib-installcheck:
 
131
        # set up temporary db
 
132
        rm -rf tmp_data
 
133
        mkdir tmp_data
 
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
 
138
        sleep 1
 
139
        while !/usr/lib/postgresql/$(MAJOR_VER)/bin/psql -h /tmp -l >/dev/null 2>&1; do sleep 1; done
 
140
        # run the tests
 
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 '{}' \;