#!/usr/bin/make -f

UPSTREAM_GIT := https://github.com/openstack/xstatic-jquery-migrate.git
include /usr/share/openstack-pkg-tools/pkgos.make

%:
	dh $@ --buildsystem=pybuild --with python3

override_dh_auto_clean:
	rm -rf build *.egg-info
	find . -type d -name __pycache__ -exec rm -r {} \+

override_dh_auto_build:
	echo "Do nothing..."

override_dh_auto_install:
	set -e && for pyvers in $(PYTHON3S); do \
		python$$pyvers setup.py install --install-layout=deb \
			--root $(CURDIR)/debian/python3-xstatic-jquery-migrate; \
		yui-compressor -o $(CURDIR)/debian/python3-xstatic-jquery-migrate/usr/lib/python3/dist-packages/xstatic/pkg/jquery_migrate/data/jquery-migrate.min.js \
			$(CURDIR)/debian/python3-xstatic-jquery-migrate/usr/lib/python3/dist-packages/xstatic/pkg/jquery_migrate/data/jquery-migrate.js ; \
	done
	rm -rf $(CURDIR)/debian/python*-xstatic-jquery-migrate/usr/lib/python*/dist-packages/*.pth

override_dh_clean:
	dh_clean
	rm -rf build