#!/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

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

override_dh_installinit-indep:
	dh_installinit -px11-common

override_dh_fixperms-indep:
	dh_fixperms
	chown root:root debian/x11-common/etc/X11/Xreset
	chmod 755 debian/x11-common/etc/X11/Xreset
	chown root:root debian/x11-common/etc/X11/Xsession
	chmod 755 debian/x11-common/etc/X11/Xsession

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