#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

PACKAGE = python3-mecavideo
export PYBUILD_NAME=mecavideo

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

override_dh_clean:
	find . -type d -name __pycache__ | xargs rm -rf
	rm -rf pymecavideo.egg-info/
	rm -f data/lang/*.qm
	rm -f data/help/*w32.png
	rm -f src/interfaces/Ui_*.py src/interfaces/*_rc.py
	dh_clean

override_dh_auto_build:
	$(MAKE) all
	dh_auto_build

override_dh_auto_install:
	dh_auto_install
	# fix executable flags
	find $(CURDIR)/debian/$(PACKAGE)/usr/share/pymecavideo/data/video -type f -exec chmod 644 {} \;
	# fix a bug in oggvideotools' autopkgtest system
	mkdir $(CURDIR)/debian/$(PACKAGE)/usr/share/python3-mecavideo
	ln -sf ../pymecavideo/data/video \
	  $(CURDIR)/debian/$(PACKAGE)/usr/share/python3-mecavideo

XVFB_OPTIONS =  -a -s '-screen 0 1280x1024x24 +extension GLX -dpi 96'

override_dh_compress:
	dh_compress -X.html

XVFB_OPTIONS =  -a -s '-screen 0 1280x1024x24 +extension GLX -dpi 96'
override_dh_auto_test:
	# cd src; xvfb-run $(XVFB_OPTIONS)  python3 -m unittest -v
	echo "tests are non run"

