summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2018-12-23 12:01:24 -0500
committerAndrew Cady <d@jerkface.net>2018-12-23 12:01:24 -0500
commit0c4ea701a4221bfd0baac8aa211e31e99e5b9ab1 (patch)
treeedd3f851f82ab7d379a0050abe15dd570ab27e33
initial commit
-rwxr-xr-xMakefile194
l---------install-firefox1
2 files changed, 195 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100755
index 0000000..3f7b6d9
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,194 @@
1#!/usr/bin/make -f
2ifeq (beta,$(MAKECMDGOALS))
3product=-beta
4else
5ifeq (nightly,$(MAKECMDGOALS))
6product=-nightly
7else
8ifeq (stable,$(MAKECMDGOALS))
9product=
10else
11ifeq (,$(MAKECMDGOALS))
12product=
13else
14$(error Incorrect target specified. Specify at most one argument of "beta", "nightly", or "stable")
15endif
16endif
17endif
18endif
19
20ifneq (0,$(shell id -u))
21optdir=$(HOME)/.local/opt
22applications_dir=$(HOME)/.local/share/applications
23$(warning Warning: You are not root. Installing into $(optdir))
24else
25optdir=/opt
26applications_dir=/usr/share/applications
27endif
28
29os=linux64
30lang=en-US
31orig_url="https://download.mozilla.org/?product=firefox$(product)-latest-ssl&os=$(os)&lang=$(lang)"
32
33url := $(shell curl -sI $(orig_url) | sed -n 's/^Location: //p')
34$(if $(url),,$(error Could not determine url. orig_url=$(orig_url)))
35
36# Use a path that only trusted users can write into. So not /tmp.
37dldir=$(optdir)
38
39tarball=$(dldir)/$(notdir $(url))
40destdir=$(optdir)/$(notdir $(tarball:.tar.bz2=))
41tempdir=$(destdir)~tmp
42
43symlink=$(optdir)/firefox
44desktop_file=$(applications_dir)/firefox.desktop
45global_symlink=/usr/local/bin/firefox
46
47.DEFAULT_GOAL = install
48
49.PHONY: install $(desktop_file) $(global_symlink) alternatives beta nightly stable $(symlink)
50
51install: $(symlink) $(desktop_file) $(global_symlink) alternatives
52
53$(global_symlink):
54 mkdir -p $(dir $@)
55 ln -sf $(optdir)/firefox/firefox $(dir $@)
56
57alternatives:
58 update-alternatives --install /usr/bin/x-www-browser x-www-browser $(optdir)/firefox/firefox 200
59 update-alternatives --set x-www-browser $(optdir)/firefox/firefox
60
61$(desktop_file):
62 : write file $@ $(file >$@,$(desktop_file_contents))
63
64$(symlink): $(destdir)
65 cd $(dir $@) && ln -sf $(notdir $(destdir)) $(notdir $@)
66
67beta nightly stable: install
68
69$(destdir): $(tarball)
70 mkdir -p $(tempdir)
71 tar -C $(tempdir) --strip-components=1 -jxf $<
72 mv $(tempdir) $(destdir)
73 rm $(tarball) || true
74
75.INTERMEDIATE: $(tarball)
76
77$(tarball):
78 mkdir -p $(dir $@)
79 curl -C- -o $@.partial $(url)
80 mv $@.partial $@
81
82FIREFOX_DIR=$(optdir)/firefox
83FIREFOX_EXEC=$(FIREFOX_DIR)/firefox
84FIREFOX_ICON=$(FIREFOX_DIR)/browser/chrome/icons/default/default128.png
85
86firefox.desktop:
87 : $(file > $(desktop_file_contents))
88
89define desktop_file_contents
90[Desktop Entry]
91Name=Firefox
92Name[bg]=Firefox
93Name[ca]=Firefox
94Name[cs]=Firefox
95Name[el]=Firefox
96Name[es]=Firefox
97Name[fa]=Firefox
98Name[fi]=Firefox
99Name[fr]=Firefox
100Name[hu]=Firefox
101Name[it]=Firefox
102Name[ja]=Firefox
103Name[ko]=Firefox
104Name[nb]=Firefox
105Name[nl]=Firefox
106Name[nn]=Firefox
107Name[no]=Firefox
108Name[pl]=Firefox
109Name[pt]=Firefox
110Name[pt_BR]=Firefox
111Name[ru]=Firefox
112Name[sk]=Firefox
113Name[sv]=Firefox
114Comment=Browse the World Wide Web
115Comment[bg]=Сърфиране в Мрежата
116Comment[ca]=Navegueu per el web
117Comment[cs]=Prohlížení stránek World Wide Webu
118Comment[de]=Im Internet surfen
119Comment[el]=Περιηγηθείτε στον παγκόσμιο ιστό
120Comment[es]=Navegue por la web
121Comment[fa]=صفحات شبکه جهانی اینترنت را مرور نمایید
122Comment[fi]=Selaa Internetin WWW-sivuja
123Comment[fr]=Navigue sur Internet
124Comment[hu]=A világháló böngészése
125Comment[it]=Esplora il web
126Comment[ja]=ウェブを閲覧します
127Comment[ko]=웹을 돌아 다닙니다
128Comment[nb]=Surf på nettet
129Comment[nl]=Verken het internet
130Comment[nn]=Surf på nettet
131Comment[no]=Surf på nettet
132Comment[pl]=Przeglądanie stron WWW
133Comment[pt]=Navegue na Internet
134Comment[pt_BR]=Navegue na Internet
135Comment[ru]=Обозреватель Всемирной Паутины
136Comment[sk]=Prehliadanie internetu
137Comment[sv]=Surfa på webben
138GenericName=Web Browser
139GenericName[bg]=Интернет браузър
140GenericName[ca]=Navegador web
141GenericName[cs]=Webový prohlížeč
142GenericName[de]=Webbrowser
143GenericName[el]=Περιηγητής ιστού
144GenericName[es]=Navegador web
145GenericName[fa]=مرورگر اینترنتی
146GenericName[fi]=WWW-selain
147GenericName[fr]=Navigateur Web
148GenericName[hu]=Webböngésző
149GenericName[it]=Browser Web
150GenericName[ja]=ウェブ・ブラウザ
151GenericName[ko]=웹 브라우저
152GenericName[nb]=Nettleser
153GenericName[nl]=Webbrowser
154GenericName[nn]=Nettlesar
155GenericName[no]=Nettleser
156GenericName[pl]=Przeglądarka WWW
157GenericName[pt]=Navegador Web
158GenericName[pt_BR]=Navegador Web
159GenericName[ru]=Интернет-браузер
160GenericName[sk]=Internetový prehliadač
161GenericName[sv]=Webbläsare
162X-GNOME-FullName=Firefox Web Browser
163X-GNOME-FullName[bg]=Интернет браузър (Firefox)
164X-GNOME-FullName[ca]=Navegador web Firefox
165X-GNOME-FullName[cs]=Firefox Webový prohlížeč
166X-GNOME-FullName[el]=Περιηγήτης Ιστού Firefox
167X-GNOME-FullName[es]=Navegador web Firefox
168X-GNOME-FullName[fa]=مرورگر اینترنتی Firefox
169X-GNOME-FullName[fi]=Firefox-selain
170X-GNOME-FullName[fr]=Navigateur Web Firefox
171X-GNOME-FullName[hu]=Firefox webböngésző
172X-GNOME-FullName[it]=Firefox Browser Web
173X-GNOME-FullName[ja]=Firefox ウェブ・ブラウザ
174X-GNOME-FullName[ko]=Firefox 웹 브라우저
175X-GNOME-FullName[nb]=Firefox Nettleser
176X-GNOME-FullName[nl]=Firefox webbrowser
177X-GNOME-FullName[nn]=Firefox Nettlesar
178X-GNOME-FullName[no]=Firefox Nettleser
179X-GNOME-FullName[pl]=Przeglądarka WWW Firefox
180X-GNOME-FullName[pt]=Firefox Navegador Web
181X-GNOME-FullName[pt_BR]=Navegador Web Firefox
182X-GNOME-FullName[ru]=Интернет-браузер Firefox
183X-GNOME-FullName[sk]=Internetový prehliadač Firefox
184X-GNOME-FullName[sv]=Webbläsaren Firefox
185Exec=$(FIREFOX_EXEC) %u
186Terminal=false
187X-MultipleArgs=false
188Type=Application
189Icon=$(FIREFOX_ICON)
190Categories=Network;WebBrowser;
191MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
192StartupWMClass=Firefox
193StartupNotify=true
194endef
diff --git a/install-firefox b/install-firefox
new file mode 120000
index 0000000..33ceb8f
--- /dev/null
+++ b/install-firefox
@@ -0,0 +1 @@
Makefile \ No newline at end of file