-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
323 lines (255 loc) · 15.1 KB
/
Makefile
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
PREFIX?=/usr
default: zip
PWD=`pwd`
install: uninstall
mkdir -p $(PREFIX)/share/webext/[email protected] \
$(PREFIX)/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}
@echo $(PWD)
cp -v ./* $(PREFIX)/share/webext/[email protected]/; true
cp -vr ./i2pcontrol $(PREFIX)/share/webext/[email protected]/i2pcontrol
cp -vr ./torrent $(PREFIX)/share/webext/[email protected]/torrent
cp -vr ./_locales $(PREFIX)/share/webext/[email protected]/_locales
cp -vr ./icons $(PREFIX)/share/webext/[email protected]/icons
cp -vr ./options $(PREFIX)/share/webext/[email protected]/options
make link
link:
ln -sf $(PREFIX)/share/webext/[email protected] \
$(PREFIX)/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/[email protected]
uninstall:
rm -rf $(PREFIX)/share/webext/[email protected] \
$(PREFIX)/share/webext/[email protected] \
$(PREFIX)/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/[email protected]
ls:
ls -lah $(PREFIX)/share/webext/[email protected]; \
ls -lah $(PREFIX)/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}
clean: rc clean-artifacts
rm -fr ../i2psetproxy.js.zip ../i2p_proxy*.xpi *.torrent #../i2psetproxy.js_*.*
## EVEN RELEASES are AMO RELEASES
## ODD RELEASES are SELFHOSTED RELEASES
MOZ_VERSION=2.7.0
VERSION=2.7.1
LAST_VERSION=$(shell grep '"version"' manifest.json | sed 's|"version"||g' | tr -d " :,'" | tr -d '"')
YELLOW=F7E59A
ORANGE=FFC56D
GREY=D9D9D6
BLUE=A4C8E1
PURPLE=A48fE1
colors:
@echo "'$(LAST_VERSION)'"
@echo " yellow $(YELLOW) \n orange $(ORANGE) \n grey $(GREY) \n blue $(BLUE) \n purple $(PURPLE)"
amo-readme:
markdown README.md | \
sed 's|<p>||g' | \
sed 's|</p>||g' | \
sed 's|<h1>|<strong>|g' | \
sed 's|</h1>|</strong>|g' | \
sed 's|<h2>|<strong>|g' | \
sed 's|</h2>|</strong>|g' | \
sed 's|<h3>|<strong>|g' | \
sed 's|</h3>|</strong>|g' | \
grep -v '<img' > amo-index.html
MAGNET=`rhash --magnet [email protected]`
index:
@echo "<!DOCTYPE html>" > index.html
@echo "<html>" >> index.html
@echo "<head>" >> index.html
@echo " <title>I2P in Private Browsing Mode</title>" >> index.html
@echo " <link rel=\"stylesheet\" type=\"text/css\" href=\"home.css\" />" >> index.html
@echo " <link rel=\"stylesheet\" type=\"text/css\" href=\"sidebar.css\" />" >> index.html
@echo "</head>" >> index.html
@echo "<body>" >> index.html
@echo "<div class=\"content\" id=\"browserpanel\">" >> index.html
sed "s|magnetsub|[Magnet Link]($(MAGNET))|g" README.md | sed 's|README.md|index.html|g' | markdown >> index.html
@echo "</div>" >> index.html
@echo "</body>" >> index.html
@echo "</html>" >> index.html
torrenthelp:
@echo "<!DOCTYPE html>" > torrent/index.html
@echo "<html>" >> torrent/index.html
@echo "<head>" >> torrent/index.html
@echo " <title>I2P in Private Browsing Mode</title>" >> torrent/index.html
@echo " <link rel=\"stylesheet\" type=\"text/css\" href=\"../home.css\" />" >> torrent/index.html
@echo " <link rel=\"stylesheet\" type=\"text/css\" href=\"../sidebar.css\" />" >> torrent/index.html
@echo "</head>" >> torrent/index.html
@echo "<body>" >> torrent/index.html
sed "s|magnetsub|[Magnet Link]($(MAGNET))|g" torrent/README.md | markdown >> torrent/index.html
@echo "</body>" >> torrent/index.html
@echo "</html>" >> torrent/index.html
xpi: getxpi
version:
sed -i 's|7647|7657|g' *.js* torrent/*.js*
find . -name '*.json' -exec sed -i 's|$(LAST_VERSION)|$(VERSION)|g' {} \;
find . -name '*.json' -exec sed -i 's|$(MOZ_VERSION)|$(VERSION)|g' {} \;
moz-version:
sed -i 's|7647|7657|g' *.js* torrent/*.js*
find . -name '*.json' -exec sed -i 's|$(LAST_VERSION)|$(MOZ_VERSION)|g' {} \;
find . -name '*.json' -exec sed -i 's|$(VERSION)|$(MOZ_VERSION)|g' {} \;
rhz-version:
sed -i 's|7657|7647|g' *.js* torrent/*.js*
zip: version
zip --exclude="./[email protected]" \
--exclude="./[email protected]" \
--exclude="./i2psetproxy.js.png" \
--exclude="./i2psetproxy.js.gif" \
--exclude="./package.json" \
--exclude="./package-lock.json" \
--exclude="./.node_modules" \
--exclude="./node_modules" \
--exclude="./.git" \
--exclude="*/*.xpi" \
--exclude="web-ext-artifacts" \
--exclude="./*.pdf" -r -FS ../i2psetproxy.js.zip *
rc:
@grep "$(VERSION)" debian/changelog
@echo "changelog is prepared"
rm -f *.xpi
rtest: rc index torrenthelp
release: rc index torrenthelp
cat desc debian/changelog | grep -B 10 "$(LAST_VERSION)" | github-release release -p -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n $(VERSION) -d -; true
update-release:
cat desc debian/changelog | grep -B 10 "$(LAST_VERSION)" | github-release edit -p -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n $(VERSION) -d -; true
delete-release:
github-release delete -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION); true
recreate-release: delete-release release upload
upload: upload-xpi upload-deb
moz-release: release moz-submit
#upload-xpi torrent upload-torrent deb upload-deb upload-rss seed
full-sign: moz-sign upload-xpi torrent upload-torrent deb upload-deb upload-rss seed
WEB_EXT_API_KEY=AMO_KEY
WEB_EXT_API_SECRET=AMO_SECRET
-include ../api_keys_moz.mk
tk:
echo $(WEB_EXT_API_KEY)
submit: moz-submit moz-sign
clean-artifacts:
rm -fr web-ext-artifacts/*
##ODD NUMBERED, SELF-DISTRIBUTED VERSIONS HERE!
moz-sign: version clean-artifacts
@echo "Using the 'sign' target to instantly sign an extension for self-distribution"
@echo "requires a JWT API Key and Secret from addons.mozilla.org to be made available"
@echo "to the Makefile under the variables WEB_EXT_API_KEY and WEB_EXT_API_SECRET."
$(HOME)/node_modules/.bin/web-ext sign --use-submission-api --channel unlisted --config-discovery false --api-key $(WEB_EXT_API_KEY) --api-secret $(WEB_EXT_API_SECRET) --timeout 900000 #--api-url-prefix http://localhost:3000/api/v4
make copyss
sleep 5
copyss:
cp web-ext-artifacts/*.xpi ../[email protected]; true
##EVEN NUMBERED, MOZILLA-DISTRIBUTED VERSIONS HERE!
moz-submit: moz-version
@echo "Using the 'submit' target to instantly sign an extension for Mozilla distribution"
@echo "requires a JWT API Key and Secret from addons.mozilla.org to be made available"
@echo "to the Makefile under the variables WEB_EXT_API_KEY and WEB_EXT_API_SECRET."
mv manifest.json .manifest.json
grep -v update_url .manifest.json > manifest.json
$(HOME)/node_modules/.bin/web-ext sign --use-submission-api --channel listed --config-discovery false --api-key $(WEB_EXT_API_KEY) --api-secret $(WEB_EXT_API_SECRET) --timeout 900000 --verbose; true #--api-url-prefix http://localhost:3000/api/v4
sleep 5
mv .manifest.json manifest.json
rhz-submit: rhz-version
@echo "Rhizome releases are disabled while browser is completed."
#@echo "Using the 'sign' target to instantly sign an extension for self-distribution"
#@echo "requires a JWT API Key and Secret from addons.mozilla.org to be made available"
#@echo "to the Makefile under the variables WEB_EXT_API_KEY and WEB_EXT_API_SECRET."
#$PWD/node_modules/web-ext-submit/extender.sh --channel unlisted --config-discovery false --api-key $(WEB_EXT_API_KEY) --api-secret $(WEB_EXT_API_SECRET); true
#cp web-ext-artifacts/*.xpi ./[email protected]
getxpi:
github-release download -t $(VERSION) -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -n [email protected]
mv ./[email protected] ../i2ppb-$(VERSION)@eyedeekay.github.io.xpi
cp ../i2ppb-$(VERSION)@eyedeekay.github.io.xpi ../[email protected]
torrent: getxpi
rm -f "./i2ppb-$(VERSION)@eyedeekay.github.io.xpi.torrent"
mktorrent -a http://w7tpbzncbcocrqtwwm3nezhnnsw4ozadvi2hmvzdhrqzfxfum7wa.b32.i2p/a \
-a http://zviyq72xcmjupynn5y2f5qa3u7bxyu34jnqmwt6czte2l7idxm7q.b32.i2p/announce \
-a http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a \
-a http://uajd4nctepxpac4c4bdyrdw7qvja2a5u3x25otfhkptcjgd53ioq.b32.i2p/announce \
-n "i2ppb-$(VERSION)@eyedeekay.github.io.xpi" \
-o "i2ppb-$(VERSION)@eyedeekay.github.io.xpi.torrent" \
-w https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases/download/$(VERSION)/[email protected] \
../[email protected]; true
cp -v "./i2ppb-$(VERSION)@eyedeekay.github.io.xpi.torrent" "./[email protected]"
make index
upload-torrent:
github-release upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "[email protected]" -f "./i2ppb-$(VERSION)@eyedeekay.github.io.xpi.torrent"
upload-xpi:
github-release upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "[email protected]" -f "../[email protected]"
upload-deb:
github-release upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2psetproxy.js_$(VERSION)-1_amd64.deb" -f "../i2psetproxy.js_$(VERSION)-1_amd64.deb"
github-release upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2psetproxy.js_$(VERSION).orig.tar.gz" -f "../i2psetproxy.js_$(VERSION).orig.tar.gz"
github-release upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2psetproxy.js_$(VERSION)-1.debian.tar.xz" -f "../i2psetproxy.js_$(VERSION)-1.debian.tar.xz"
github-release upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2psetproxy.js_$(VERSION)-1.dsc" -f "../i2psetproxy.js_$(VERSION)-1.dsc"
github-release upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2psetproxy.js_$(VERSION)-1_amd64.changes" -f "../i2psetproxy.js_$(VERSION)-1_amd64.changes"
github-release upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2psetproxy.js_$(VERSION)-1_amd64.buildinfo" -f "../i2psetproxy.js_$(VERSION)-1_amd64.buildinfo"
upload-docs:
github-release release -p -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t docs -n "Documentation" -d "PDF's and text about the extension"; true
github-release upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t docs -n "Landing Page Documentation.pdf" -f ../smartlander.pdf
github-release upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t docs -n "Browser Design Documentation.pdf" -f ../browser.pdf
fmt: fmt-css fmt-html fmt-js
fmt-css:
cleancss -O1 all -O2 all --format beautify home.css -o .home.css && mv .home.css home.css
cleancss -O1 all -O2 all --format beautify info.css -o .info.css && mv .info.css info.css
cleancss -O1 all -O2 all --format beautify search.css -o .search.css && mv .search.css search.css
cleancss -O1 all -O2 all --format beautify sidebar.css -o .sidebar.css && mv .sidebar.css sidebar.css
cleancss -O1 all -O2 all --format beautify options/options.css -o options/.options.css && mv options/.options.css options/options.css
fmt-html:
tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes index.html > .index.html; mv .index.html index.html
tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes window.html > .window.html; mv .window.html window.html
tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes home.html > .home.html; mv .home.html home.html
tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes security.html > .security.html; mv .security.html security.html
tidy --as-xhtml --drop-empty-elements no --input-xml --tidy-mark no -indent --indent-spaces 4 -wrap 0 --new-blocklevel-tags article,header,footer --new-inline-tags video,audio,canvas,ruby,rt,rp --break-before-br yes --sort-attributes alpha --vertical-space yes options/options.html > options/.options.html; mv options/.options.html options/options.html
fmt-js:
fixjsstyle *.js
fixjsstyle options/*.js
fixjsstyle torrent/*.js
fixjsstyle i2pcontrol/*.js
fixjsstyle manifest.json
#work around fixjsstyle issue
sed -i 's|= >|=>|g' *.js */*.js
#find . -path ./node_modules -prune -o -name '*.json' -exec fixjsstyle --write {} \;
fmt-locales:
find _locales -name '*.js*' -exec $(HOME)/node_modules/.bin/prettier -w {} \;
fmt-prettier:
find . -name '*.js*' -exec $(HOME)/node_modules/.bin/prettier -w {} \;
lint:
gjslint *.js; true
#eslint --color *.js
deborig: version
rm -rf ../i2psetproxy.js-$(VERSION)
mkdir -p ../i2psetproxy.js-$(VERSION)
cp -r ./* ../i2psetproxy.js-$(VERSION)
cd ../i2psetproxy.js-$(VERSION) && \
rm -rf web-ext-artifacts .git node_modules && \
tar \
-cvz \
--exclude=i2psetproxy.js.gif \
--exclude=*.pdf \
-f ../i2psetproxy.js_$(VERSION).orig.tar.gz \
.
deb: deborig
cd ../i2psetproxy.js-$(VERSION) && debuild -us -uc -rfakeroot
-include mirrors.mk
dat:
wget -c -O dat.js https://bundle.run/dat-js
rss: torrent
rm -f releases.diff
mv releases.atom .releases.atom
wget https://github.com/eyedeekay/I2P-in-Private-Browsing-Mode-Firefox/releases.atom
sed -i "s|<title>$(VERSION)</title>|<title>$(VERSION)</title>\n <enclosure url=\"$(MAGNET)\" type=\"application/x-bittorrent\" />|g" releases.atom
upload-rss: rss
github-release upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t docs -n "releases.atom" -f releases.atom
upload-updatemanifest:
github-release upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t docs -n "updateManifest.json" -f updateManifest.json
webext:
mkdir -p profile
$(HOME)/node_modules/.bin/web-ext run --firefox /usr/bin/firefox --firefox-profile ./profile -u "about:devtools-toolbox?type=extension&id=i2ppb%40eyedeekay.github.io" http://idk.i2p http://localhost:7657 https://github.com/i2p/i2p.i2p https://i2pgit.org/i2p-hackers/i2p.i2p
snark-mirror:
http_proxy=http://127.0.0.1:4444 wget -c -O ../i2psnark-rpc.su3 http://stats.i2p/i2p/plugins/i2psnark-rpc.su3
github-release upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2psnark-rpc.su3" -f ../i2psnark-rpc.su3
http_proxy=http://127.0.0.1:4444 wget -c -O ../i2psnark-rpc-update.su3 http://stats.i2p/i2p/plugins/i2psnark-rpc-update.su3
github-release upload -R -u eyedeekay -r I2P-in-Private-Browsing-Mode-Firefox -t $(VERSION) -n "i2psnark-rpc-update.su3" -f ../i2psnark-rpc-update.su3
seed:
cp -v "./i2ppb-$(VERSION)@eyedeekay.github.io.xpi.torrent" "$(HOME)/.i2p/i2psnark"
cp -v "../i2ppb-$(VERSION)@eyedeekay.github.io.xpi" "$(HOME)/.i2p/i2psnark"
android:
$(HOME)/node_modules/.bin/web-ext run \
--target firefox-android \
--android-device HT78N1A00453 \
--firefox-apk org.mozilla.fenix
run: webext