#! /usr/bin/make -f

# debian/rules
# Part of Debian ‘gandi-cli’ package.
#
# This is free software, and you are welcome to redistribute it under
# certain conditions; see the end of this file for copyright
# information, grant of license, and disclaimer of warranty.

# Send HTTP traffic to the “discard” service during packaging actions.
export http_proxy = http://127.0.1.1:9/
export https_proxy = ${http_proxy}

APP_PACKAGE = gandi-cli
working_dir = debian/${APP_PACKAGE}

package_share_dir = usr/share/${APP_PACKAGE}
export PYBUILD_INSTALL_ARGS ?= \
	--install-layout=deb \
	--install-lib=${package_share_dir}/ \
	--install-scripts=${package_share_dir}/

MAIN_PYTHON_PACKAGE = gandi
export PYBUILD_NAME = ${MAIN_PYTHON_PACKAGE}

export PYBUILD_DISABLE = test


%:
	dh $@ --with bash-completion,python3 --buildsystem=pybuild


.PHONY: override_dh_auto_clean
override_dh_auto_clean:
	dh_auto_clean
	$(RM) -r ${GENERATED_FILES}


.PHONY: override_dh_python3
override_dh_python3:
	dh_python3 -p ${APP_PACKAGE} ${package_share_dir}/
	find ${working_dir}/${package_share_dir}/ \
		-type d -name '__pycache__' -exec $(RM) -r \{} +


# Copyright © 2009–2019 Ben Finney <bignose@debian.org>
#
# This is free software; you may copy, modify, and/or distribute this work
# under the terms of the GNU General Public License, version 3 or later.
# No warranty expressed or implied.
# See the file ‘/usr/share/common-licenses/GPL-3’ for details.

# Local Variables:
# mode: makefile
# coding: utf-8
# End:
# vim: filetype=make fileencoding=utf-8 :
