#!/usr/bin/make -f

%:
	dh $@ --with autoreconf

override_dh_auto_test:
ifeq "$(filter nocheck,$(DEB_BUILD_OPTIONS))" ""
	xvfb-run -a ./xctest
endif

REV=$(shell dpkg-parsechangelog | sed -rne 's,^Version: .*[+~]svn([0-9]+).*,\1,p')
VER=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p')
get-orig-source:
	rm -rf xclip-$(VER).orig
	svn -q export -r $(REV) https://xclip.svn.sourceforge.net/svnroot/xclip/trunk \
		xclip-$(VER).orig
	GZIP=--best tar -cz --owner root --group root --mode a+rX \
		-f xclip_$(VER).orig.tar.gz \
		xclip-$(VER).orig
	rm -r xclip-$(VER).orig
