build:
	pyinstaller otaserver.spec

release:
	mkdir -p ./release/otaserver
	rm -rf ./release/otaserver/*
	pyinstaller otaserver.spec
	cp -f ./run.sh ./release/otaserver
	cp -f ./install.sh ./release/otaserver
	cp -r ./dist ./release/otaserver/bin
	cp -f ./otaserver.service ./release/otaserver

install:
	mkdir -p /usr/local/otaserver
	cp -r ./dist /usr/local/otaserver/bin
	cp -f ./run.sh /usr/local/otaserver
	cp otaserver.service  /usr/lib/systemd/system
	systemctl enable otaserver
	systemctl start otaserver

.PHONY:clean
clean:
	rm -rf build
	rm -rf dist