@@ -36,6 +36,8 @@ echo "Building chrome version" $VERSION
3636
3737[ -d pkg ] || mkdir -p pkg
3838[ -e pkg/crx ] && rm -rf pkg/crx
39+ [ -e pkg/xpi-amo ] && rm -rf pkg/xpi-amo
40+ [ -e pkg/xpi-eff ] && rm -rf pkg/xpi-eff
3941
4042# Clean up obsolete ruleset databases, just in case they still exist.
4143rm -f src/chrome/content/rules/default.rulesets src/defaults/rulesets.sqlite
@@ -65,20 +67,33 @@ python2.7 -c "import json; m=json.loads(open('pkg/crx/manifest.json').read()); e
6567# sed -i -e "s/VERSION/$VERSION/g" pkg/crx/updates.xml
6668# sed -e "s/VERSION/$VERSION/g" pkg/updates-master.xml > pkg/crx/updates.xml
6769
70+ cp -a pkg/crx pkg/xpi-amo
71+ cp -a pkg/crx pkg/xpi-eff
72+ cp -a src/META-INF pkg/xpi-amo
73+ cp -a src/META-INF pkg/xpi-eff
74+
75+ # Remove the 'applications' manifest key from the crx version of the extension
76+ python2.7 -c " import json; m=json.loads(open('pkg/crx/manifest.json').read()); del m['applications']; open('pkg/crx/manifest.json','w').write(json.dumps(m,indent=4,sort_keys=True))"
77+ # Remove the 'update_url' manifest key from the xpi version of the extension delivered to AMO
78+ python2.7 -c " import json; m=json.loads(open('pkg/xpi-amo/manifest.json').read()); del m['applications']['gecko']['update_url']; open('pkg/xpi-amo/manifest.json','w').write(json.dumps(m,indent=4,sort_keys=True))"
79+
6880if [ -n " $BRANCH " ] ; then
6981 crx=" pkg/https-everywhere-$VERSION .crx"
70- xpi=" pkg/https-everywhere-$VERSION .xpi"
82+ xpi_amo=" pkg/https-everywhere-$VERSION -amo.xpi"
83+ xpi_eff=" pkg/https-everywhere-$VERSION -eff.xpi"
7184 key=../dummy-chromium.pem
7285else
7386 crx=" pkg/https-everywhere-$VERSION ~pre.crx"
74- xpi=" pkg/https-everywhere-$VERSION ~pre.xpi"
87+ xpi_amo=" pkg/https-everywhere-$VERSION ~pre-amo.xpi"
88+ xpi_eff=" pkg/https-everywhere-$VERSION ~pre-eff.xpi"
7589 key=dummy-chromium.pem
7690fi
7791if ! [ -f " $key " ] ; then
7892 echo " Making a dummy signing key for local build purposes"
7993 openssl genrsa 2048 > " $key "
8094fi
8195
96+
8297# # Based on https://code.google.com/chrome/extensions/crx.html
8398
8499dir=pkg/crx
120135 cat " $pub " " $sig " " $zip "
121136) > " $crx "
122137
123- cp $zip $xpi
124138
125- bash utils/android-push.sh " $xpi "
139+
140+ # now zip up the xpi AMO dir
141+ name=pkg/xpi-amo
142+ dir=pkg/xpi-amo
143+ zip=" $name .zip"
144+
145+ cwd=$( pwd -P)
146+ (cd " $dir " && ../../utils/create_xpi.py -n " $cwd /$zip " -x " ../../.build_exclusions" .)
147+ echo >&2 " AMO xpi package has sha1sum: ` sha1sum " $cwd /$zip " ` "
148+
149+ cp $zip $xpi_amo
150+
151+
152+
153+ # now zip up the xpi EFF dir
154+ name=pkg/xpi-eff
155+ dir=pkg/xpi-eff
156+ zip=" $name .zip"
157+
158+ cwd=$( pwd -P)
159+ (cd " $dir " && ../../utils/create_xpi.py -n " $cwd /$zip " -x " ../../.build_exclusions" .)
160+ echo >&2 " EFF xpi package has sha1sum: ` sha1sum " $cwd /$zip " ` "
161+
162+ cp $zip $xpi_eff
163+
164+
165+
166+ bash utils/android-push.sh " $xpi_eff "
126167
127168# rm -rf pkg/crx
128169
@@ -136,10 +177,14 @@ bash utils/android-push.sh "$xpi"
136177
137178echo >&2 " Total included rules: ` find src/chrome/content/rules -name " *.xml" | wc -l` "
138179echo >&2 " Rules disabled by default: ` find src/chrome/content/rules -name " *.xml" | xargs grep -F default_off | wc -l` "
180+ echo >&2 " Created $xpi_amo "
181+ echo >&2 " Created $xpi_eff "
139182echo >&2 " Created $crx "
140183if [ -n " $BRANCH " ]; then
141184 cd ..
142185 cp $SUBDIR /$crx pkg
186+ cp $SUBDIR /$xpi_amo pkg
187+ cp $SUBDIR /$xpi_eff pkg
143188 rm -rf $SUBDIR
144189fi
145190echo " $crx " # send to stdout so scripts can parse it
0 commit comments