-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
53 lines (45 loc) · 1.75 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
# Automatic variables
VERSION = "$(shell grep -oP '(?<=firefox-).*(?=.tar.bz)' SHA256SUMS | head -1)"
ARCH = "$(shell uname -m)"
TARBALL = "firefox-$(VERSION).tar.bz2"
URL = "https://download-installer.cdn.mozilla.net/pub/firefox/releases/$(VERSION)/linux-$(ARCH)"
all:
true
clean:
true
distclean:
rm -rf vendor
rm -f invalid_sha
install:
tar \
--extract \
--file="vendor/$(TARBALL)" \
--one-top-level="$(DESTDIR)/usr/lib/firefox" \
--strip-components=1 \
--verbose
install -Dm0644 default-prefs.js $(DESTDIR)/usr/lib/firefox/defaults/pref/default-prefs.js
install -Dm0644 is-packaged-app $(DESTDIR)/usr/lib/firefox/is-packaged-app
install -Dm0644 policies.json $(DESTDIR)/usr/lib/firefox/distribution/policies.json
vendor:
rm -rf "[email protected]" "$@"
mkdir "[email protected]"
rm -f invalid_sha
curl \
-o "[email protected]/$(TARBALL)" \
"$(URL)/en-US/$(TARBALL)"
test "$$(cat SHA256SUMS | grep linux-x86_64/en-US/firefox-$(VERSION).tar.bz | cut -d ' ' -f1)" "=" "$$(sha256sum [email protected]/$(TARBALL) | cut -d' ' -f1)"
ls -1 langpacks | while read pkg_lang; do \
cat "langpacks/$${pkg_lang}" | while read xpi_lang; do \
curl \
-o "[email protected]/langpack-$${xpi_lang}@firefox.mozilla.org.xpi" \
"$(URL)/xpi/$${xpi_lang}.xpi"; \
correct_shasum=$$(cat SHA256SUMS | grep linux-x86_64/.*/$${xpi_lang}.xpi | cut -d ' ' -f1); \
download_shasum=$$(sha256sum [email protected]/langpack-$${xpi_lang}@firefox.mozilla.org.xpi | cut -d ' ' -f1); \
echo "Verifying hash of downloaded locale '$$xpi_lang': $$download_shasum ?= $$correct_shasum"; \
[ "$$correct_shasum" "=" "$$download_shasum" ] || echo "1" >> invalid_sha; \
done; \
if [ -e invalid_sha ]; then exit 1; fi; \
done \
touch "[email protected]"
mv -T "[email protected]" "$@"
.PHONY: all clean distclean install