#!/usr/bin/make -f

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

ifeq ($(shell dpkg-vendor --is Ubuntu && echo yes) $(DEB_HOST_ARCH), yes i386)
   BUILD_PACKAGES += -Nxorg -Nxserver-xorg -Nxserver-xorg-input-all -Nxserver-xorg-video-all
endif

%:
	dh $@ $(BUILD_PACKAGES)

override_dh_auto_clean:
	$(MAKE) -C xsf-docs clean

override_dh_auto_build:
	$(MAKE) -C xsf-docs

execute_before_dh_install:
	$(MAKE) -C xsf-docs install DESTDIR=$(CURDIR)/debian/xserver-xorg/usr/share/doc/xorg

override_dh_installinit-indep:
	dh_installinit -px11-common

execute_after_dh_fixperms-indep:
	chmod 755 debian/x11-common/etc/X11/Xreset
	chmod 755 debian/x11-common/etc/X11/Xsession

# vim:set noet ai sts=8 sw=8 tw=0:
