#!/usr/bin/make -f

export PYBUILD_DESTDIR=debian/hdmi2usb-mode-switch
export PYBUILD_INSTALL_ARGS=--install-lib=/usr/share/hdmi2usb-mode-switch/ \
                            --install-scripts=/usr/share/hdmi2usb-mode-switch/

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

override_dh_auto_install:
	dh_auto_install
	# udev rules
	sed -e's#/etc/udev/rules.d/hdmi2usb-human-path-helper.sh#/lib/udev/hdmi2usb-human-path-helper#' \
		$(sort $(wildcard udev/*.rules)) > debian/hdmi2usb-udev.udev

override_dh_auto_test:
	# Only one test, and it isn't really appliccable to an autobuilder environment

override_dh_installudev:
	# Sort after 60-persistent-v4l.rules
	dh_installudev --priority=70
