Makefile 1.56 KB
Newer Older
Gabriel Moreau's avatar
Gabriel Moreau committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
SOFT:=Kasperky-Uninstall
VERSION:=$(shell grep '!define VERSION' ../../package.nsi | cut -f 2 -d '"')
PATCH:=1


.PHONY: all help update clean key zip ocs

all: key zip ocs


help:
	@echo "all      create a zip archive"
	@echo "ocs      help for upload the Zip archive in OCS server"
	@echo "clean    clean folder"
	@echo "update   make a git pull (update local repository)"


update:
	(cd ../..; git pull)


clean:
	rm -f $(SOFT)-$(VERSION)-$(PATCH).zip
	rm -rf tmp
	rm -rf *.key Custom-Var*.psm1


key:
	@pwsh set-password-encrypted.ps1


zip: $(SOFT)-$(VERSION)-$(PATCH).zip

%.zip: Makefile
Gabriel Moreau's avatar
Gabriel Moreau committed
35
	mkdir -p ./tmp/WAPT
Gabriel Moreau's avatar
Gabriel Moreau committed
36 37 38
	perl -p -e ' \
		s/^(SET\ssoftversion=)\d[\.\d]+/$${1}$(VERSION)/; \
		s/^(SET\ssoftpatch=)\d+/$${1}$(PATCH)/;' install.bat > tmp/install.bat
Gabriel Moreau's avatar
Gabriel Moreau committed
39 40 41 42 43 44 45
	@perl -p -e ' \
		s/__VERSION__/$(VERSION)/; \
		s/__PATCH__/$(PATCH)/;' control > ./tmp/WAPT/control
	@cp ../../Modules/SWMB.psm1 ../../Modules/SWMB/Custom.psm1 ../../Modules/SWMB/Custom-VarDefault.psm1 ../../Modules/SWMB/Experimental.psm1 ./tmp/; \
		cp ./README.md ./get-password-cleartext.ps1 ./set-password-encrypted.ps1 ./Custom-VarAutodel.psm1 ./*.key ./tmp/; \
		cp ./uninstall-kaspersky-standalone.ps1 ./tmp/uninstall-kaspersky.ps1; \
		cp -f ../../LICENSE.md ./setup.py ./tmp/
Gabriel Moreau's avatar
Gabriel Moreau committed
46
	rm -f $@
Gabriel Moreau's avatar
Gabriel Moreau committed
47
	(cd tmp; zip -r ../$@ install.bat README.md *.ps1 *.psm1 *.key setup.py LICENSE.md WAPT)
Gabriel Moreau's avatar
Gabriel Moreau committed
48 49 50 51 52 53 54 55 56 57 58 59 60 61
	chmod ugo+rw $@


ocs:
	@echo ""
	@echo "Name:     $(SOFT)-$(VERSION)-$(PATCH)"
	@echo "priority: 2"
	@echo "Launch:   install.bat"
	@echo "Message:  no"
	@echo ""
	@echo "RESINFO GT SWMB"
	@echo " --- "
	@echo "Remove software $(SOFT)"
	@echo ""