#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
	dh $@ --with python2

override_dh_auto_clean:
	dh_auto_clean
	rm -f debian/fgo.xpm

override_dh_auto_build:
	# cf. https://wiki.debian.org/Games/JessieReleaseGoal
	convert share/icons/32x32/fgo.png debian/fgo.xpm

override_dh_installdocs:
        # The licence is already stored in the debian/copyright file, and the
        # CHANGE_LOG in debian/changelog.
        # docs/README/README_* are handled below, with symlinks to
        # /usr/share/games/fgo/data/help/help_*, which are identical and used
        # at runtime (must not be compressed).
	find docs -type f -not \( -name COPYING -o -name CHANGE_LOG -o \
                                  -name INFORMATION_FOR_PACKAGERS -o \
                                  -path 'docs/README/README_*' \) -print0 \
          | xargs -0 dh_installdocs

        # Create the symlinks from /usr/share/doc/fgo/README
	for f in docs/README/README_*; do \
          lang=$${f#docs/README/README_} && \
          echo usr/share/games/fgo/data/help/help_$$lang \
               usr/share/doc/fgo/README/README_$$lang; \
        done | xargs dh_link

override_dh_installchangelogs:
	dh_installchangelogs docs/CHANGE_LOG
