#!/usr/bin/make -f

DH_VERBOSE := 1

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
# Fixing reproducible builds
LC_ALL := C.UTF-8
export LC_ALL

export LIBRARY_VERSION=0.1

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- --enable-documentation

override_dh_auto_install:
	$(MAKE) DESTDIR=$(CURDIR)/debian/libcifpp0.1 install-lib
	$(MAKE) DESTDIR=$(CURDIR)/debian/libcifpp-dev install-dev

override_dh_auto_configure-arch:
	dh_auto_configure -- --enable-shared

override_dh_auto_configure-indep:
	dh_auto_configure -- --enable-shared

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	$(MAKE) test
endif

override_dh_install:
	## cleaning up dependency_libs filed in *.la files
	sed -i "/dependency_libs/ s/'.*'/''/" `find . -name '*.la'`
	dh_install

override_dh_makeshlibs:
	dh_makeshlibs -- -v$(LIBRARY_VERSION)
