#!/usr/bin/make -f

%:
	dh $@

# The license terms don't allow the distribution of modified binaries,
# so stripping is out of the question.
override_dh_strip:

override_dh_install-indep:
	dh_install
# The data directory contains some empty directories. There is no point in installing them.
	find debian/dwarf-fortress-data/usr/share/games/dwarf-fortress/gamedata/ -type d -empty -delete
# The license text of the embedded font copy is not needed, as we replace it with a Debian
# version of the font via dh_link
	rm -v 'debian/dwarf-fortress-data/usr/share/games/dwarf-fortress/gamedata/data/art/font license.txt'
# The information from these files has been incorporated into debian/copyright and having
# documentation in data directories is generally not very useful
	rm -v debian/dwarf-fortress-data/usr/share/games/dwarf-fortress/gamedata/data/readme.txt
	rm -v debian/dwarf-fortress-data/usr/share/games/dwarf-fortress/gamedata/raw/readme.txt
# The configuration is installed to /etc/xdg and we don't want the
# duplicated in the data directory.
	rm -rv debian/dwarf-fortress-data/usr/share/games/dwarf-fortress/gamedata/data/init

override_dh_installman-arch: debian/dwarf-fortress.6
	dh_installman

override_dh_clean:
	rm -vf debian/dwarf-fortress.6
	dh_clean

debian/%.6: debian/%.6.md
	pandoc --verbose -s -f markdown -t man "$<" > "$@"
