summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--scripts/prep-librewolf-dpkg.conf8
-rwxr-xr-xscripts/prep-librewolf-dpkg.sh34
3 files changed, 29 insertions, 14 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a01ee28
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.*.swp
diff --git a/scripts/prep-librewolf-dpkg.conf b/scripts/prep-librewolf-dpkg.conf
index dc504d3..318af35 100644
--- a/scripts/prep-librewolf-dpkg.conf
+++ b/scripts/prep-librewolf-dpkg.conf
@@ -1,8 +1,12 @@
# Config file for prep-librewolf-dpkg.sh
# Configure these settings before running that script.
-debian_firefox_version=${debian_firefox_version:-'86.0-1'} # current version of Firefox package in Debian sid
-firefox_version=${pkgver:-'86.0'} # current version of Firefox
+# Available options for DISTRO: ubuntu debian
+DISTRO=${DISTRO:-'debian'}
+# current version of Firefox package in target distro
+distro_firefox_version=${distro_firefox_version:-'86.0+build3-0ubuntu0.20.04.1'}
+# current version of Firefox, as defined by name of the orig tarball.
+firefox_version=${pkgver:-'86.0+build3'}
settings_commit=${settings_commit:-'master'}
CI_PROJECT_DIR=${CI_PROJECT_DIR:-$(realpath $(dirname $0)/../)}
output_dir=${CI_PROJECT_DIR}/out
diff --git a/scripts/prep-librewolf-dpkg.sh b/scripts/prep-librewolf-dpkg.sh
index fc69f86..d534203 100755
--- a/scripts/prep-librewolf-dpkg.sh
+++ b/scripts/prep-librewolf-dpkg.sh
@@ -6,8 +6,9 @@
# SPDX-License-Identifier: CC-BY-SA-4.0
# Startdate: 2020-11-29
# Title: Build Dpkg for LibreWolf
-# Purpose: Prepare initial assets for running "dpkg-buildpackage -b -us -uc" for LibreWolf by adapting Debian Firefox assets
+# Purpose: Prepare initial assets for running "dpkg-buildpackage -b -us -uc" for LibreWolf by adapting distro Firefox assets
# History:
+# 2021-03-10 add initial Ubuntu support
# Usage:
# Can send these final assets up to Open Build Service
# References:
@@ -42,15 +43,24 @@ work_dir=${CI_PROJECT_DIR}/prepared/
apt update && apt install -y git curl wget xz-utils
-# Download upstream Debian assets, which includes
+# Download upstream distro assets, which includes
# 1. orig tarball, which in Debian is not always the pristine contents from upstream source
-# 2. debian/ directory which defines how to build a package for Debian
-# 3. Debian source package control file
+# 2. debian/ directory which defines how to build a dpkg
+# 3. source package control file
mkdir -p "${work_dir}" ; cd "${work_dir}"
test -z "${SKIP_DOWNLOAD}" && {
- wget --content-disposition http://deb.debian.org/debian/pool/main/f/firefox/firefox_"${firefox_version}".orig.tar.xz # -O librewolf_"${firefox_version}".orig.tar.xz
- wget --content-disposition http://deb.debian.org/debian/pool/main/f/firefox/firefox_"${debian_firefox_version}".debian.tar.xz # -O librewolf_"${debian_firefox_version}".debian.tar.xz
- wget --content-disposition http://deb.debian.org/debian/pool/main/f/firefox/firefox_"${debian_firefox_version}".dsc # -O librewolf_"${debian_firefox_version}".dsc
+ case "${DISTRO}" in
+ ubuntu)
+ wget --content-disposition http://archive.ubuntu.com/ubuntu/pool/main/f/firefox/firefox_"${firefox_version}".orig.tar.xz
+ wget --content-disposition http://archive.ubuntu.com/ubuntu/pool/main/f/firefox/firefox_"${distro_firefox_version}".debian.tar.xz
+ wget --content-disposition http://archive.ubuntu.com/ubuntu/pool/main/f/firefox/firefox_"${distro_firefox_version}".dsc
+ ;;
+ *) # catch-all, including for Debian
+ wget --content-disposition http://deb.debian.org/debian/pool/main/f/firefox/firefox_"${firefox_version}".orig.tar.xz
+ wget --content-disposition http://deb.debian.org/debian/pool/main/f/firefox/firefox_"${distro_firefox_version}".debian.tar.xz
+ wget --content-disposition http://deb.debian.org/debian/pool/main/f/firefox/firefox_"${distro_firefox_version}".dsc
+ ;;
+ esac
}
# extract these contents to where they belong
@@ -58,7 +68,7 @@ mkdir -p "${source_dir}"
test -z "${SKIP_EXTRACT}" && {
echo "Extracting files from orig and debian tarballs. This might take a while." 1>&2
tar -C "${source_dir}" -Jx --strip-components=1 -f firefox_"${firefox_version}".orig.tar.xz
- tar -C "$( dirname "${debian_dir}" )" -Jxf firefox_"${debian_firefox_version}".debian.tar.xz
+ tar -C "$( dirname "${debian_dir}" )" -Jxf firefox_"${distro_firefox_version}".debian.tar.xz
# dsc file is a text file and needs no extraction
}
@@ -244,7 +254,7 @@ EOF
new_changelog="$( mktemp )"
{
cat <<EOF
-librewolf (${debian_firefox_version}) unstable; urgency=low
+librewolf (${distro_firefox_version}) unstable; urgency=low
* Fork to librewolf release
@@ -272,7 +282,7 @@ cd "${work_dir}"
tar -Jc -f librewolf_"${firefox_version}".orig.tar.xz -C "$( dirname "${source_dir}" )" librewolf_"${firefox_version}"
# debian tarball
-tar -Jc -f librewolf_"${debian_firefox_version}".debian.tar.xz -C "$( dirname "${debian_dir}" )" debian
+tar -Jc -f librewolf_"${distro_firefox_version}".debian.tar.xz -C "$( dirname "${debian_dir}" )" debian
# dsc file, which needs to be modified
cd "${work_dir}"
@@ -288,14 +298,14 @@ sed -r \
-e '/^ firefox/s/firefox/librewolf/g' \
-e 's/cargo \(>= 0\.47\),/cargo \(>= 0\.46\),/' \
-e 's/rustc \(>= 1\.47\),/rustc \(>= 1\.41\),/' \
- firefox_"${debian_firefox_version}".dsc > librewolf_"${debian_firefox_version}".dsc
+ firefox_"${distro_firefox_version}".dsc > librewolf_"${distro_firefox_version}".dsc
{
echo "Files:"
for word in librewolf*z ;
do
printf "%s %s\n" "$( stat -c '%s' "${word}" )" "$( md5sum "${word}" )"
done | awk '{print " "$2,$1,$3}'
-} >> librewolf_"${debian_firefox_version}".dsc
+} >> librewolf_"${distro_firefox_version}".dsc
# And now you have in the ${work_dir} location three files.
# librewolf_80.3.orig.tar.xz librewolf_80.3-1.debian.tar.xz librewolf_80.3-1.dsc
bgstack15