#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/buildcore.mk

EDID_ARCH := i386 powerpc
DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)

ifneq (,$(findstring $(DEB_BUILD_ARCH),$(EDID_ARCH)))
	export REAL_EDID=1
else
	export REAL_EDID=0
endif

build/ddcxinfo-kanotix::
	if test $(REAL_EDID) -eq 1; then \
		$(MAKE) ddcxinfo-kanotix; \
	fi

install/ddcxinfo-kanotix::
	# Add here commands to install the package into debian/ddcxinfo-kanotix.
	install -m 755 -d $(CURDIR)/debian/$(DEB_SOURCE_PACKAGE)/usr/sbin
	if test $(REAL_EDID) -eq 1; then \
		install -m 755 ddcxinfo-kanotix $(CURDIR)/debian/$(DEB_SOURCE_PACKAGE)/usr/sbin/; \
	else \
		install -m 755 $(CURDIR)/debian/ddcxinfo-kanotix.sh $(CURDIR)/debian/$(DEB_SOURCE_PACKAGE)/usr/sbin/ddcxinfo-kanotix; \
	fi

clean::
	$(MAKE) clean || true

