#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

%:
	dh $@ --with python3

override_dh_install:
	cd v2rayL-GUI && pyinstaller -F v2rayLui.py -p config.py -p sub2conf_api.py -p v2rayL_api.py -p v2rayL_threads.py -p utils.py -i images/logo.ico -n v2rayLui
	dh_install
	chmod 777 debian/v2raylui/etc/v2rayL
	chmod 666 debian/v2raylui/etc/v2rayL/v2rayL_op.log

override_dh_fixperms:
	dh_fixperms -X etc/v2rayL -X etc/v2rayL/v2rayL_op.log

override_dh_dwz:

override_dh_installsystemd:
	dh_installsystemd --name v2rayL

override_dh_clean:
	dh_clean
	dh_auto_clean
	rm -rf v2rayL-GUI/__pycache__/
	rm -rf v2rayL-GUI/build/
	rm -rf v2rayL-GUI/dist/
	rm -rf v2rayL-GUI/v2rayLui.spec
