#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

export LC_ALL=C.UTF-8
export PREFIX=/usr

## Disable basing the --version string on git describe output.
export NO_GIT_VERSION=y

## This overrides upstream's default shebang for the generated svtplay-dl
## executable, to comform with Debian's Python policy (1.4.2).
export PYTHON=/usr/bin/python3

## We don't want to build-depend on python2 *and* python3, so we override
## upstream's default of running the test suite on both.
export TEST_OPTS=-3

export MAKEFLAGS = -e VERSION=$(DEB_VERSION)

%:
	dh $@

svtplay-dl.1:
	argparse-manpage \
		--project-name svtplay-dl \
		--author 'Johan Andersson' \
		--author-email 'j@i19.se' \
		--pyfile lib/svtplay_dl/utils/parser.py \
		--function gen_parser \
		--url https://svtplay-dl.se/ \
		--output svtplay-dl.1

override_dh_auto_test:
	pytest

override_dh_installman: svtplay-dl.1
	dh_installman
