#!/usr/bin/make -f
# -*- makefile -*-

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

export PYBUILD_NAME = pyparallel

PYTHON3	:= /usr/bin/python3
PY3VERS	:= $(shell py3versions -vs)

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

override_dh_python3:
	: # Replace all '#!' calls to python with $(PYTHON3)
	: # and make them executable
	for i in `find debian/python3-parallel -mindepth 3 -type f`; do \
	  sed '1s,#!.*python[^ ]*\(.*\),#! $(PYTHON3)\1,' \
	        $$i > $$i.temp; \
	  if cmp --quiet $$i $$i.temp; then \
	    rm -f $$i.temp; \
	  else \
	    mv -f $$i.temp $$i; \
	    chmod 755 $$i; \
	    echo "fixed interpreter: $$i"; \
	  fi; \
	done
	dh_python3 -ppython3-parallel
