#!/usr/bin/make -f
DESTDIR = $(CURDIR)/debian/tmp

include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/pkg-info.mk

DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)

export PYSHORT=python3
export PYTHON=$(shell which $(PYSHORT))
export PYTHON_CONFIG="$(PYTHON)-config"

%:
	dh $* $(BUILD_PACKAGES)

override_dh_auto_configure:
	dh_auto_configure -- \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \
		-DBUILD_ONLY="s3;transfer"

override_dh_auto_install:
	dh_auto_install
	fdupes -s debian/tmp/usr/lib/${DEB_HOST_MULTIARCH}/cmake
    
override_dh_missing:
	dh_missing --fail-missing
