#!/usr/bin/make -f

# prevents downloading youtube-dl/yt-dlp directly in favour of install via apt
export TARTUBE_PKG_STRICT=1

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

override_dh_auto_build:
	dh_auto_build
	# create the translation files
	find locale -name \*.po -execdir msgfmt base.po -o tartube.mo \;

override_dh_install:
	rst2html --report="error" README.rst README.html
	# install translation files
	mkdir -p debian/tmp/usr/share/
	cp -p --parents locale/*/LC_MESSAGES/tartube.mo debian/tmp/usr/share/
	dh_install
	# remove duplicate license information
	rm -rf $(CURDIR)/debian/tartube/usr/share/tartube/sounds/COPYING

override_dh_missing:
	dh_missing --fail-missing
