~barry/ubuntu/precise/dbus-python/python3-from-upstream

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Barry Warsaw
  • Date: 2012-01-12 16:13:41 UTC
  • Revision ID: barry@python.org-20120112161341-yco9ds2oxl4mr9x9
* debian/patches:
  - since-0.84.0.patch: Upstream unreleased changes from git tag
    dbus-python-0.84.0 to HEAD.  This is a precursor to the following.
  - python3-support.patch: Upstream unreleased changes from git
    `python3` branch for supporting Python 3. (LP: #893091)
* debian/rules: Enable the test suite.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
# Copyright � 2003 Daniel Stone <daniels@debian.org>
4
4
# Copyright � 2006 Sjoerd Simons <sjoerd@debian.org>
5
5
 
 
6
DH_VERBOSE=1
 
7
 
6
8
# These are used for cross-compiling and for saving the configure script
7
9
# from having to guess our platform (since we know it already)
8
10
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
13
15
PYVERS := $(shell pyversions --requested --version debian/control)
14
16
PYDEFAULTVER := $(shell pyversions --default --version)
15
17
 
 
18
PY3VERS := $(shell py3versions --requested --version debian/control)
 
19
PY3DEFAULTVER := $(shell py3versions --default --version)
 
20
 
16
21
ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
17
22
        CONFIGURE_FLAGS += --build=$(DEB_BUILD_GNU_TYPE)
18
23
else
47
52
build-%/build-stamp: build-%/configure-stamp
48
53
        dh_testdir
49
54
        PYTHON=/usr/bin/python$* $(MAKE) -C build-$*
 
55
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
 
56
        $(MAKE) -C build-$* check
 
57
endif
50
58
        touch $@
51
59
 
52
60
build-doc/build-doc-stamp: build-doc/configure-stamp
56
64
 
57
65
build: build-arch
58
66
#build: build-indep
59
 
build-arch: $(PYVERS:%=build-%/build-stamp) $(PYVERS:%=build-%-dbg/build-stamp)
 
67
 
 
68
build-arch: $(PYVERS:%=build-%/build-stamp) \
 
69
            $(PYVERS:%=build-%-dbg/build-stamp) \
 
70
            $(PY3VERS:%=build-%/build-stamp) \
 
71
            $(PY3VERS:%=build-%-dbg/build-stamp)
 
72
 
60
73
build-indep: build-doc/build-doc-stamp
61
74
 
62
75
install-clean:
64
77
        dh_testroot
65
78
        dh_prep
66
79
 
67
 
install-%: build-%/build-stamp
 
80
install-%:
68
81
        dh_testdir
69
82
        dh_testroot
70
 
        $(MAKE) -C build-$* install DESTDIR=$(CURDIR)/debian/python-dbus
 
83
        $(MAKE) -C build-$* install DESTDIR=$(CURDIR)/debian/tmp
71
84
        # keep a copy of /usr/include/debian-python.h and
72
85
        # /usr/lib/pkgconfig/debian-python.pc to verify they match later
73
 
        cp debian/python-dbus/usr/include/dbus-1.0/dbus/dbus-python.h debian/tmp-$*.h
74
 
        cp debian/python-dbus/usr/lib/pkgconfig/dbus-python.pc debian/tmp-$*.pc
 
86
        cp debian/tmp/usr/include/dbus-1.0/dbus/dbus-python.h debian/tmp-$*.h
 
87
        cp debian/tmp/usr/lib/pkgconfig/dbus-python.pc debian/tmp-$*.pc
75
88
 
76
 
dbg-install-%: build-%-dbg/build-stamp
 
89
dbg-install-%:
77
90
        dh_testdir
78
91
        dh_testroot
79
 
        $(MAKE) -C build-$*-dbg install DESTDIR=$(CURDIR)/debian/python-dbus-dbg
80
 
        find debian/python-dbus-dbg ! -type d ! -name '*.so' -print0 | xargs -0 rm -f
81
 
        find debian/python-dbus-dbg -depth -empty -exec rmdir {} \;
 
92
        $(MAKE) -C build-$*-dbg install DESTDIR=$(CURDIR)/debian/python-dbus-$*-dbg
 
93
        find debian/python-dbus-$*-dbg ! -type d ! -name '*.so' -print0 | xargs -0 rm -f
 
94
        find debian/python-dbus-$*-dbg -depth -empty -exec rmdir {} \;
 
95
        for i in $$(find debian/python-dbus-$*-dbg -name '*.so'); do \
 
96
                b=$$(basename $$i .so); \
 
97
                mv $$i $$(dirname $$i)/$${b}_d.so; \
 
98
        done
82
99
 
83
 
install-arch: build-arch install-clean $(PYVERS:%=install-%) $(PYVERS:%=dbg-install-%)
84
 
        rm -f debian/python-dbus/usr/lib/python*/*-packages/*.la
85
 
        rm -rf debian/python-dbus/usr/share/doc/deleteme
86
 
        rm -f debian/python-dbus-dbg/usr/lib/python*/*-packages/*.la
87
 
        rm -rf debian/python-dbus-dbg/usr/share/doc/deleteme
 
100
install-arch: build-arch install-clean \
 
101
              $(PYVERS:%=install-%) $(PYVERS:%=dbg-install-%) \
 
102
              $(PY3VERS:%=install-%) $(PY3VERS:%=dbg-install-%)
 
103
        rm -f debian/tmp/usr/lib/python*/*-packages/*.la
 
104
        rm -rf debian/tmp/usr/share/doc/deleteme
88
105
        # compare installed .pc and .h, asserting that the ones all versions
89
106
        # wanted are the same as what we ended up with
90
 
        for v in $(PYVERS); do \
91
 
                diff --brief debian/python-dbus/usr/include/dbus-1.0/dbus/dbus-python.h \
 
107
        for v in $(PYVERS) $(PY3VERS); do \
 
108
                diff --brief debian/tmp/usr/include/dbus-1.0/dbus/dbus-python.h \
92
109
                        debian/tmp-$$v.h || exit 1; \
93
 
                diff --brief debian/python-dbus/usr/lib/pkgconfig/dbus-python.pc \
 
110
                diff --brief debian/tmp/usr/lib/pkgconfig/dbus-python.pc \
94
111
                        debian/tmp-$$v.pc || exit 1; \
95
112
        done
96
113
        rm -f debian/tmp-*.pc debian/tmp-*.h
97
 
        for i in $$(find debian/python-dbus-dbg -name '*.so'); do \
98
 
                b=$$(basename $$i .so); \
99
 
                mv $$i $$(dirname $$i)/$${b}_d.so; \
100
 
        done
101
114
 
102
115
clean::
103
116
        dh_testdir
141
154
        dh_link -s
142
155
        dh_compress -s -X.py -X.js
143
156
        dh_fixperms -s
144
 
        dh_python2 -s
 
157
        dh_python2 -s -v
 
158
        dh_python3 -s -v
145
159
        dh_installdeb -s
146
160
        dh_shlibdeps -s
147
161
        dh_gencontrol -s
149
163
        dh_builddeb -s
150
164
 
151
165
binary: binary-arch binary-indep
 
166
        autoreconf
 
167
 
152
168
.PHONY: build clean binary-indep binary-arch binary install-arch install-clean