aboutsummaryrefslogtreecommitdiff
path: root/scripts/02_configure_tarball.sh
diff options
context:
space:
mode:
authorohfp <1813007-ohfp@users.noreply.gitlab.com>2020-03-06 21:17:06 +0100
committerohfp <1813007-ohfp@users.noreply.gitlab.com>2020-03-06 21:17:06 +0100
commit8378fcc076b44e46203e9fc1a50d57bac73a1d8c (patch)
treebe90108b8eb3c255a161ab7b06e4f2d1b79c6a6f /scripts/02_configure_tarball.sh
parentfix appimage build (diff)
downloadlibrewolf-linux-8378fcc076b44e46203e9fc1a50d57bac73a1d8c.tar.gz
librewolf-linux-8378fcc076b44e46203e9fc1a50d57bac73a1d8c.tar.bz2
librewolf-linux-8378fcc076b44e46203e9fc1a50d57bac73a1d8c.zip
Partial rewrite of build process
Switching to an Arch based build process for easier maintenance and using specific runners for tasks where that might be necessary. Right now, parent/child pipelines for somewhat parallel builds for different architectures / semi-independent pak-builds don't seem to properly work yet due to `trigger:` not being recognized when it should, so that's not yet implemented.
Diffstat (limited to 'scripts/02_configure_tarball.sh')
-rwxr-xr-xscripts/02_configure_tarball.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/02_configure_tarball.sh b/scripts/02_configure_tarball.sh
new file mode 100755
index 0000000..8657375
--- /dev/null
+++ b/scripts/02_configure_tarball.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+set -e
+
+printf "\n\n---------------- prepare package for other distros ----------------\n"
+
+# Setup Script Variables
+
+# use $CI_PROJECT_DIR unless not in CI, then assign script path
+CI_PROJECT_DIR=${CI_PROJECT_DIR:-$(realpath $(dirname $0)/../)}
+OUTPUT_TARBALL=$CI_PROJECT_DIR/LibreWolf.${CARCH}.tar.bz2
+SOURCE_CODE_BINARY_TARBALL_LOCATION="$CI_PROJECT_DIR/src/firefox-*/obj*/dist/librewolf*.tar.bz2"
+EXTRACTED_TARBALL_FOLDER=$CI_PROJECT_DIR/librewolf_unpacked/librewolf
+
+# Prevents build from breaking in CI/CD environments
+export SHELL=/bin/bash
+
+# Moves the packaged tarball to the specified location
+printf "\nMoving Binary Tarball to output location\n"
+mv $SOURCE_CODE_BINARY_TARBALL_LOCATION $OUTPUT_TARBALL
+
+# Extracts the binary tarball
+printf "\nExtracting librewolf binary tarball\n"
+mkdir librewolf_unpacked
+tar -xf $OUTPUT_TARBALL -C librewolf_unpacked
+
+# Adds the librefox config files to the packaged tarball
+printf "\nCopying librewolf settings to extracted binary tarball\n"
+
+cp -r $CI_PROJECT_DIR/src/settings $EXTRACTED_TARBALL_FOLDER/settings
+cp $CI_PROJECT_DIR/content/toggle-settings.sh $EXTRACTED_TARBALL_FOLDER/settings
+cp $CI_PROJECT_DIR/content/launch_librewolf.sh $EXTRACTED_TARBALL_FOLDER/launch_librewolf.sh
+
+# Repacks the binary tarball
+printf "\nRecompressing binary tarball\n"
+tar -jvcf $OUTPUT_TARBALL -C $EXTRACTED_TARBALL_FOLDER .
bgstack15