+# Elements for regeneration of the orig tarball using the get-orig-source target
+PKD = $(abspath $(dir $(MAKEFILE_LIST)))/
+PKG = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source))
+VER ?= $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\-\d+.*)};')
+
+.PHONY: get-orig-source
+get-orig-source: $(info I: $(PKG)_$(VER))
+ @echo "# Downloading..."
+ [ -f $(PKD)../../selenium_$(VER).orig.tar.gz ] || (cd $(PKD)/../../ ; wget -O - http://selenium.googlecode.com/files/selenium-server-standalone-$(VER).jar > selenium/selenium-server.jar ; tar cvzf selenium_$(VER).orig.tar.gz selenium/selenium-server.jar)
+