#!/usr/bin/make -f

XXV=xserver-xorg-video

# Install in debian/tmp to retain control through dh_install:
override_dh_auto_install:
	dh_auto_install --destdir=debian/tmp

# Kill *.la files, and forget no-one:
override_dh_install:
	find debian/tmp -name '*.la' -delete
	dh_install --fail-missing
	# Only enable KMS on some Linux architectures:
ifeq ($(DEB_HOST_ARCH_OS), linux)
ifneq (, $(filter $(DEB_HOST_ARCH), i386 amd64))
	dh_install -p$(XXV)-radeon debian/radeon-kms.conf \
		etc/modprobe.d
endif
endif

# Debug packages:
override_dh_strip:
	dh_strip -p$(XXV)-ati    --dbg-package=$(XXV)-ati-dbg
	dh_strip -p$(XXV)-radeon --dbg-package=$(XXV)-radeon-dbg

# That's a plugin, use appropriate warning level:
override_dh_shlibdeps:
	dh_shlibdeps -- --warnings=6

%:
	dh $@ --with quilt,autoreconf,xsf --builddirectory=build/ --parallel
