#!/usr/bin/make -f

%:
	dh --with kde $@


PACKAGE = plasmoid-kbstate
VERSION=$(shell parsechangelog | grep ^Version | awk -F": " '{print $$2}' | cut -d"-" -f1)
REV=$(shell echo $(VERSION) | awk -F"~svn" '{print $$2}')
GOS_TMP=$(CURDIR)/get-orig-source-tmp
TARBALL = $(PACKAGE)_$(VERSION).orig.tar.gz

.PHONY: get-orig-source
get-orig-source:
	rm -rf get-orig-source $(TARBALL)
	mkdir get-orig-source
	svn export -r $(REV) svn://anonsvn.kde.org/home/kde/trunk/kdereview/plasma/applets/kbstateapplet/ get-orig-source/$(PACKAGE)-$(VERSION)
	tar czf $(TARBALL) -C get-orig-source $(PACKAGE)-$(VERSION)
	rm -rf get-orig-source
	echo "  "$(TARBALL)" created; move it to the right destination to build the package"
