#!/usr/bin/make -f

# Needed to find ChangeLog:
override_dh_auto_configure:
	dh_auto_configure -- CURDIR="$(CURDIR)"

# 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

# Debug package:
override_dh_strip:
	dh_strip --dbg-package=xserver-xorg-video-nouveau-dbg

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

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


# Build me a tarball:
get-orig-source:
	git clone git://anongit.freedesktop.org/git/nouveau/xf86-video-nouveau && \
	cd xf86-video-nouveau && git log > ChangeLog && \
	REVISION=$$(git show --pretty=format:"%h" HEAD | head -n1) && cd .. && \
	PREFIX=xserver-xorg-video-nouveau_0.0.16+git$$(date +%Y%m%d)+$$REVISION && \
	rm -rf xf86-video-nouveau/.git && \
	tar czf $$PREFIX.orig.tar.gz xf86-video-nouveau && \
	rm -rf xf86-video-nouveau
