This repository has been archived by the owner on Jan 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
/
Makefile
93 lines (78 loc) · 3.67 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
FILES=data lib package.json README.md bootstrap.js
ADDON_NAME=valence
ADDON_VERSION=0.3.9pre
XPI_NAME=$(ADDON_NAME)-$(ADDON_VERSION)
SOURCE_ZIPFILE=$(XPI_NAME)-sources.zip
REMOTE_ROOT_PATH=/pub/labs/valence/
UPDATE_LINK=https://ftp.mozilla.org$(REMOTE_ROOT_PATH)
UPDATE_URL=$(UPDATE_LINK)
S3_BASE_URL=s3://net-mozaws-prod-delivery-contrib$(REMOTE_ROOT_PATH)
XPIS = $(XPI_NAME)-win32.xpi $(XPI_NAME)-linux32.xpi $(XPI_NAME)-linux64.xpi $(XPI_NAME)-mac64.xpi
all: $(XPIS)
define build-xpi
echo "build xpi for $1";
mv install.rdf jpm_install.rdf
sed -e 's#@@UPDATE_URL@@#$(UPDATE_URL)$1/update.rdf#;s#@@ADDON_VERSION@@#$(ADDON_VERSION)#' template/install.rdf > install.rdf
zip $(XPI_NAME)-$1.xpi -r $2 install.rdf
mv jpm_install.rdf install.rdf
endef
bootstrap.js: template
cp template/bootstrap.js bootstrap.js
$(XPI_NAME)-win32.xpi: $(FILES) tools/win32
@$(call build-xpi,win32, $^)
$(XPI_NAME)-linux32.xpi: $(FILES) tools/linux32 tools/linux64
@$(call build-xpi,linux32, $^)
$(XPI_NAME)-linux64.xpi: $(FILES) tools/linux32 tools/linux64
@$(call build-xpi,linux64, $^)
$(XPI_NAME)-mac64.xpi: $(FILES) tools/mac64
@$(call build-xpi,mac64, $^)
clean:
rm -f *.xpi
rm -f update.rdf bootstrap.js
define release
./sign.sh $(XPI_NAME)-$1.xpi
echo "releasing $1"
aws s3 cp $(XPI_NAME)-$1.xpi $(S3_BASE_URL)$1/$(XPI_NAME)-$1.xpi
# Update the "latest" symbolic link with a copy inside s3
aws s3 cp $(S3_BASE_URL)$1/$(XPI_NAME)-$1.xpi $(S3_BASE_URL)$1/$(ADDON_NAME)-$1-latest.xpi
# Update a "latest" symbolic link with a copy inside s3 for compat with Fx 39 and earlier
aws s3 cp $(S3_BASE_URL)$1/$(XPI_NAME)-$1.xpi $(S3_BASE_URL)$1/fxdt-adapters-$1-latest.xpi
# Update the update manifest
sed -e 's#@@UPDATE_LINK@@#$(UPDATE_LINK)$1/$(XPI_NAME)-$1.xpi#;s#@@ADDON_VERSION@@#$(ADDON_VERSION)#' template/update.rdf > update.rdf
aws s3 cp --cache-control max-age=3600 update.rdf $(S3_BASE_URL)$1/update.rdf
endef
release: $(XPIS) archive-sources
@$(call release,win32)
@$(call release,linux32)
@$(call release,linux64)
@$(call release,mac64)
aws s3 cp ../$(SOURCE_ZIPFILE) $(S3_BASE_URL)sources/$(SOURCE_ZIPFILE)
# Update latest with a copy inside s3
aws s3 cp $(S3_BASE_URL)sources/$(SOURCE_ZIPFILE) $(S3_BASE_URL)sources/$(ADDON_NAME)-latest-sources.zip
# Expects to find the following directories in the same level as this one:
#
# ios-webkit-debug-proxy (https://github.com/google/ios-webkit-debug-proxy)
# ios-webkit-debug-proxy-win32 (https://github.com/artygus/ios-webkit-debug-proxy-win32)
# libimobiledevice (https://github.com/libimobiledevice/libimobiledevice)
# libplist (https://github.com/libimobiledevice/libplist)
# libusbmuxd (https://github.com/libimobiledevice/libusbmuxd)
# openssl (https://github.com/openssl/openssl)
# libxml2 (git://git.gnome.org/libxml2.git)
# libiconv (git://git.savannah.gnu.org/libiconv.git)
# pcre (svn://vcs.exim.org/pcre2/code/trunk)
# zlib (http://zlib.net/)
archive-sources:
@echo "archiving $1 sources"
@echo "(make sure you have run 'make distclean' in all dependencies!)"
rm -f ../$(SOURCE_ZIPFILE)
cd .. && zip -qx \*.git\* -r $(SOURCE_ZIPFILE) $(ADDON_NAME)
cd .. && zip -qx \*.git\* -r $(SOURCE_ZIPFILE) ios-webkit-debug-proxy
cd .. && zip -qx \*.git\* -r $(SOURCE_ZIPFILE) ios-webkit-debug-proxy-win32
cd .. && zip -qx \*.git\* -r $(SOURCE_ZIPFILE) libimobiledevice
cd .. && zip -qx \*.git\* -r $(SOURCE_ZIPFILE) libplist
cd .. && zip -qx \*.git\* -r $(SOURCE_ZIPFILE) libusbmuxd
cd .. && zip -qx \*.git\* -r $(SOURCE_ZIPFILE) openssl
cd .. && zip -qx \*.git\* -r $(SOURCE_ZIPFILE) libxml2
cd .. && zip -qx \*.git\* -r $(SOURCE_ZIPFILE) libiconv
cd .. && zip -qx \*.git\* -r $(SOURCE_ZIPFILE) pcre
cd .. && zip -qx \*.git\* -r $(SOURCE_ZIPFILE) zlib