Skip to content
Permalink
Newer
Older
100755 264 lines (202 sloc) 9.37 KB
1
#!/bin/env beesh
2
3
# BEE_VERSION firefox_esr-78.9.0-0
4
5
#export BEE_TMP_TMPDIR=/dev/shm BEE_TMP_BUILDROOT=/dev/shm/bee-root BEE_MAKEFLAGS='-j80'
6
7
SRCURL[0]="https://ftp.mozilla.org/pub/firefox/releases/${PKGVERSION}${PKGEXTRANAME}/source/firefox-${PKGVERSION}${PKGEXTRANAME}.source.tar.xz"
8
9
mee_configure() {
10
11
. /usr/local/package/lib/node.profile
12
. /pkg/rustc-1.50.0-0/profile
13
14
cat > ${S}/mozconfig <<-EOF
15
ac_add_options --enable-application=browser
16
ac_add_options --disable-necko-wifi
17
ac_add_options --enable-official-branding
18
ac_add_options --without-system-icu
19
ac_add_options --without-system-nspr
20
ac_add_options --disable-elf-hack
21
ac_add_options --disable-updater
22
ac_add_options --disable-crashreporter
23
ac_add_options --disable-tests
24
ac_add_options --enable-optimize
25
mk_add_options MOZ_MAKE_FLAGS="${BEE_MAKEFLAGS}"
26
mk_add_options MOZ_OBJDIR=$B
27
unset MOZ_TELEMETRY_REPORTING
28
EOF
29
${S}/mach configure
30
}
31
32
mee_build() {
33
export CARGO_HOME=$B/.cargo
34
${S}/mach build
35
}
36
37
mee_build_post() {
38
39
# create menu entry
40
41
cat >${B}/firefoxesr.desktop <<-EOF
42
[Desktop Entry]
43
Version=1.0
44
Name=Firefox-ESR-${PKGVERSION[1]}
45
GenericName=Web Browser
46
Comment=Surf the World Wide Web
47
Exec=firefoxesr${PKGVERSION[1]} -ProfileManager %u
48
Icon=firefox
49
Terminal=false
50
Type=Application
51
StartupNotify=true
52
Categories=Network;WebBrowser;
53
EOF
54
}
55
56
mee_install() {
57
DESTDIR=$D ${S}/mach install
58
}
59
60
mee_install_post() {
61
if [ "${PKGEXTRANAME}" = "esr" ] ; then
62
mv -v "${D}${PREFIX}/local/bin/firefox" "${D}${PREFIX}/local/bin/firefox${PKGEXTRANAME}${PKGVERSION[1]}"
63
else
64
start_cmd install -d ${D}${LIBDIR}/mariux64
65
start_cmd mv ${D}${BINDIR}/${PKGNAME} ${D}${LIBDIR}/mariux64/${PKGNAME}
66
67
# install official icon in all sizes
68
69
for size in 16 22 24 32 48 256 ; do
70
srcdir=${S}/browser/branding/official
71
destdir=${D}${DATADIR}/icons/hicolor/${size}x${size}/apps
72
73
start_cmd mkdir -p ${destdir}
74
start_cmd install -m 644 ${srcdir}/default${size}.png ${destdir}/firefox.png
75
done
76
fi
77
78
# install menu-entry
79
80
start_cmd mkdir -p ${D}${DATADIR}/applications
81
start_cmd desktop-file-install --dir ${D}${DATADIR}/applications ${B}/firefoxesr.desktop
82
83
mkdir -pv ${D}/usr/local/bin
84
85
cat > ${D}/usr/local/bin/sbportal <<-EOF
86
#!/bin/bash
87
88
export MOZ_APP_LAUNCHER=firefox
89
90
export XAUTHORITY=\${XAUTHORITY:-\$HOME/.Xauthority}
91
export ICEAUTHORITY=\${ICEAUTHORITY:-\$HOME/.ICEauthority}
92
export HOME=/scratch/local/sap-firefoxesr-\${USER}-home
93
94
mkdir -p \${HOME}
95
chmod 0700 \${HOME}
96
97
exec firefox${PKGEXTRANAME}${PKGVERSION[1]} -no-remote https://sbportal.sap.mpg.de/irj/portal/classic
98
EOF
99
100
chmod 755 ${D}/usr/local/bin/sbportal
101
102
103
104
cat <<-EOF >${D}${PREFIX}/local/lib/firefox/defaults/pref/autoconfig.js
105
// Any comment. You must start the file with a comment!
106
pref("general.config.filename", "default_config_mariux.cfg");
107
pref("general.config.obscure_value", 0);
108
EOF
109
110
cat <<-EOF >${D}${PREFIX}/local/lib/firefox/default_config_mariux.cfg
111
// Any comment. You must start the file with a comment!
112
pref("storage.nfs_filesystem", true);
113
pref("network.captive-portal-service.enabled",false);
114
115
// Don't show WhatsNew on first run after every update
116
pref("browser.startup.homepage_override.mstone","ignore");
117
118
//disable slowStartup Notification
119
pref("browser.slowStartup.notificationDisabled", true);
120
pref("browser.slowStartup.maxSamples", 0);
121
pref("browser.slowStartup.samples", 0);
122
pref("browser.rights.3.shown", true);
123
pref("startup.homepage_welcome_url", "");
124
pref("startup.homepage_welcome_url.additional", "");
125
pref("startup.homepage_override_url", "");
126
pref("browser.laterrun.enabled", false);
127
pref("browser.shell.checkDefaultBrowser", false);
128
129
//disable daily pings to Mozilla about extensions and recent startup
130
lockPref("extensions.getAddons.cache.enabled", false);
131
132
//disable sending the URL of the website where a plugin crashed
133
pref("dom.ipc.plugins.reportCrashURL", false);
134
135
//disable auto update for extensions
136
lockPref("extensions.update.autoUpdateDefault", false);
137
138
//disable about:addons' Get Add-ons panel (uses Google-Analytics)
139
pref("extensions.getAddons.showPane", false); // hidden pref
140
pref("extensions.webservice.discoverURL", "");
141
142
// Don't ask to install the Flash plugin
143
pref("plugins.notifyMissingFlash", false);
144
145
// Disable upload of health reports
146
lockPref("datareporting.healthreport.uploadEnabled", false);
147
//disable about:healthreport page (which connects to Mozilla for locale/css+js+json)
148
lockPref("datareporting.healthreport.about.reportUrl", "data:text/plain,");
149
150
// Disable all data upload (Telemetry and FHR)
151
lockPref("toolkit.telemetry.unified", false);
152
lockPref("toolkit.telemetry.enabled", false);
153
lockPref("toolkit.telemetry.server", "");
154
lockPref("toolkit.telemetry.newProfilePing.enabled", false);
155
lockPref("toolkit.telemetry.shutdownPingSender.enabled", false);
156
lockPref("toolkit.telemetry.updatePing.enabled", false);
157
lockPref("toolkit.telemetry.bhrPing.enabled", false);
158
lockPref("toolkit.telemetry.firstShutdownPing.enabled", false);
159
lockPref("toolkit.telemetry.cachedClientID", "");
160
lockPref("toolkit.telemetry.archive.enabled", false);
161
lockPref("datareporting.policy.dataSubmissionEnabled", false);
162
lockPref("browser.ping-centre.telemetry", false);
163
164
//disable "Snippets" (Mozilla content shown on about:home screen)
165
defaultPref("browser.aboutHomeSnippets.updateUrl", "https://127.0.0.1"); //test
166
167
//disable experiments https://wiki.mozilla.org/Telemetry/Experiments
168
defaultPref("experiments.enabled", false);
169
defaultPref("experiments.manifest.uri", "");
170
defaultPref("experiments.supported", false);
171
defaultPref("experiments.activeExperiment", false);
172
// disable Mozilla permission to silently opt you into tests
173
defaultPref("network.allow-experiments", false);
174
175
/* 0206: disable geographically specific results/search engines e.g. "browser.search.*.US"
176
* i.e. ignore all of Mozilla's various search engines in multiple locales ***/
177
defaultPref("browser.search.geoSpecificDefaults", false);
178
defaultPref("browser.search.geoSpecificDefaults.url", "");
179
180
/* 0503: disable Normandy/Shield [FF60+]
181
* Shield is an telemetry system (including Heartbeat) that can also push and test "recipes"
182
* [1] https://wiki.mozilla.org/Firefox/Shield
183
* [2] https://github.com/mozilla/normandy ***/
184
defaultPref("app.normandy.enabled", false);
185
defaultPref("app.normandy.api_url", "");
186
187
/* 0601: disable link prefetching
188
* [1] https://developer.mozilla.org/docs/Web/HTTP/Link_prefetching_FAQ ***/
189
defaultPref("network.prefetch-next", false);
190
/* 0602: disable DNS prefetching
191
* [1] https://www.ghacks.net/2013/04/27/firefox-prefetching-what-you-need-to-know/
192
* [2] https://developer.mozilla.org/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control ***/
193
defaultPref("network.dns.disablePrefetch", true);
194
defaultPref("network.dns.disablePrefetchFromHTTPS", true); // [HIDDEN PREF ESR] [DEFAULT: true FF70+]
195
/* 0603: disable predictor / prefetching ***/
196
defaultPref("network.predictor.enabled", false);
197
defaultPref("network.predictor.enable-prefetch", false); // [FF48+]
198
199
/* 0320: disable about:addons' Recommendations pane (uses Google Analytics) ***/
200
defaultPref("extensions.getAddons.showPane", false); // [HIDDEN PREF]
201
202
//disable pocket
203
defaultPref("extensions.pocket.enabled", false);
204
205
//disable flyweb https://flyweb.github.io/
206
pref("dom.flyweb.enabled", false);
207
208
//disable Shield https://wiki.mozilla.org/Firefox/Shield
209
lockPref("extensions.shield-recipe-client.enabled", false);
210
lockPref("extensions.shield-recipe-client.api_url", "");
211
212
//disable Follow on Search and Activity Stream
213
defaultPref("browser.newtabpage.activity-stream.enabled", false);
214
defaultPref("browser.library.activity-stream.enabled", false);
215
216
//disable link-mouseover opening connection to linked server
217
lockPref("network.http.speculative-parallel-limit", 0);
218
219
//disable pings (but enforce same host in case)
220
lockPref("browser.send_pings", false);
221
lockPref("browser.send_pings.require_same_host", true);
222
223
//disable location bar using search - PRIVACY
224
defaultPref("keyword.enabled", false);
225
226
//disable location bar domain guessing - PRIVACY/SECURITY
227
defaultPref("browser.fixup.alternate.enabled", false);
228
229
//display all parts of the url in the location bar - helps SECURITY
230
lockPref("browser.urlbar.trimURLs", false);
231
232
//disable location bar making speculative connections (FF56+)
233
lockPref("browser.urlbar.speculativeConnect.enabled", false);
234
235
//disable SSL session tracking test
236
defaultPref("security.ssl.disable_session_identifiers", true);
237
238
//disable SSL Error Reporting
239
defaultPref("security.ssl.errorReporting.automatic", false);
240
defaultPref("security.ssl.errorReporting.enabled", false);
241
defaultPref("security.ssl.errorReporting.url", "");
242
243
//disable the DNT HTTP header, which is essentially USELESS
244
defaultPref("privacy.donottrackheader.enabled", false);
245
246
//set max popups from a single non-click event - default is 20!
247
defaultPref("dom.popup_maximum", 3);
248
249
//limit events that can cause a popup default is "change click dblclick mouseup pointerup notificationclick reset submit touchend"
250
defaultPref("dom.popup_allowed_events", "click dblclick");
251
252
//enable Firefox's built-in PDF reader
253
defaultPref("pdfjs.disabled", false);
254
255
//session restore save time
256
defaultPref("browser.sessionstore.interval",150000);
257
258
//enable legacy extensions
259
defaultPref("extensions.legacy.enabled",true);
260
261
//disable firefox refresh request
262
defaultPref("browser.disableResetPrompt",true);
263
EOF