#!/usr/bin/make -f

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

DEB_HOST_ARCH_OS = $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)

confflags = --disable-silent-rules --enable-static
ifeq (,$(findstring linux,$(DEB_HOST_ARCH_OS)))
# wayland is only available on linux-any
confflags += --disable-wayland
endif

export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- $(confflags)

debian/dh/dh_libva.1:
	cd debian/dh && pod2man -c Debhelper -r '' dh_libva dh_libva.1

override_dh_auto_build: debian/dh/dh_libva.1
	dh_auto_build

debian/shlibs.local:
	echo "libva 1 libva1 (>= $(DEB_VERSION_UPSTREAM)), libva1 (<< $(DEB_VERSION_UPSTREAM).1)" > debian/shlibs.local

override_dh_shlibdeps: debian/shlibs.local
	dh_shlibdeps

override_dh_installchangelogs:
	dh_installchangelogs NEWS
