diff options
Diffstat (limited to 'scripts/prep-librewolf-dpkg.sh')
-rwxr-xr-x | scripts/prep-librewolf-dpkg.sh | 34 |
1 files changed, 22 insertions, 12 deletions
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 |