From: xf0r3m Date: Sun, 29 Oct 2023 18:36:39 +0000 (+0100) Subject: Dodanie pliku librewolf-autobuild.sh X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=59200a23ecfd136fb0b6fb5be74370eb7481aee5;p=backup.git Dodanie pliku librewolf-autobuild.sh --- diff --git a/librewolf-autobuild.sh b/librewolf-autobuild.sh new file mode 100644 index 0000000..134e030 --- /dev/null +++ b/librewolf-autobuild.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +set -e + +function build_librewolf() { + ./mach --no-interactive bootstrap --application-choice=browser + ./lw/setup-wasi-linux.sh + ./mach build + ./mach package +} + +# Download relases RSS Feed and save file under: /tmp/librewolf-relases.rss +if [ -f /tmp/librewolf-relases.rss ]; then rm /tmp/librewolf-release.rss; fi +wget https://codeberg.org/librewolf/source/releases.rss -O /tmp/librewolf-releases.rss; + +# Extract a LibreWolf latest version tarball URL +latestTarballUrl=$(grep 'content:encoded' /tmp/librewolf-releases.rss | head -1 | grep -o 'https://.*\.gz"' | sed 's,",,'); + +# Extracting LibreWolf latest version number from tarball URL +LWVER=$(basename $(echo $latestTarballUrl | grep -o '\/[0-9].*\/')); + +# Download immudex base file +wget https://github.com/xf0r3m/immudex-testing/raw/main/versions/base.sh -O /tmp/immudex-base-file.txt + +# Extracting LibreWolf version deployed in immudex +idxLWVER=$(grep '^LWVER' /tmp/immudex-base-file.txt | cut -d "'" -f 2) + +# Determinig is there a new LibreWolf version +if [ "$idxLWVER" = "$LWVER" ]; then echo "There is no new version of LibreWolf"; +else echo "There is a new version of LibreWolf"; +fi + +# Check if 'librewolf' dir exist, if it's true remove it and create a new one. +if [ -d ~/librewolf ]; then rm -rf ~/librewolf; fi +mkdir ~/librewolf; + +# Download lastest LibreWolf tarball. +wget $latestTarballUrl -O ~/librewolf/$(basename $latestTarballUrl); + +# Extract the tarball and enter to the build directory. +cd ~/librewolf; +tar xf $(basename $latestTarballUrl); +cd $(basename $latestTarballUrl | sed 's/.source.tar.gz//'); + +# Starting build x86_64 LibreWolf +build_librewolf; + +# Switching target build architecture +sed -i '22s/.*/ac_add_options --target=i686-linux-gnu/' mozconfig + +# Start building i686 LibreWolf +build_librewolf; + +# Sending LibreWolf archives to the FTP server. +scp obj-x86_64-pc-linux-gnu/dist/librewolf-${LWVER}.en-US.linux-x86_64.tar.bz2 xf0r3m@ftp.morketsmerke.org:/home/xf0r3m/ftp/immudex/testing/software/librewolf/testing +scp obj-i686-pc-linux-gnu/dist/librewolf-${LWVER}.en-US.linux-i686.tar.bz2 xf0r3m@ftp.morketsmerke.org:/home/xf0r3m/ftp/immudex/testing/software/librewolf/testing; + +# Notify me, when new LibreWolf version is ready for tests +echo -e "Nowa wersja LibreWolf jest gotowa do testów:\n\nWersja: ${LWVER}\nhttps://ftp.morketsmerke.org/immudex/testing/software/librewolf/testing/librewolf-${LWVER}.en-US.linux-x86_64.tar.bz2\nhttps://ftp.morketsmerke.org/immudex/testing/software/librewolf/testing/librewolf-${LWVER}.en-US.linux-i686.tar.bz2" | mutt -s "Nowa wersja LibreWolf ${LWVER}" jakubstasinski@protonmail.com