#!/usr/bin/make -f

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

export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed
export DEB_BUILD_MAINT_OPTIONS=hardening=+bindnow
BUILDOPTS= --with-verbose --with-Xdummy --without-Xdummy_wrapper --with-html5 --without-minify --without-html5_gzip
export PYBUILD_CONFIG_ARGS=$(BUILDOPTS)
export PYBUILD_BUILD_ARGS=$(BUILDOPTS)
export PYBUILD_INSTALL_ARGS=$(BUILDOPTS) --root=$(CURDIR)/debian/tmp
export PYBUILD_DISABLE=test

%:
	dh $@ --buildsystem=pybuild

override_dh_installchangelogs:
	dh_installchangelogs NEWS

override_dh_auto_install:
	dh_auto_install
	# Post-install clean-up
	$(RM) -v debian/tmp/usr/share/xpra/COPYING debian/tmp/usr/bin/xpra_Xdummy debian/tmp/usr/share/xpra/README \
                 debian/tmp/usr/share/xpra/www/js/lib/broadway/LICENSE debian/tmp/usr/share/xpra/www/LICENSE
	
	@-printf "~~~~ Generated contents of conf.d/55_server_x11.conf\n"
	-grep -v ^# debian/tmp/etc/xpra/conf.d/55_server_x11.conf
	@-printf "~~~~\n"

override_dh_installinit:
	dh_installinit -v --no-enable --no-start

override_dh_installsystemd:
	dh_installsystemd -v --no-enable --no-start

override_dh_python3:
	dh_python3 --shebang=/usr/bin/python3
	dh_python3 --shebang=/usr/bin/python3 /usr/lib/cups/backend /usr/lib/xpra
