Files
i2p.plugins.tor-updater/Makefile
2022-01-24 12:18:42 -05:00

141 lines
4.2 KiB
Makefile

VERSION=0.0.02
CGO_ENABLED=0
export CGO_ENABLED=0
GOOS?=$(shell uname -s | tr A-Z a-z)
GOARCH?="amd64"
ARG=-v -tags netgo -ldflags '-w -extldflags "-static"'
BINARY=i2p.plugins.tor-manager
SIGNER=hankhill19580@gmail.com
CONSOLEPOSTNAME=Tor Binary Manager
USER_GH=eyedeekay
PLUGIN=$(HOME)/.i2p/plugins/$(BINARY)-$(GOOS)-$(GOARCH)
binary:
go build $(ARG) -tags="netgo" -o $(BINARY)-$(GOOS)-$(GOARCH) .
install-binary: binary
cp -v $(BINARY)-$(GOOS)-$(GOARCH) $(PLUGIN)/lib
build: dep binary
make su3
clean:
rm -f $(BINARY)-plugin plugin $(BINARY)-*zip -r
rm -f *.su3 *.zip $(BINARY)-$(GOOS)-$(GOARCH) $(BINARY)-*
all: windows linux osx bsd
windows:
GOOS=windows GOARCH=amd64 make build su3
GOOS=windows GOARCH=386 make build su3
linux:
GOOS=linux GOARCH=amd64 make build su3
GOOS=linux GOARCH=arm64 make build su3
GOOS=linux GOARCH=386 make build su3
osx:
GOOS=darwin GOARCH=amd64 make build su3
GOOS=darwin GOARCH=arm64 make build su3
bsd:
# GOOS=freebsd GOARCH=amd64 make build su3
# GOOS=openbsd GOARCH=amd64 make build su3
dep:
cp "$(HOME)/Workspace/GIT_WORK/i2p.i2p/build/shellservice.jar" tor-browser/lib/shellservice.jar -v
su3:
i2p.plugin.native -name=$(BINARY)-$(GOOS)-$(GOARCH) \
-signer=$(SIGNER) \
-version "$(VERSION)" \
-author=$(SIGNER) \
-autostart=true \
-clientname=$(BINARY)-$(GOOS)-$(GOARCH) \
-consolename="$(BINARY) - $(CONSOLEPOSTNAME)" \
-name="$(BINARY)-$(GOOS)-$(GOARCH)" \
-delaystart="1" \
-desc="`cat desc`" \
-exename=$(BINARY)-$(GOOS)-$(GOARCH) \
-icondata=icon/icon.png \
-consoleurl="http://127.0.0.1:7695" \
-updateurl="http://idk.i2p/$(BINARY)/$(BINARY)-$(GOOS)-$(GOARCH).su3" \
-website="http://idk.i2p/$(BINARY)/" \
-command="$(BINARY)-$(GOOS)-$(GOARCH)" \
-license=MIT \
-res=tor-browser/
unzip -o $(BINARY)-$(GOOS)-$(GOARCH).zip -d $(BINARY)-$(GOOS)-$(GOARCH)-zip
sum:
sha256sum $(BINARY)-$(GOOS)-$(GOARCH).su3
version:
gothub release -p -u eyedeekay -r $(BINARY) -t "$(VERSION)" -d "`cat desc`"; true
upload:
gothub upload -R -u eyedeekay -r $(BINARY) -t "$(VERSION)" -f $(BINARY)-$(GOOS)-$(GOARCH).su3 -n $(BINARY)-$(GOOS)-$(GOARCH).su3 -l "`sha256sum $(BINARY)-$(GOOS)-$(GOARCH).su3`"
gothub upload -R -u eyedeekay -r $(BINARY) -t "$(VERSION)" -f $(BINARY)-$(GOOS)-$(GOARCH) -n $(BINARY)-$(GOOS)-$(GOARCH) -l "`sha256sum $(BINARY)-$(GOOS)-$(GOARCH)`"
upload-windows:
GOOS=windows GOARCH=amd64 make upload
GOOS=windows GOARCH=386 make upload
upload-linux:
GOOS=linux GOARCH=amd64 make upload
GOOS=linux GOARCH=arm64 make upload
GOOS=linux GOARCH=386 make upload
upload-osx:
GOOS=darwin GOARCH=amd64 make upload
GOOS=darwin GOARCH=arm64 make upload
upload-bsd:
# GOOS=freebsd GOARCH=amd64 make upload
# GOOS=openbsd GOARCH=amd64 make upload
upload-all: upload-windows upload-linux upload-osx upload-bsd
download-su3s:
GOOS=windows GOARCH=amd64 make download-single-su3
GOOS=windows GOARCH=386 make download-single-su3
GOOS=linux GOARCH=amd64 make download-single-su3
GOOS=linux GOARCH=arm64 make download-single-su3
GOOS=linux GOARCH=386 make download-single-su3
GOOS=darwin GOARCH=amd64 make download-single-su3
GOOS=darwin GOARCH=arm64 make download-single-su3
# GOOS=freebsd GOARCH=amd64 make download-single-su3
# GOOS=openbsd GOARCH=amd64 make download-single-su3
download-single-su3:
wget -N -c "https://github.com/$(USER_GH)/$(BINARY)/releases/download/$(VERSION)/$(BINARY)-$(GOOS)-$(GOARCH).su3"
linux-release: clean linux version upload-linux
release: clean all version upload-all
index:
@echo "<!DOCTYPE html>" > index.html
@echo "<html>" >> index.html
@echo "<head>" >> index.html
@echo " <title>$(BINARY) - $(CONSOLEPOSTNAME)</title>" >> index.html
@echo " <link rel=\"stylesheet\" type=\"text/css\" href =\"/style.css\" />" >> index.html
@echo "</head>" >> index.html
@echo "<body>" >> index.html
pandoc README.md >> index.html
@echo "</body>" >> index.html
@echo "</html>" >> index.html
refresh-tor-keys: clean-tor-keys tor-browser/TPO-signing-key.pub
tor-keys: tor-browser/TPO-signing-key.pub
clean-tor-keys:
rm -f tor-browser/TPO-signing-key.pub
tor-browser/TPO-signing-key.pub:
gpg --armor --output ./tor-browser/TPO-signing-key.pub --export 0xEF6E286DDA85EA2A4BA7DE684E2C6E8793298290