#!/usr/bin/make -f
# Sample tmp/rules that uses debhelper. 
# GNU copyright 1997 by Joey Hess.
#
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independent
# package.

# Uncomment this to turn on verbose mode. 
# export DH_VERBOSE=1

include /usr/share/dpkg/architecture.mk
ifeq ($(origin CC),default)
CC := $(DEB_HOST_GNU_TYPE)-gcc
endif
ifeq ($(origin CXX),default)
CXX := $(DEB_HOST_GNU_TYPE)-g++
endif
export CC CXX

# This has to be exported to make some magic below work.
export DH_OPTIONS

# Enable all hardening options - not enabled as it breaks the build - also, the package 
# does not take any input that could be exploited
# export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CXXFLAGS_MAINT_APPEND  = -Wall -g
export DEB_CFLAGS_MAINT_APPEND  = -Wall -g

%:
	dh $@

build: build-stamp
build-stamp:
	dh_testdir

override_dh_auto_configure:
	CXXFLAGS="$(CXXFLAGS) -I/usr/include/plib/" LIBS="-lplibfnt -lplibul -lglut" dh_auto_configure -- --prefix= --exec_prefix=/usr --mandir=\$${exec_prefix}/share/man --infodir=\$${exec_prefix}/share/info --sysconfdir=\$${prefix}/etc/ --includedir=\$${exec_prefix}/include --datadir=\$${exec_prefix}/share

override_dh_auto_build:
	dh_auto_build --no-parallel

override_dh_fixperms-arch:
	dh_fixperms
	chgrp games `pwd`/debian/openuniverse/var/games/openuniverse/scrshots
	chmod g+ws  `pwd`/debian/openuniverse/var/games/openuniverse/scrshots
