build:
	pyinstaller ipset.spec

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

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

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