#!/usr/bin/make -f %: 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 phonenumberprotoabi := libphonenumber8-protobuf$(shell dpkg-query -W -f '$${Depends}' libprotobuf-dev | sed -n 's/.*libprotobuf\([0-9]*\) .*/\1/p') execute_before_dh_gencontrol: echo 'libphonenumber:Provides=$(phonenumberprotoabi)' >> 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) override_dh_auto_configure: DH_INTERNAL_OPTIONS= dh_auto_configure -i -plibphonenumber8-java dh_auto_configure --sourcedirectory=cpp -- -DUSE_BOOST=OFF # 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