-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMakefile
202 lines (160 loc) · 7.7 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
################################################################################
##
## This file is part of BetterPonymotes.
## Copyright (c) 2015 Typhos.
##
## This program is free software: you can redistribute it and/or modify it
## under the terms of the GNU Affero General Public License as published by
## the Free Software Foundation, either version 3 of the License, or (at your
## option) any later version.
##
## This program is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
## for more details.
##
## You should have received a copy of the GNU Affero General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
##
################################################################################
# Release process:
# - Update emotes & tags
# - Check subreddit, private messages, and github
# - Bump version, update we-updates.json
# $ make
# - Upload Chrome addon
# - Upload webext
# $ make www
# $ make sync
# - chmod 644
# $ git ci -m "Bump version to x.y"
# $ git push github master
# - Test
# - Make thread
VERSION = 66.270
CONTENT_SCRIPT := \
addon/bpm-header.js addon/bpm-utils.js addon/bpm-browser.js \
addon/bpm-store.js addon/bpm-search.js addon/bpm-inject.js \
addon/bpm-searchbox.js addon/bpm-frames.js addon/bpm-alttext.js \
addon/bpm-post.js addon/bpm-reddit.js addon/bpm-global.js addon/bpm-main.js
EMOTE_DATA = emotes/*.json tags/*.json data/rules.yaml data/tags.yaml
ADDON_DATA = \
build/bpm-resources.js build/emote-classes.css build/betterponymotes.js \
addon/bpmotes.css addon/combiners-nsfw.css addon/extracss-pure.css addon/extracss-webkit.css \
addon/bootstrap.css addon/options.html addon/options.css addon/options.js \
addon/pref-setup.js
default: build/betterponymotes-$(VERSION).xpi build/webext-$(VERSION).zip build/chrome.zip build/BPM.safariextension build/export.json.bz2 build/gif-animotes.css
clean:
rm -fr build
www: web/* build/betterponymotes-$(VERSION).xpi build/betterponymotes.update.rdf build/betterponymotes-$(VERSION)-an+fx.xpi addon/we-updates.json
cp web/firefox-logo.png www
cp web/chrome-logo.png www
cp web/safari-logo.png www
cp web/relay-logo.png www
cp web/ponymotes-logo.png www
sed "s/\/\*{{version}}\*\//$(VERSION)/" < web/index.html > www/index.html
rm -f www/*.xpi
cp build/betterponymotes-$(VERSION).xpi www/xul/betterponymotes.xpi
cp build/betterponymotes-$(VERSION).xpi www/xul/betterponymotes-$(VERSION).xpi
cp build/betterponymotes-$(VERSION)-an+fx.xpi www/we/betterponymotes.xpi
cp build/betterponymotes-$(VERSION)-an+fx.xpi www/we/betterponymotes-$(VERSION)-an+fx.xpi
sync:
chmod 644 www/*
chmod 755 www/we www/xul
chmod 644 www/we/* www/xul/*
chmod 644 animotes/*
rsync -e "ssh -p 40719" -zvLr --delete www/ lyra@ponymotes.net:/var/www/ponymotes.net/bpm
rsync -e "ssh -p 40719" -zvLr --delete animotes/ lyra@ponymotes.net:/var/www/ponymotes.net/animotes
build/betterponymotes.js: $(CONTENT_SCRIPT)
mkdir -p build
cat $(CONTENT_SCRIPT) > build/betterponymotes.js
build/bpm-resources.js build/emote-classes.css: $(EMOTE_DATA)
mkdir -p build
./bpgen.py
build/export.json.bz2: build/export.json
bzip2 < build/export.json > build/export.json.bz2
build/export.json: $(EMOTE_DATA)
./bpexport.py --json build/export.json
build/gif-animotes.css: $(EMOTE_DATA)
mkdir -p build
./dlanimotes.py
build/betterponymotes-$(VERSION).xpi: $(ADDON_DATA) addon/fx-main.js addon/fx-install.rdf addon/fx-package.json
mkdir -p build/firefox/data
sed "s/\/\*{{version}}\*\//$(VERSION)/" < addon/fx-package.json > build/firefox/package.json
cp addon/fx-main.js build/firefox/index.js
cp build/betterponymotes.js build/firefox/data
cp build/bpm-resources.js build/firefox/data
cp build/bpm-resources.js build/firefox
cp build/emote-classes.css build/firefox/data
cp addon/bootstrap.css build/firefox/data
cp addon/bpmotes.css build/firefox/data
cp addon/combiners-nsfw.css build/firefox/data
cp addon/extracss-pure.css build/firefox/data
cp addon/extracss-webkit.css build/firefox/data
cp addon/options.css build/firefox/data
cp addon/options.html build/firefox/data
cp addon/options.js build/firefox/data
cp addon/pref-setup.js build/firefox
cd build/firefox && ../../node_modules/.bin/jpm xpi
./mungexpi.py $(VERSION) addon/fx-install.rdf build/firefox/*.xpi build/betterponymotes-$(VERSION).xpi
build/betterponymotes.update.rdf: build/betterponymotes-$(VERSION).xpi
uhura -k betterponymotes.pem build/betterponymotes-$(VERSION).xpi https://ponymotes.net/bpm/xul/betterponymotes-$(VERSION).xpi > build/betterponymotes.update.rdf
build/webext-$(VERSION).zip: $(ADDON_DATA) addon/cr-background.html addon/cr-background.js addon/we-manifest.json
mkdir -p build/webext
sed "s/\/\*{{version}}\*\//$(VERSION)/" < addon/we-manifest.json > build/webext/manifest.json
cp addon/cr-background.html build/webext/background.html
cp addon/cr-background.js build/webext/background.js
cp build/betterponymotes.js build/webext
cp build/bpm-resources.js build/webext
cp build/emote-classes.css build/webext
cp addon/bootstrap.css build/webext
cp addon/bpmotes.css build/webext
cp addon/combiners-nsfw.css build/webext
cp addon/extracss-pure.css build/webext
cp addon/extracss-webkit.css build/webext
cp addon/options.css build/webext
cp addon/options.html build/webext
cp addon/options.js build/webext
cp addon/pref-setup.js build/webext
cd build/webext && zip ../webext-$(VERSION).zip *
build/chrome.zip: $(ADDON_DATA) addon/cr-background.html addon/cr-background.js addon/cr-manifest.json
mkdir -p build/chrome
sed "s/\/\*{{version}}\*\//$(VERSION)/" < addon/cr-manifest.json > build/chrome/manifest.json
cp addon/cr-background.html build/chrome/background.html
cp addon/cr-background.js build/chrome/background.js
cp build/betterponymotes.js build/chrome
cp build/bpm-resources.js build/chrome
cp build/emote-classes.css build/chrome
cp addon/bootstrap.css build/chrome
cp addon/bpmotes.css build/chrome
cp addon/combiners-nsfw.css build/chrome
cp addon/extracss-pure.css build/chrome
cp addon/extracss-webkit.css build/chrome
cp addon/options.css build/chrome
cp addon/options.html build/chrome
cp addon/options.js build/chrome
cp addon/pref-setup.js build/chrome
cp betterponymotes.pem build/chrome/key.pem
# Uncompressed due to prior difficulties with the webstore
cd build/chrome && zip -0 ../chrome.zip *
build/BPM.safariextension: $(ADDON_DATA) addon/sf-Settings.plist addon/sf-background.html addon/sf-background.js
mkdir -p build/BPM.safariextension
sed "s/\/\*{{version}}\*\//$(VERSION)/" < addon/sf-Info.plist > build/BPM.safariextension/Info.plist
cp addon/icons/sf-Icon-128.png build/BPM.safariextension/Icon-128.png
cp addon/icons/sf-Icon-64.png build/BPM.safariextension/Icon-64.png
cp addon/sf-background.html build/BPM.safariextension/background.html
cp addon/sf-background.js build/BPM.safariextension/background.js
cp addon/sf-Settings.plist build/BPM.safariextension/Settings.plist
cp build/betterponymotes.js build/BPM.safariextension
cp build/bpm-resources.js build/BPM.safariextension
cp build/emote-classes.css build/BPM.safariextension
cp addon/bootstrap.css build/BPM.safariextension
cp addon/bpmotes.css build/BPM.safariextension
cp addon/combiners-nsfw.css build/BPM.safariextension
cp addon/extracss-pure.css build/BPM.safariextension
cp addon/extracss-webkit.css build/BPM.safariextension
cp addon/options.css build/BPM.safariextension
cp addon/options.html build/BPM.safariextension
cp addon/options.js build/BPM.safariextension
cp addon/pref-setup.js build/BPM.safariextension
cd build/BPM.safariextension && zip ../BPM.safariextension.zip *