~ubuntu-branches/debian/experimental/protobuf/experimental

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Package Import Robot
  • Author(s): Robert S. Edmonds, Micah Anderson, Colin Watson, Steve Langasek, Robert S. Edmonds
  • Date: 2013-10-12 18:32:37 UTC
  • mfrom: (1.3.1) (10.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20131012183237-jz6tvmj9tn68atrf
Tags: 2.5.0-1
[ Micah Anderson ]
* New upstream version. (Closes: #704731.)
* Update debian/watch.
* Refresh patches.

[ Colin Watson ]
* Use the autotools-dev dh addon to update config.guess/config.sub for
  arm64. (Closes: #725976.)

[ Steve Langasek ]
* Don't recommend protobuf-compiler from the bindings, it's not used and
  this doesn't need to be pulled in at runtime. (Closes: #703628.)
* Mark protobuf-compiler Multi-Arch: foreign; the output of this command
  is architecture-independent source, we don't need the version of the
  compiler to match the target arch.
* Bump to debhelper compat 9, so that our libs get installed to the
  multiarch locations.
* Mark the library packages Multi-Arch: same.
* Fix debian/rules to support cross-building of the python bindings.
* Build-depend on libpython-dev, not python-dev, for cross-build
  compatibility.
* (Closes: #726083.)

[ Robert S. Edmonds ]
* Upload to experimental.
* Bump ABI version from 7 to 8.
* Bump Standards-Version to 3.9.4.
* Convert from python-support to dh-python.
* Drop support for python2.6.
* python-protobuf: switch back to the pure Python implementation, as
  upstream appears to no longer be maintaining the current C++ based Python
  binding. See the following upstream issues for details:
  - https://code.google.com/p/protobuf/issues/detail?id=434
  - https://code.google.com/p/protobuf/issues/detail?id=503

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
# This has to be exported to make some magic below work.
17
17
export DH_OPTIONS
18
18
 
19
 
# DEB_BUILD_OPTIONS handling - is this really needed since dpkg-dev 1.14.17?
20
 
# note that the strip option is handled directly by dh_strip
21
 
CFLAGS = -Wall -g
22
 
 
23
 
ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
24
 
    CFLAGS += -O0
25
 
else
26
 
    CFLAGS += -O2
 
19
DPKG_EXPORT_BUILDFLAGS = 1
 
20
include /usr/share/dpkg/buildflags.mk
 
21
 
 
22
DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 
23
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 
24
 
 
25
CC  = gcc
 
26
CXX = g++
 
27
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
 
28
  CC  := $(DEB_HOST_GNU_TYPE)-$(CC)
 
29
  CXX := $(DEB_HOST_GNU_TYPE)-$(CXX)
27
30
endif
28
31
 
 
32
CFLAGS += -Wall
 
33
CXXFLAGS += -Wall -fpermissive
 
34
 
29
35
# Renesas SH(sh4) need -mieee option.
30
36
# If this option is not effective, NaN test failed.
31
37
ifeq (sh4,$(shell dpkg-architecture -qDEB_HOST_ARCH))
48
54
configure-stamp:
49
55
        dh_testdir
50
56
        # Add here commands to configure the package.
 
57
        dh_autotools-dev_updateconfig
51
58
        dh_auto_configure
52
59
        touch configure-stamp
53
60
 
66
73
        $(MAKE) $(PAROPTS) check
67
74
endif
68
75
 
69
 
        # python bindings
70
 
        cd python && \
71
 
          PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp python setup.py build
72
 
 
73
 
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
74
 
        # run tests via pure-python
75
 
        cd python && \
76
 
          PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python python setup.py test
77
 
        # run tests via the CPP implementation
78
 
        cd python && \
79
 
          PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp python setup.py test
80
 
endif
81
 
 
82
76
        # build the protoc manpage
83
77
        xmlto man debian/protoc.xml
84
78
 
87
81
build-indep: build-indep-stamp
88
82
build-indep-stamp: build-arch-stamp
89
83
 
 
84
        # python bindings
 
85
        cd python && python setup.py build
 
86
 
 
87
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
 
88
        cd python && python setup.py test
 
89
endif
 
90
 
90
91
        # java bindings
91
92
        # this code mimics mvn package. This should be changed when maven is supported by debian.
92
 
        $(SHELL) ./debian/ant-wrapper -f debian/java-build.xml jar
 
93
        $(SHELL) /usr/bin/ant -f debian/java-build.xml jar
93
94
 
94
95
        touch $@
95
96
 
109
110
        rm -rf python/protobuf.egg-info
110
111
 
111
112
        # Java bindings cleanups
112
 
        $(SHELL) ./debian/ant-wrapper -f debian/java-build.xml clean || true
 
113
        $(SHELL) /usr/bin/ant -f debian/java-build.xml clean || true
113
114
 
 
115
        dh_autotools-dev_restoreconfig
114
116
        dh_clean
 
117
        mh_clean
115
118
 
116
119
install: install-indep install-arch
117
120
install-indep: build-indep
120
123
        dh_prep -i
121
124
        dh_installdirs -i
122
125
 
 
126
        # python bindings
 
127
        cd python && \
 
128
                python setup.py install --install-layout=deb --no-compile \
 
129
                        --root=$(CURDIR)/debian/python-protobuf ; \
 
130
                        find $(CURDIR)/debian/python-protobuf -name 'protobuf-*-nspkg.pth' -print0 | \
 
131
                                xargs -r0 rm -f
 
132
 
123
133
        dh_install -i
124
 
 
 
134
        mh_install
125
135
 
126
136
install-arch: build-arch
127
137
        dh_testdir
137
147
 
138
148
        # convert doc dir to symlink for the dev packages
139
149
        rm -rf $(CURDIR)/debian/libprotobuf-dev/usr/share/doc/libprotobuf-dev
140
 
        ln -s libprotobuf7 $(CURDIR)/debian/libprotobuf-dev/usr/share/doc/libprotobuf-dev
 
150
        ln -s libprotobuf8 $(CURDIR)/debian/libprotobuf-dev/usr/share/doc/libprotobuf-dev
141
151
        rm -rf $(CURDIR)/debian/libprotoc-dev/usr/share/doc/libprotoc-dev
142
 
        ln -s libprotoc7 $(CURDIR)/debian/libprotoc-dev/usr/share/doc/libprotoc-dev
 
152
        ln -s libprotoc8 $(CURDIR)/debian/libprotoc-dev/usr/share/doc/libprotoc-dev
143
153
 
144
154
        # remove compiler headers from libprotobuf-dev
145
155
        rm -rf $(CURDIR)/debian/libprotobuf-dev/usr/include/google/protobuf/compiler
146
156
 
147
 
        # python bindings
148
 
        cd python && PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp \
149
 
          python setup.py install --no-compile \
150
 
            --root=$(CURDIR)/debian/python-protobuf ; \
151
 
          find $(CURDIR)/debian/python-protobuf \
152
 
            -name 'protobuf-*-nspkg.pth' -print0 | \
153
 
          xargs -r0 rm -f
154
 
        # cleanup RPATH from built bindings
155
 
        find $(CURDIR)/debian/python-protobuf -name '*.so' -print0 | \
156
 
          xargs -r0 chrpath -d
 
157
        # remove .la files, as no other library depends on us
 
158
        find $(CURDIR)/debian -name '*.la' -print0|xargs -r0 rm -f
157
159
 
158
160
# Must not depend on anything. This is to be called by
159
161
# binary-arch/binary-indep
169
171
        dh_strip
170
172
        dh_compress
171
173
        dh_fixperms
172
 
        dh_pysupport
 
174
        dh_python2
173
175
        dh_makeshlibs
174
176
        dh_installdeb
175
177
        dh_shlibdeps