#!/usr/bin/make -f
# -*- makefile -*-

PERL_SHLIB=$(shell ls -l /usr/lib/libperl.so | sed 's/^.* -> \(.*\)$$/\1/')

%:
	dh $@ --with quilt

override_dh_auto_configure:
	dh_auto_configure -- --with-perl-shlib=$(PERL_SHLIB)

override_dh_auto_install:
	dh_auto_install
        # we have license information in /usr/share/doc/golly/copyright already
	rm $(CURDIR)/debian/golly/usr/share/doc/golly/LICENSE
        # golly should be in /usr/games, we should have icon and menu
	mkdir -p $(CURDIR)/debian/golly/usr/games \
	         $(CURDIR)/debian/golly/usr/share/pixmaps \
		 $(CURDIR)/debian/golly/usr/share/applications
	mv $(CURDIR)/debian/golly/usr/bin/golly $(CURDIR)/debian/golly/usr/games/golly
	install -m 444 appicon.xpm  $(CURDIR)/debian/golly/usr/share/pixmaps/golly.xpm
	install -m 444 debian/golly.desktop $(CURDIR)/debian/golly/usr/share/applications
        # Fix installation
	chmod +x $(CURDIR)/debian/golly/usr/share/golly/Help/Lexicon/modify.pl
