3
# Sample debian/rules that uses debhelper.
5
# This file was originally written by Joey Hess and Craig Small.
6
# As a special exception, when this file is copied by dh-make into a
7
# dh-make output file, you may use that output file without restriction.
8
# This special exception was added by Craig Small in version 0.37 of dh-make.
10
# Modified to make a template file for a multi-binary package with separated
11
# build-arch and build-indep targets by Bill Allombert 2001
13
# Uncomment this to turn on verbose mode.
16
# This has to be exported to make some magic below work.
19
DPKG_EXPORT_BUILDFLAGS = 1
20
include /usr/share/dpkg/buildflags.mk
22
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
23
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
27
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
28
CC := $(DEB_HOST_GNU_TYPE)-$(CC)
29
CXX := $(DEB_HOST_GNU_TYPE)-$(CXX)
33
CXXFLAGS += -Wall -fpermissive
35
# Renesas SH(sh4) need -mieee option.
36
# If this option is not effective, NaN test failed.
37
ifeq (sh4,$(shell dpkg-architecture -qDEB_HOST_ARCH))
42
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
43
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
44
PAROPTS = -j$(NUMJOBS)
48
# end DEB_BUILD_OPTIONS
53
configure: configure-stamp
56
# Add here commands to configure the package.
65
build-arch: build-arch-stamp
66
build-arch-stamp: configure-stamp
68
# Add here commands to compile the arch part of the package.
72
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
73
$(MAKE) $(PAROPTS) check
76
# build the protoc manpage
4
dh $@ --with autoreconf,python2
6
override_dh_auto_build-arch:
9
# Generate the manpage.
77
10
xmlto man debian/protoc.xml
81
build-indep: build-indep-stamp
82
build-indep-stamp: build-arch-stamp
85
cd python && python setup.py build
13
cd python && python setup.py build --cpp_implementation
15
override_dh_auto_build-indep:
19
ant -f debian/java-build.xml jar
21
override_dh_auto_test-arch:
87
24
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
88
cd python && python setup.py test
27
export LD_LIBRARY_PATH=$(CURDIR)/src/.libs; \
28
cd python && for python in $(shell pyversions -r); do \
29
$$python setup.py test --cpp_implementation; \
92
# this code mimics mvn package. This should be changed when maven is supported by debian.
93
$(SHELL) /usr/bin/ant -f debian/java-build.xml jar
100
rm -f build-arch-stamp build-indep-stamp configure-stamp
102
# C++ bindings cleanups
103
[ ! -f Makefile ] || $(MAKE) distclean
105
# remove the built manpage
108
# Python bindings cleanups
109
cd python && python setup.py clean --all
33
override_dh_auto_test-indep:
36
override_dh_auto_clean-arch:
41
cd python && for python in $(shell pyversions -r); do \
42
$$python setup.py clean --all; \
110
44
rm -rf python/protobuf.egg-info
112
# Java bindings cleanups
113
$(SHELL) /usr/bin/ant -f debian/java-build.xml clean || true
119
install: install-indep install-arch
120
install-indep: build-indep
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 | \
46
override_dh_auto_clean-indep:
50
ant -f debian/java-build.xml clean || true
53
override_dh_auto_install-arch:
54
dh_auto_install --arch
58
cd python && for python in $(shell pyversions -r); do \
59
$$python setup.py install --cpp_implementation \
60
--install-layout=deb --no-compile \
61
--root=$(CURDIR)/debian/python-protobuf; \
63
find $(CURDIR)/debian/python-protobuf -name 'protobuf-*-nspkg.pth' -delete
65
override_dh_auto_install-indep:
66
dh_auto_install --indep
136
install-arch: build-arch
142
# Add here commands to install the arch part of the package into
144
$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
146
dh_install --sourcedir=debian/tmp -s
148
# convert doc dir to symlink for the dev packages
74
# Convert doc dir to symlink for the -dev packages.
149
75
rm -rf $(CURDIR)/debian/libprotobuf-dev/usr/share/doc/libprotobuf-dev
150
ln -s libprotobuf8 $(CURDIR)/debian/libprotobuf-dev/usr/share/doc/libprotobuf-dev
76
ln -s libprotobuf9 $(CURDIR)/debian/libprotobuf-dev/usr/share/doc/libprotobuf-dev
151
77
rm -rf $(CURDIR)/debian/libprotoc-dev/usr/share/doc/libprotoc-dev
152
ln -s libprotoc8 $(CURDIR)/debian/libprotoc-dev/usr/share/doc/libprotoc-dev
78
ln -s libprotoc9 $(CURDIR)/debian/libprotoc-dev/usr/share/doc/libprotoc-dev
154
# remove compiler headers from libprotobuf-dev
80
# Remove compiler headers from libprotobuf-dev.
155
81
rm -rf $(CURDIR)/debian/libprotobuf-dev/usr/include/google/protobuf/compiler
157
# remove .la files, as no other library depends on us
158
find $(CURDIR)/debian -name '*.la' -print0|xargs -r0 rm -f
160
# Must not depend on anything. This is to be called by
161
# binary-arch/binary-indep
162
# in another 'make' thread.
166
dh_installchangelogs CHANGES.txt
182
# Build architecture independant packages using the common target.
183
binary-indep: install-indep
184
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
186
# Build architecture dependant packages using the common target.
187
binary-arch: install-arch
188
$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
190
binary: binary-arch binary-indep
191
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure