#!/usr/bin/make -f

#DH_VERBOSE = 1

export PYBUILD_NAME=axolotl

%:
	dh $@ --with python2,python3,quilt --buildsystem=pybuild

override_dh_quilt_patch:
	dh_quilt_patch
	[ -f $(CURDIR)/axolotl/state/storageprotos_pb2.py ] || \
	  mv $(CURDIR)/axolotl/state/storageprotos.py \
	  $(CURDIR)/axolotl/state/storageprotos_pb2.py

	[ -f $(CURDIR)/axolotl/protocol/whisperprotos_pb2.py ] || \
	  mv $(CURDIR)/axolotl/protocol/whisperprotos.py \
	  $(CURDIR)/axolotl/protocol/whisperprotos_pb2.py

override_dh_quilt_unpatch:
	[ -f $(CURDIR)/axolotl/state/storageprotos.py ] || \
	  mv $(CURDIR)/axolotl/state/storageprotos_pb2.py \
	  $(CURDIR)/axolotl/state/storageprotos.py

	[ -f $(CURDIR)/axolotl/protocol/whisperprotos.py ] || \
	  mv $(CURDIR)/axolotl/protocol/whisperprotos_pb2.py \
	  $(CURDIR)/axolotl/protocol/whisperprotos.py
	dh_quilt_unpatch
