#!/usr/bin/make -f

%:
	dh $@

override_dh_install:
	dh_install
	# Remove extra licence files:
	find $(CURDIR)/debian/fretsonfire-songs-sectoid -name License.txt -exec rm {} \;

ORIG_VERSION=$(shell head -n1 debian/changelog  | sed 's/[a-zA-Z0-9-]* (\(.*\)-\([^-]\)*) .*/\1/')

../Sectoid_Frets_on_Fire_Song_Pack.zip:
	wget -O $@ http://www.nivel21.net/personal/sectoid/fretsonfire/Sectoid_Frets_on_Fire_Song_Pack.zip

get-orig-source: ../Sectoid_Frets_on_Fire_Song_Pack.zip
	rm -rf fretsonfire-songs-sectoid-$(ORIG_VERSION) "Escape from chaosland" "Feelings" "Metal madness" "Ryu's theme" "War of freedom"
	for i in $^; do unzip -o $$i; done
	mkdir -p fretsonfire-songs-sectoid-$(ORIG_VERSION)
	mv -f "Escape from chaosland" "Feelings" "Metal madness" "War of freedom" fretsonfire-songs-sectoid-$(ORIG_VERSION)
	tar zcvf ../fretsonfire-songs-sectoid_$(ORIG_VERSION).orig.tar.gz fretsonfire-songs-sectoid-$(ORIG_VERSION)
	rm -rf fretsonfire-songs-sectoid-$(ORIG_VERSION) "Ryu's theme"
