diff options
Diffstat (limited to 'scripts/prep-librewolf-dpkg.sh')
-rwxr-xr-x | scripts/prep-librewolf-dpkg.sh | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/scripts/prep-librewolf-dpkg.sh b/scripts/prep-librewolf-dpkg.sh index ef5b3b0..179a658 100755 --- a/scripts/prep-librewolf-dpkg.sh +++ b/scripts/prep-librewolf-dpkg.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # File: prep-librewolf-dpkg.sh # Location: https://gitlab.com/bgstack15/librewolf-linux.git # Latest supported version: librewolf-85.0-1 @@ -32,7 +32,7 @@ librewolf_common_url=https://gitlab.com/librewolf-community/browser/common.git librewolf_settings_url=https://gitlab.com/librewolf-community/settings.git librewolf_linux_url=https://gitlab.com/librewolf-community/browser/linux.git -if [[ ${DISTRO} == 'ubuntu' ]]; then +if test "${DISTRO}" = "ubuntu" ; then _mozconfig='/config/mozconfig.in' else _mozconfig='/browser.mozconfig.in' @@ -47,7 +47,7 @@ work_dir=${CI_PROJECT_DIR}/prepared/ ##################################### # Download initial components -apt update && apt install -y git curl wget xz-utils +test -z "${SKIP_APT}" && apt update && apt install -y git curl wget xz-utils # Download upstream distro assets, which includes # 1. orig tarball, which in Debian is not always the pristine contents from upstream source @@ -151,8 +151,9 @@ mk_add_options MOZ_DATA_REPORTING=0 mk_add_options MOZ_SERVICES_HEALTHREPORT=0 mk_add_options MOZ_TELEMETRY_REPORTING=0 -ac_add_options --disable-elf-hack - +EOF +test "$( uname -p )" = "x86_64" && { echo "ac_add_options --disable-elf-hack" >> "${debian_dir}${_mozconfig}" ; } +cat <<EOF >> "${debian_dir}${_mozconfig}" # LibreWolf binary release uses clang-11 but Debian builds Firefox with gcc so this is irrelevant. #export CC='clang-11' #export CXX='clang++-11' @@ -172,7 +173,7 @@ sed -i 's/rustc (>= 1.47),/rustc (>= 1.41),/g' "${debian_dir}"/control.in # add patches to debian/patches mkdir -p "${debian_dir}"/patches/librewolf -if [[ ${DISTRO} == 'ubuntu' ]]; then +if test "${DISTRO}" = "ubuntu" ; then cp -pr "${git_source_dir}"/linux/megabar.patch \ "${git_source_dir}"/linux/remove_addons.patch \ "${git_source_dir}"/linux/mozilla-vpn-ad.patch \ @@ -218,16 +219,16 @@ sed "$_settings_services_sed" -i "${source_dir}"/services/settings/Utils.jsm sed "$_settings_services_sed" -i "${source_dir}"/toolkit/components/search/SearchUtils.jsm # Remove Internal Plugin Certificates -_cert_sed='s#if (aCert.organizationalUnit == "Mozilla [[:alpha:]]\+") {\n' -_cert_sed+='[[:blank:]]\+return AddonManager\.SIGNEDSTATE_[[:upper:]]\+;\n' -_cert_sed+='[[:blank:]]\+}#' -_cert_sed+='// NOTE: removed#g' +_cert_sed="s#if (aCert.organizationalUnit == \"Mozilla [[:alpha:]]\+\") {\n" +_cert_sed="${_cert_sed}[[:blank:]]\+return AddonManager\.SIGNEDSTATE_[[:upper:]]\+;\n" +_cert_sed="${_cert_sed}[[:blank:]]\+}#" +_cert_sed="${_cert_sed}// NOTE: removed#g" sed -z "$_cert_sed" -i "${source_dir}"/toolkit/mozapps/extensions/internal/XPIInstall.jsm ##################################### # Script 4 tasks -if [[ ${DISTRO} == 'debian' ]]; then +if test "${DISTRO}" = "debian" ; then sed -i -r -e '2{ iexport DEB_BUILD_HARDENING=1 @@ -256,16 +257,18 @@ fi # fix the binary name that gets installed in /usr/bin, and disable crash reporter by changing what variable name it looks for that will enable it -if [[ ${DISTRO} == 'debian' ]]; then +if test "${DISTRO}" = "debian" ; then -sed -i -e '/%if browser/,+2s/firefox/librewolf/' \ - -e '/%if CRASH_REPORTER/s/CRASH_REPORTER/CRASH_REPORTER_ENABLED/' \ - "${debian_dir}"/browser.install.in + sed -i -e '/%if browser/,+2s/firefox/librewolf/' \ + -e '/%if CRASH_REPORTER/s/CRASH_REPORTER/CRASH_REPORTER_ENABLED/' \ + "${debian_dir}"/browser.install.in + +elif test "${DISTRO}" = "ubuntu" ; then -elif [[ ${DISTRO} == 'ubuntu' ]]; then # let's hope this is enough export MOZ_ENABLE_BREAKPAD=0 export MOZ_APP_NAME=librewolf + fi # instruct dpkg to include the librewolf settings @@ -273,7 +276,7 @@ rm -rf "${debian_dir}"/librewolf_settings cp -pr "${git_source_dir}"/settings "${debian_dir}"/librewolf_settings rm -rf "${debian_dir}"/librewolf_settings/.git* -if [[ ${DISTRO} == 'debian' ]]; then +if test "${DISTRO}" = "debian" ; then cat <<EOF >> "${debian_dir}"/browser.install.in debian/librewolf_settings/librewolf.cfg usr/lib/@browser@ |