Files
i2p.plugins.tor-updater/Makefile

350 lines
13 KiB
Makefile
Raw Normal View History

2022-02-21 23:58:47 -05:00
VERSION=0.0.5
2022-02-24 13:04:17 -05:00
#CGO_ENABLED=0
#export CGO_ENABLED=0
export PKG_CONFIG_PATH=/usr/lib/$(uname -m)-linux-musl/pkgconfig
2022-01-16 15:33:47 -05:00
GOOS?=$(shell uname -s | tr A-Z a-z)
GOARCH?="amd64"
ARG=-v -tags netgo -ldflags '-w' # -extldflags "-static"'
#FLAGS=/usr/lib/x86_64-linux-gnu/libboost_system.a /usr/lib/x86_64-linux-gnu/libboost_date_time.a /usr/lib/x86_64-linux-gnu/libboost_filesystem.a /usr/lib/x86_64-linux-gnu/libboost_program_options.a /usr/lib/x86_64-linux-gnu/libssl.a /usr/lib/x86_64-linux-gnu/libcrypto.a /usr/lib/x86_64-linux-gnu/libz.a
2022-02-24 13:04:17 -05:00
#ARG=-ldflags '-w -linkmode=external -extldflags "-static -ldl $(FLAGS)"'
#NOSTATIC=-v -tags netgo -ldflags '-w -extldflags "-ldl $(FLAGS)"'
WINGUI=-ldflags '-H=windowsgui'
2022-01-16 15:33:47 -05:00
BINARY=i2p.plugins.tor-manager
SIGNER=hankhill19580@gmail.com
2022-01-16 15:42:23 -05:00
CONSOLEPOSTNAME=Tor Binary Manager
2022-01-16 15:33:47 -05:00
USER_GH=eyedeekay
PLUGIN=$(HOME)/.i2p/plugins/$(BINARY)-$(GOOS)-$(GOARCH)
2022-01-16 15:33:47 -05:00
2022-01-24 17:15:45 -05:00
PREFIX?=/usr/local
2022-02-07 15:48:51 -05:00
binary:
2022-03-07 16:27:32 -05:00
go build $(ARG) -tags="netgo osusergo systray" -o $(BINARY)-$(GOOS)-$(GOARCH) .
winbinary:
2022-02-24 13:04:17 -05:00
CC=/usr/bin/x86_64-w64-mingw32-gcc \
CXX=/usr/bin/x86_64-w64-mingw32-g++ \
GOOS=windows go build $(WINGUI) -tags="netgo osusergo systray" -o $(BINARY)-$(GOOS)-$(GOARCH) .
2022-03-07 16:27:32 -05:00
nosystray:
go build $(NOSTATIC) -tags="netgo osusergo nosystray" -o $(BINARY)-$(GOOS)-$(GOARCH) .
2022-02-07 15:48:51 -05:00
2022-02-07 15:34:45 -05:00
lint:
golint supervise/*.go
golint get/*.go
golint serve/*.go
install-binary: binary
cp -v $(BINARY)-$(GOOS)-$(GOARCH) $(PLUGIN)/lib
2022-01-24 17:15:45 -05:00
install:
2022-01-28 00:09:18 -05:00
mkdir -p /var/lib/i2pbrowser/icons
2022-01-24 17:15:45 -05:00
install -m755 -v $(BINARY)-$(GOOS)-$(GOARCH) $(PREFIX)/bin/$(BINARY)-$(GOOS)-$(GOARCH)
ln -sf $(PREFIX)/bin/$(BINARY)-$(GOOS)-$(GOARCH) $(PREFIX)/bin/i2pbrowser
ln -sf $(PREFIX)/bin/$(BINARY)-$(GOOS)-$(GOARCH) $(PREFIX)/bin/torbrowser
2022-01-28 00:09:18 -05:00
install i2ptorbrowser.desktop /usr/share/applications/i2ptorbrowser.desktop
install torbrowser.desktop /usr/share/applications/torbrowser.desktop
install garliconion.png /var/lib/i2pbrowser/icons/garliconion.png
install onion.png /var/lib/i2pbrowser/icons/onion.png
2022-01-24 17:15:45 -05:00
build: dep binary
winbuild: dep winbinary
2022-01-27 20:28:00 -05:00
2022-01-28 00:19:21 -05:00
p: dep binary su3
2022-01-16 15:33:47 -05:00
clean:
2022-01-27 19:34:48 -05:00
rm -f $(BINARY)-plugin plugin $(BINARY)-*zip -r $(BINARY)-$(GOOS)-$(GOARCH) $(BINARY)-$(GOOS)-$(GOARCH).exe tmp tor-browser/torbrowser-*.* $(BINARY) $(BINARY).exe
2022-01-16 15:33:47 -05:00
rm -f *.su3 *.zip $(BINARY)-$(GOOS)-$(GOARCH) $(BINARY)-*
2022-01-27 21:29:23 -05:00
git clean -df
2022-01-16 15:33:47 -05:00
all: windows linux osx bsd
2022-03-07 16:34:58 -05:00
portable.zip: all
cp $(BINARY)-windows-amd64 $(BINARY)-windows-amd64.exe
cp $(BINARY)-windows-386 $(BINARY)-windows-386.exe
zip -r portable.zip browse.cmd \
$(BINARY)-linux-amd64 \
$(BINARY)-windows-amd64 \
#$(BINARY)-darwin-amd64 \
#$(BINARY)-darwin-arm64 \
2022-03-07 16:34:58 -05:00
2022-03-01 00:17:59 -05:00
backup-embed:
mkdir -p ../../../github.com/eyedeekay/go-I2P-jpackage.bak
cp ../../../github.com/eyedeekay/go-I2P-jpackage/* ../../../github.com/eyedeekay/go-I2P-jpackage.bak -r;true
rm -f ../../../github.com/eyedeekay/go-I2P-jpackage/*.tar.xz
tar -cvJf ../../../github.com/eyedeekay/go-I2P-jpackage/build.windows.I2P.tar.xz README.md LICENSE
tar -cvJf ../../../github.com/eyedeekay/go-I2P-jpackage/build.linux.I2P.tar.xz README.md LICENSE
unbackup-embed:
cp ../../../github.com/eyedeekay/go-I2P-jpackage.bak/*.tar.xz ../../../github.com/eyedeekay/go-I2P-jpackage/
2022-03-01 13:29:11 -05:00
unembed-windows:
mv ../../../github.com/eyedeekay/go-I2P-jpackage/build.windows.I2P.tar.xz ../../../github.com/eyedeekay/
tar -cvJf ../../../github.com/eyedeekay/go-I2P-jpackage/build.windows.I2P.tar.xz README.md LICENSE
unembed-linux:
mv ../../../github.com/eyedeekay/go-I2P-jpackage/build.linux.I2P.tar.xz ../../../github.com/eyedeekay/
tar -cvJf ../../../github.com/eyedeekay/go-I2P-jpackage/build.linux.I2P.tar.xz README.md LICENSE
2022-03-01 00:17:59 -05:00
winplugin:
GOOS=windows make backup-embed build unbackup-embed
linplugin:
GOOS=linux make backup-embed build unbackup-embed
linplugin-nosystray:
GOOS=linux make backup-embed nosystray unbackup-embed
2022-03-01 00:17:59 -05:00
osxplugin:
GOOS=darwin make backup-embed nosystray unbackup-embed
2022-03-01 00:17:59 -05:00
2022-01-16 15:33:47 -05:00
windows:
2022-03-01 13:29:11 -05:00
GOOS=windows GOARCH=amd64 make winplugin su3 unembed-linux build unbackup-embed
GOOS=windows GOARCH=386 make winplugin su3 unembed-linux build unbackup-embed
2022-01-16 15:33:47 -05:00
linux:
2022-03-01 13:29:11 -05:00
GOOS=linux GOARCH=amd64 make linplugin su3 unembed-windows build unbackup-embed
2022-03-07 16:34:58 -05:00
# GOOS=linux GOARCH=arm64 make linplugin su3 unembed-windows build unbackup-embed
PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig GOOS=linux GOARCH=386 make linplugin-nosystray su3 unembed-windows nosystray unbackup-embed
2022-01-16 15:33:47 -05:00
osx:
GOOS=darwin GOARCH=amd64 make osxplugin su3 unembed-windows unembed-linux nosystray unbackup-embed
GOOS=darwin GOARCH=arm64 make osxplugin su3 unembed-windows unembed-linux nosystray unbackup-embed
2022-01-16 15:33:47 -05:00
bsd:
2022-01-16 15:42:23 -05:00
# GOOS=freebsd GOARCH=amd64 make build su3
# GOOS=openbsd GOARCH=amd64 make build su3
2022-01-16 15:33:47 -05:00
dep:
2022-02-03 02:06:39 -05:00
cp "$(HOME)/build/shellservice.jar" tor-browser/lib/shellservice.jar -v
2022-01-16 15:33:47 -05:00
su3:
2022-02-08 19:51:18 -05:00
i2p.plugin.native -name=$(BINARY)-$(GOOS)-$(GOARCH) \
2022-01-16 15:33:47 -05:00
-signer=$(SIGNER) \
-version "$(VERSION)" \
-author=$(SIGNER) \
-autostart=true \
-clientname=$(BINARY) \
2022-01-16 15:33:47 -05:00
-consolename="$(BINARY) - $(CONSOLEPOSTNAME)" \
-delaystart="1" \
-desc="`cat desc`" \
-exename=$(BINARY)-$(GOOS)-$(GOARCH) \
-icondata=icon/icon.png \
2022-01-23 11:42:23 -05:00
-consoleurl="http://127.0.0.1:7695" \
2022-01-16 15:33:47 -05:00
-updateurl="http://idk.i2p/$(BINARY)/$(BINARY)-$(GOOS)-$(GOARCH).su3" \
-website="http://idk.i2p/$(BINARY)/" \
-command="$(BINARY)-$(GOOS)-$(GOARCH)" \
2022-01-24 12:18:42 -05:00
-license=MIT \
2022-01-16 15:48:18 -05:00
-res=tor-browser/
2022-02-08 19:49:36 -05:00
unzip -o $(BINARY)-$(GOOS)-$(GOARCH).zip -d $(BINARY)-$(GOOS)-$(GOARCH)-zip
2022-01-16 15:33:47 -05:00
sum:
sha256sum $(BINARY)-$(GOOS)-$(GOARCH).su3
version:
gothub release -p -u eyedeekay -r $(BINARY) -t "$(VERSION)" -d "`cat desc`"; true
2022-01-16 15:33:47 -05:00
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)`"
2022-01-16 15:33:47 -05:00
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:
2022-01-16 15:42:23 -05:00
# GOOS=freebsd GOARCH=amd64 make upload
# GOOS=openbsd GOARCH=amd64 make upload
2022-01-16 15:33:47 -05:00
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
2022-01-16 15:42:23 -05:00
# GOOS=freebsd GOARCH=amd64 make download-single-su3
# GOOS=openbsd GOARCH=amd64 make download-single-su3
2022-01-16 15:33:47 -05:00
download-single-su3:
wget -N -c "https://github.com/$(USER_GH)/$(BINARY)/releases/download/$(VERSION)/$(BINARY)-$(GOOS)-$(GOARCH).su3"
2022-01-30 04:20:53 -05:00
early-release: clean linux windows version upload-linux upload-windows
2022-01-16 15:33:47 -05:00
release: clean all version upload-all
2022-03-05 00:14:54 -05:00
index: index-clearnet index-offline index-usage index-onion
2022-01-16 15:33:47 -05:00
@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
2022-02-14 13:36:39 -05:00
sed 's|https://github.com/eyedeekay/i2p.plugins.tor-manager/releases/download/||g' README.md | \
sed "s|$(VERSION)||g" | pandoc >> index.html
2022-01-16 15:33:47 -05:00
@echo "</body>" >> index.html
@echo "</html>" >> index.html
2022-01-16 15:42:23 -05:00
index-clearnet:
@echo "<!DOCTYPE html>" > firefox.html
@echo "<html>" >> firefox.html
@echo "<head>" >> firefox.html
@echo " <title>$(BINARY) - $(CONSOLEPOSTNAME)</title>" >> firefox.html
@echo " <link rel=\"stylesheet\" type=\"text/css\" href =\"/style.css\" />" >> firefox.html
@echo "</head>" >> firefox.html
@echo "<body>" >> firefox.html
pandoc FIREFOX.md >> firefox.html
@echo "</body>" >> firefox.html
@echo "</html>" >> firefox.html
index-offline:
@echo "<!DOCTYPE html>" > offline.html
@echo "<html>" >> offline.html
@echo "<head>" >> offline.html
@echo " <title>$(BINARY) - $(CONSOLEPOSTNAME)</title>" >> offline.html
@echo " <link rel=\"stylesheet\" type=\"text/css\" href =\"/style.css\" />" >> offline.html
@echo "</head>" >> offline.html
@echo "<body>" >> offline.html
pandoc OFFLINE.md >> offline.html
@echo "</body>" >> offline.html
@echo "</html>" >> offline.html
2022-02-28 19:59:47 -05:00
index-onion:
@echo "<!DOCTYPE html>" > onion/www/index.html
@echo "<html>" >> onion/www/index.html
@echo "<head>" >> onion/www/index.html
@echo " <title>$(BINARY) - $(CONSOLEPOSTNAME)</title>" >> onion/www/index.html
@echo " <link rel=\"stylesheet\" type=\"text/css\" href =\"/style.css\" />" >> onion/www/index.html
@echo " <link rel=\"stylesheet\" type=\"text/css\" href =\"/default.css\" />" >> onion/www/index.html
@echo " <link rel=\"stylesheet\" type=\"text/css\" href =\"/desktop.css\" />" >> onion/www/index.html
@echo " <link rel=\"stylesheet\" type=\"text/css\" href =\"/mobile.css\" />" >> onion/www/index.html
@echo " <link rel=\"stylesheet\" type=\"text/css\" href =\"/syntax.css\" />" >> onion/www/index.html
@echo " <link rel=\"stylesheet\" type=\"text/css\" href =\"/widescreen.rtl.css\" />" >> onion/www/index.html
@echo " <link rel=\"stylesheet\" type=\"text/css\" href =\"/default.rtl.css\" />" >> onion/www/index.html
@echo " <link rel=\"stylesheet\" type=\"text/css\" href =\"/desktop.rtl.css\" />" >> onion/www/index.html
@echo " <link rel=\"stylesheet\" type=\"text/css\" href =\"/reset.css\" />" >> onion/www/index.html
@echo " <link rel=\"stylesheet\" type=\"text/css\" href =\"/widescreen.css\" />" >> onion/www/index.html
@echo "</head>" >> onion/www/index.html
@echo "<body>" >> onion/www/index.html
pandoc ONION.md >> onion/www/index.html
@echo "</body>" >> onion/www/index.html
@echo "</html>" >> onion/www/index.html
2022-02-06 16:57:30 -05:00
tor-browser/unpack/i2p.firefox:
@echo "TODO"
tor-browser/unpack/i2p.firefox.config:
@echo "TODO"
2022-01-16 15:42:23 -05:00
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 --output ./tor-browser/TPO-signing-key.pub --export -r torbrowser@torproject.org
#gpg --armor --output ./tor-browser/TPO-signing-key.pub --export -r torbrowser@torproject.org
2022-02-21 23:58:47 -05:00
#gpg -r 0xEF6E286DDA85EA2A4BA7DE684E2C6E8793298290 --output ./tor-browser/TPO-signing-key.pub --export
#gpg -r 0xEF6E286DDA85EA2A4BA7DE684E2C6E8793298290 --armor --output ./tor-browser/TPO-signing-key.pub --export
2022-01-27 21:29:23 -05:00
deb: clean
2022-01-27 20:21:17 -05:00
mv "hankhill19580_at_gmail.com.crl" ../; true
mv "hankhill19580_at_gmail.com.crt" ../; true
mv "hankhill19580_at_gmail.com.pem" ../; true
rm ../i2p.plugins.tor-manager_$(VERSION).orig.tar.gz -f
2022-01-27 19:32:27 -05:00
tar --exclude=".git" \
2022-01-27 19:29:22 -05:00
--exclude="hankhill19580_at_gmail.com.crl" \
--exclude="hankhill19580_at_gmail.com.crt" \
--exclude="hankhill19580_at_gmail.com.pem" \
--exclude="i2p.plugins.tor-manager" \
--exclude="i2p.plugins.tor-manager.exe" \
2022-01-27 19:32:27 -05:00
--exclude="tmp" \
2022-01-27 19:29:22 -05:00
-cvzf ../i2p.plugins.tor-manager_$(VERSION).orig.tar.gz .
2022-01-27 19:26:37 -05:00
dpkg-buildpackage -us -uc
2022-01-27 20:21:17 -05:00
mv "../hankhill19580_at_gmail.com.crl" ./
mv "../hankhill19580_at_gmail.com.crt" ./
mv "../hankhill19580_at_gmail.com.pem" ./
2022-01-27 22:41:30 -05:00
debsrc: clean
mv "hankhill19580_at_gmail.com.crl" ../; true
mv "hankhill19580_at_gmail.com.crt" ../; true
mv "hankhill19580_at_gmail.com.pem" ../; true
rm ../i2p.plugins.tor-manager_$(VERSION).orig.tar.gz -f
2022-01-27 22:41:30 -05:00
tar --exclude=".git" \
--exclude="hankhill19580_at_gmail.com.crl" \
--exclude="hankhill19580_at_gmail.com.crt" \
--exclude="hankhill19580_at_gmail.com.pem" \
--exclude="i2p.plugins.tor-manager" \
--exclude="i2p.plugins.tor-manager.exe" \
--exclude="tmp" \
-cvzf ../i2p.plugins.tor-manager_$(VERSION).orig.tar.gz .
debuild -S
mv "../hankhill19580_at_gmail.com.crl" ./
mv "../hankhill19580_at_gmail.com.crt" ./
2022-02-07 21:38:54 -05:00
mv "../hankhill19580_at_gmail.com.pem" ./
DATE=`date +%Y/%m/%d`
usage:
./i2p.plugins.tor-manager --help
usagemd:
@echo "Tor(And sometimes Firefox) Manager for I2P" | tee USAGE.md
@echo "===========================================" | tee -a USAGE.md
@echo "" | tee -a USAGE.md
@echo "## Usage: $(BINARY) [options]" | tee -a USAGE.md
@echo "" | tee -a USAGE.md
@echo "### Options:" | tee -a USAGE.md
@echo "" | tee -a USAGE.md
@echo '```sh' | tee -a USAGE.md
2022-02-12 00:15:47 -05:00
./i2p.plugins.tor-manager --help 2>&1 | grep -v $(DATE) | grep -v $(HOME) | tee -a USAGE.md
2022-02-07 21:38:54 -05:00
@echo '```' | tee -a USAGE.md
@echo "" | tee -a USAGE.md
2022-02-11 00:42:21 -05:00
2022-02-12 00:06:07 -05:00
index-usage:
@echo "<!DOCTYPE html>" > usage.html
@echo "<html>" >> usage.html
@echo "<head>" >> usage.html
@echo " <title>$(BINARY) - $(CONSOLEPOSTNAME)</title>" >> usage.html
@echo " <link rel=\"stylesheet\" type=\"text/css\" href =\"/style.css\" />" >> usage.html
@echo "</head>" >> usage.html
@echo "<body>" >> usage.html
pandoc USAGE.md >> usage.html
@echo "</body>" >> usage.html
@echo "</html>" >> usage.html
example:
go build -x -v --tags=netgo,nosystray \
-ldflags '-w -linkmode=external -extldflags "-static -ldl $(FLAGS)"'
xhost:
xhost + local:docker
docker: xhost
docker build -t eyedeekay/i2p.plugins.tor-manager .
docker run it --volume $(PWD)/build:/go/src/eyedeekay/i2p.plugins.tor-manager/build \
--env-file $(HOME)/i2p.plugins.tor-manager/env \
--publish 127.0.0.1:7695:7695 \
-e DISPLAY=unix$(DISPLAY) \
-v /tmp/.X11-unix:/tmp/.X11-unix \
--rm eyedeekay/i2p.plugins.tor-manager