From e5bef2898d4f4c8bbc4a7ca745a1ea40651963f0 Mon Sep 17 00:00:00 2001 From: grizzlyuser Date: Sun, 5 Jul 2020 18:27:37 +0300 Subject: libre/iceweasel: Disable data reporting in build config MOZ_SERVICES_HEALTHREPORT and MOZ_NORMANDY are two missing bits to undefine MOZ_DATA_REPORTING, which is defined if any one of healthreporting, crashreporting, telemetry reporting, or Normandy are set. Crashreporting and telemetry reporting have been already disabled. Some data reporting related preferences and code are enabled when MOZ_DATA_REPORTING is defined, for example. These "features" are for Mozilla users only, they don't make much sense for Iceweasel users. Probably even harmful for them and Mozilla too, because I don't think Mozilla is interested in data reporting spam from non-Firefox users. I'm not sure if these features can be classified as back doors or spyware in GNU FSDG terms, but that's another thing to consider. Also added a check that fails the build if some of those features are not disabled in configuration. Signed-off-by: Andreas Grapentin --- libre/iceweasel/PKGBUILD | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'libre/iceweasel/PKGBUILD') diff --git a/libre/iceweasel/PKGBUILD b/libre/iceweasel/PKGBUILD index 3f0661f0f..6ed720ee9 100644 --- a/libre/iceweasel/PKGBUILD +++ b/libre/iceweasel/PKGBUILD @@ -59,7 +59,7 @@ makedepends=(unzip zip diffutils yasm mesa imake inetutils xorg-server-xvfb autoconf2.13 rust clang llvm jack gtk2 nodejs cbindgen nasm python-setuptools python-psutil) # FIXME: 'mozilla-serarchplugins' package needs re-working (see note in prepare()) -makedepends+=(quilt libxslt imagemagick) +makedepends+=(quilt libxslt imagemagick git jq) optdepends=('networkmanager: Location detection via available WiFi networks' 'libnotify: Notification integration' 'pulseaudio: Audio support' @@ -252,6 +252,7 @@ END # Disable various components at the source level sed -i 's/;1/;0/' toolkit/components/telemetry/components.conf + sed -Ei 's/((MOZ_SERVICES_HEALTHREPORT|MOZ_NORMANDY).+)True/\1False/' browser/moz.configure #sed -i 's/;1/;0/' browser/experiments/Experiments.manifest #sed -i '/pocket/d' browser/extensions/moz.build #sed -i '/activity-stream/d' browser/extensions/moz.build @@ -294,6 +295,26 @@ END git init && git clean -dfX -e \!ipc/chromium/src/third_party/libevent/evconfig-private.h } +_check_build_config() { + echo "Checking build configuration..." + + # Configure produces mozinfo.json that reflects current configuration. + # See build/docs/mozinfo.rst + ./mach configure + + # In this test, jq collects values of the following keys of mozinfo.json into array, + # and checks if any of them are not equal to false, in which case it returns "true". + # E.g. if the value of any key is true or null (in case the key is missing from mozinfo.json), + # that means the build configuration has to be reworked. + local object_directory=$(./mach environment | sed -En '/object directory:/{n;s/^\s+//;p;}') + local features_not_disabled=$(cat "$object_directory/mozinfo.json" \ + | jq -e '[.crashreporter, .datareporting, .healthreport, .normandy, .telemetry, .updater] | any(. != false)') + if $features_not_disabled; then + echo 'Some features are not disabled correctly in build configuration files, aborting.' + return 1 + fi +} + build() { cd firefox-$pkgver @@ -371,6 +392,7 @@ build() { cat >.mozconfig ../mozconfig - <