PACKAGE=freedoko-altenburg

# Edited for Debian GNU/Linux.
DESTDIR = 

.PHONY: all install

all :

install :
	# create and copy the binary
	mkdir -p $(DESTDIR)/usr/games
	export OSTYPE \
	  && $(MAKE) -C src FreeDoko
	cp src/FreeDoko $(DESTDIR)/usr/games/
	# copy the icon
	mkdir -p $(DESTDIR)/usr/share/pixmaps/
	cp src/FreeDoko.png $(DESTDIR)/usr/share/pixmaps/
	# copy the data
	mkdir -p $(DESTDIR)/usr/share/games/FreeDoko
	cp -a data/* $(DESTDIR)/usr/share/games/FreeDoko/
	-chown -R .games $(DESTDIR)/usr/share/games/FreeDoko/
	-chmod -R ug+rX $(DESTDIR)/usr/share/games/FreeDoko/
	-chmod -R o-rwx $(DESTDIR)/usr/share/games/FreeDoko/
	# copy the documentation
	mkdir -p $(DESTDIR)/usr/share/doc/$(PACKAGE)
	cp -a AUTHORS copyright ChangeLog doc/* \
		$(DESTDIR)/usr/share/doc/$(PACKAGE)
	# create and copy the manual page
	cd debian; \
	  docbook-to-man freedoko.sgml > freedoko.6
	mkdir -p $(DESTDIR)/usr/share/man/man6/
	cp debian/freedoko.6 $(DESTDIR)/usr/share/man/man6/
	cp -a debian/FreeDoko.6 $(DESTDIR)/usr/share/man/man6/
