#!/usr/bin/make -f

TOPDIR := $(shell pwd)
t = ${TOPDIR}/debian/epiphany
d = ${TOPDIR}/debian/epiphany-data

UPSTREAM_VERSION = $(shell /bin/bash ${TOPDIR}/debian/get-ups-ver.sh ${TOPDIR})

export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie

%:
	dh $@ --with autoreconf

override_dh_install:
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	cp src/epiphany-game $(t)/usr/games/epiphany-game
	rm -f data/maps/.cvsignore data/gfx/.cvsignore data/sfx/.cvsignore
	cp -a data/maps data/gfx data/sfx $(d)/usr/share/epiphany
	cp data/epiphany.scr $(d)/usr/share/epiphany
	cp debian/epiphany-game.xpm $(t)/usr/share/pixmaps
	cp debian/epiphany-game.desktop $(t)/usr/share/applications

override_dh_gencontrol:
	dh_gencontrol -- -VUpstream-Version=$(UPSTREAM_VERSION)

