#!/usr/bin/make -f

package=scribus-ng
CMAKE=/usr/bin/cmake

export DH_VERBOSE=1
DEBUG_FLAG=0


DEBIAN_DIR = $(shell pwd)/debian
BUILD_DIR = $(shell pwd)/debian/build
INSTALL_DIR = $(shell pwd)/debian/scribus-ng
DOC_DIR = $(INSTALL_DIR)/usr/share/doc/scribus-ng
SCRIPTS_DIR = $(INSTALL_DIR)/usr/share/scribus-ng/scripts

DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)

ifeq ($(DEB_HOST_ARCH),alpha)
OPT_FLAG = -O0
else
OPT_FLAG = -O2
endif

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
OPT_FLAG = -O0
endif

OPT_FLAG += -g -Wall

configure-stamp:
	dh_testdir
	touch configure-stamp

build: configure-stamp build-stamp
build-stamp:
	dh_testdir
	dh_clean
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	-rm -f configure-stamp build-stamp install-stamp
	-rm -rf $(BUILD_DIR) $(INSTALL_DIR)
	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_clean
	dh_installdirs
	dh_install
	touch install-stamp

build-indep: binary-indep

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installmenu
	dh_installchangelogs
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

build-arch: build install

binary: binary-indep

.PHONY: binary clean binary-indep binary-arch binary install patch unpatch
