#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# get-orig-source variables
SRC_VERSION := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(\([0-9]\+\):\)\?\(.*\)-.*/\3/p')
TARBALL = glmemperf_$(SRC_VERSION).orig.tar.gz

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

CFLAGS = -Wall $(shell dpkg-buildflags --get CFLAGS)

export CFLAGS

%:
	dh --with autoreconf $@
	
override_dh_auto_test:
	

get-orig-source:
	rm -rf get-orig-source $(TARBALL)
	mkdir get-orig-source
	git clone git://gitorious.org/meego-graphics/glmemperf.git get-orig-source/glmemperf-$(SRC_VERSION)
	cd get-orig-source/glmemperf-$(SRC_VERSION) && git checkout meego/$(SRC_VERSION)
	GZIP='--best --no-name' tar czf $(TARBALL) -C get-orig-source --exclude-vcs glmemperf-$(SRC_VERSION)
