#!/usr/bin/make -f

STANDARD_CARDSETS = 2000 \
          crystal-mahjongg \
          dashavatara-ganjifa \
          dondorf \
          gnome-mahjongg-1 \
          hexadeck \
          kintengu \
          matrix \
          mughal-ganjifa \
          oxymoron \
          standard \
          tuxedo \
          vienna-2k \

VERSION := $(shell dpkg-parsechangelog | awk '/^Version:/ { print $$2 }')

%:
	dh $@

override_dh_gencontrol:
	dh_gencontrol -Npysol-cardsets
	dh_gencontrol -ppysol-cardsets -- -v"1:$(VERSION)"

override_dh_auto_install:
	for c in cardset-*; do \
	    cp -r $$c debian/pysolfc-cardsets/usr/share/games/pysolfc/; \
	    rm debian/pysolfc-cardsets/usr/share/games/pysolfc/$$c/COPYRIGHT; \
	done
	# the standard set is already in the main package
	for c in $(STANDARD_CARDSETS); do \
	    rm -rf debian/pysolfc-cardsets/usr/share/games/pysolfc/cardset-$$c; \
	done
	rm -rf debian/pysolfc-cardsets/usr/share/games/pysolfc/cardset-konqi-modern/.xvpics
	rm -rf debian/pysolfc-cardsets/usr/share/games/pysolfc/cardset-warwick/.xvpics
