#!/usr/bin/make -f
# -*- makefile -*-

# output every command that modifies files on the build system.
DH_VERBOSE = 1

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

#export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# package maintainers to append CFLAGS
#export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
#export DEB_CFLAGS_MAINT_APPEND  = -fPIC
# package maintainers to append LDFLAGS
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

override_dh_auto_build:
	sed -r 's|^PROTOBUF_CHECK_CMD = \$\(PKG_CONFIG\) --atleast-version=[^[:space:]]+ protobuf|PROTOBUF_CHECK_CMD = $(PKG_CONFIG) --atleast-version=3.0.0 protobuf|' -i Makefile
	make prefix=/usr
#	make shared_c prefix=/usr

override_dh_auto_test:
	echo "Skipping test"
#ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
#	make test_c
#endif

override_dh_auto_install:
	make install prefix=$(CURDIR)/debian/tmp/usr

%:
	dh $@ --parallel


.PHONY: override_dh_strip
override_dh_strip:
	dh_strip --dbg-package=libgrpc1-dbg
