#!/usr/bin/make -f

# Ignore graphics and .mo files in addition to the default debian files
DEB_COPYRIGHT_CHECK_IGNORE_REGEX = ^(locale/.*/.*\.mo|data/dark/.*\.png|icons/.*\.png|LICENSE|debian/(changelog|copyright(|_hints|_newhints)|electrum.translations))$

%:
	dh $@ --buildsystem=pybuild

execute_before_dh_auto_build::
	# Generate paymentrequest_pb2.py from paymentrequest.proto.
	contrib/generate_payreqpb2.sh

override_dh_installchangelogs::
	# Move RELEASE-NOTES to changelog.
	dh_installchangelogs RELEASE-NOTES

execute_after_dh_auto_install::
	# Remove redundant license files.
	rm debian/tmp/usr/lib/python3*/dist-packages/electrum/plugins/revealer/SIL\ Open\ Font\ License.txt
	rm debian/tmp/usr/lib/python3*/dist-packages/electrum/gui/kivy/theming/atlas/LICENCE

execute_before_dh_python3::
	# The dependency is inconvenient and unnecessary.  In the future it might make more sense to move the editing of this file to debian/patches.
	sed -Ei -e '/^qdarkstyle/d' debian/python3-electrum/usr/lib/python3*/dist-packages/*.egg-info/requires.txt
