#!/usr/bin/make -f

UPSTREAM_GIT := https://github.com/novnc/noVNC
include /usr/share/openstack-pkg-tools/pkgos.make

%:
	dh $@ --with python3

override_dh_auto_clean:
	rm -rf build .stestr
	find . -iname '*.pyc' -delete
	for i in $$(find . -type d -iname __pycache__) ; do rm -rf $$i ; done

override_dh_auto_build:
	echo "Do nothing..."

override_dh_install:
	echo "Do nothing..."

override_dh_auto_install:
	pkgos-dh_auto_install --no-py2
	dh_install
	dh_missing --fail-missing
	rm -f $(CURDIR)/debian/novnc/usr/share/novnc/vendor/pako/LICENSE
	ln -s vnc.html $(CURDIR)/debian/novnc/usr/share/novnc/vnc_auto.html
	rm -f $(CURDIR)/debian/novnc/usr/share/novnc/vendor/browser-es-module-loader/.npmignore
	sed -i -e '1s|#!/usr/bin/env perl|#!/usr/bin/perl|' $(CURDIR)/debian/novnc/usr/share/novnc/utils/b64-to-binary.pl

#override_dh_auto_build:
#	make -C po update-js

override_dh_fixperms:
	dh_fixperms
	chmod a+x $(CURDIR)/debian/novnc/usr/share/novnc/utils/genkeysymdef.js
