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

ifeq ($(DEB_HOST_ARCH),ppc64el)
  export DEB_CFLAGS_MAINT_STRIP = -O3
  export DEB_CXXFLAGS_MAINT_STRIP = -O3
  export DEB_CFLAGS_MAINT_APPEND = -O2
  export DEB_CXXFLAGS_MAINT_APPEND = -O2
endif

%:
	dh $@ --parallel --with autoreconf,python2

override_dh_install:
	( find $(CURDIR)/debian/tmp/usr/share/games/cyphesis/rulesets/ -name *.py -print | xargs chmod a-x )
	dh_install --list-missing -X.la -X.a

override_dh_strip:
	set -e; \
	for pkg in $(patsubst %-dbg,%,$(filter %-dbg,$(shell dh_listpackages))); do \
		dh_strip -p$${pkg} --dbg-package=$${pkg}-dbg; \
	done
	dh_strip -s --remaining-packages

override_dh_clean:
	debconf-updatepo
	dh_clean

override_dh_installinit:
	dh_installinit --noscripts

override_dh_auto_configure:
	dh_auto_configure -- --bindir=/usr/games --datadir=/usr/share/games
