File: rules

package info (click to toggle)
libphonenumber 8.13.51%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 108,244 kB
  • sloc: cpp: 53,546; xml: 50,081; java: 33,392; javascript: 31,267; ansic: 482; jsp: 228; sh: 62; makefile: 33
file content (55 lines) | stat: -rwxr-xr-x 2,316 bytes parent folder | download
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
#!/usr/bin/make -f

DEB_HOST_ARCH_BITS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

# see #980423
# extract the protobuf API version package and add it to d/control
# Needed because protobuf generated headers are only compatible with that version
protobufapi := $(shell dpkg-query -W -f '$${Provides}' libprotobuf-dev | grep -o 'protobuf-api-[^ ]*')

# virtual package to represent libphonenumber and protobuf ABI
protobufabi := $(shell dpkg-query -W -f '$${Depends}' libprotobuf-dev | sed -n 's/.*libprotobuf\([0-9]*\)\(t64\)\? .*/\1/p')
phonenumberprotoabi := libphonenumber8t64-protobuf$(protobufabi)
ifneq (,$(filter 64,$(DEB_HOST_ARCH_BITS))$(filter i386,$(DEB_HOST_ARCH)))
  phonenumberprotocompatabi := , libphonenumber8-protobuf$(protobufabi)
endif

execute_before_dh_gencontrol:
	echo 'libphonenumber:Provides=$(phonenumberprotoabi)$(phonenumberprotocompatabi)' >> debian/libphonenumber8.substvars
	echo 'protobuf:API=$(protobufapi)' >> debian/libphonenumber-dev.substvars

override_dh_makeshlibs:
	dh_makeshlibs -plibphonenumber8 -V '$(phonenumberprotoabi)'
	dh_makeshlibs --remaining-packages

# workaround cpp lib (arch any) depending on java lib (arch all)
# Build with C++14
override_dh_auto_configure:
	DH_INTERNAL_OPTIONS= dh_auto_configure -i -plibphonenumber8-java
	dh_auto_configure --sourcedirectory=cpp -- -DUSE_BOOST=OFF -DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations"

# disable parallelism during build in an attempt to resolve build failures
# see: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1003972#51
override_dh_auto_build:
	DH_INTERNAL_OPTIONS= dh_auto_build -i -plibphonenumber8-java
	ln -sf cpp-build-1.0-SNAPSHOT.jar tools/java/cpp-build/target/cpp-build-1.0-SNAPSHOT-jar-with-dependencies.jar
	ln -sf /usr/share/java/protobuf.jar tools/java/cpp-build/target/protobuf-java-debian.jar
	dh_auto_build --sourcedirectory=cpp --no-parallel

override_dh_auto_test-arch:
	dh_auto_test --sourcedirectory=cpp

override_dh_auto_install-arch:
	dh_auto_install --sourcedirectory=cpp

override_dh_auto_clean-arch:
	dh_auto_clean --sourcedirectory=cpp

# Do not compress PhoneNumberMetadata.xml as we need it uncompressed
override_dh_compress:
	dh_compress -X.xml