summaryrefslogtreecommitdiff
path: root/ublock-origin-combined
diff options
context:
space:
mode:
Diffstat (limited to 'ublock-origin-combined')
-rwxr-xr-xublock-origin-combined/build-orig-tarball.sh94
-rw-r--r--ublock-origin-combined/debian/changelog6
-rwxr-xr-xublock-origin-combined/deploy-to-obs.sh34
-rw-r--r--ublock-origin-combined/ublock-origin-combined.spec5
4 files changed, 138 insertions, 1 deletions
diff --git a/ublock-origin-combined/build-orig-tarball.sh b/ublock-origin-combined/build-orig-tarball.sh
new file mode 100755
index 0000000..e804468
--- /dev/null
+++ b/ublock-origin-combined/build-orig-tarball.sh
@@ -0,0 +1,94 @@
+#!/bin/sh
+# Package: libreoffice-tango-iconset
+# Startdate: 2020-11-04 14:05
+# References:
+# libreoffice-tango-iconset/build-orig-tarball.sh
+# Dependencies:
+# sudo apt-get install wget curl sed awk
+
+currdir="${PWD}"
+tmpfile1="$( mktemp )"
+#frontpageurl="https://extensions.libreoffice.org/en/extensions/show/tango-icon-theme-for-libreoffice"
+#domain="$( echo "${frontpageurl}" | awk -F'/' 'BEGIN{OFS="/"} {print $1,$2,$3}' )"
+package_name="ublock-origin-combined"
+
+# FUNCTIONS
+ferror() {
+ printf "%s\n" "$@" 1>&2
+}
+
+get() {
+ # get "https://example.com/example.zip"
+ # get "https://example.com/example.zip" "outputname.zip"
+ ___get_url="${1}"
+ ___get_outfile="${2}"
+ ___wget_options=""
+ test -n "${___get_outfile}" && ___wget_options="-O ${___get_outfile}"
+
+ test -n "${DEBUG}" && ferror "wget --quiet --content-disposition \"${___get_url}\" ${___wget_options}"
+ test -z "${DRYRUN}" && wget --quiet --content-disposition "${___get_url}" ${___wget_options}
+}
+
+to_filename() {
+ # call: to_filename "https://example.com/filename.ext"
+ # returns: "filename.ext"
+ printf "${1##*/}"
+}
+
+show_latest_tarball_for_github_repo() {
+ # call: show_latest_tarball_for_github_repo "https://github.com/gorhill/uBlock-for-firefox-legacy"
+ # returns: "https://github.com/gorhill/uBlock-for-firefox-legacy/archive/firefox-legacy-1.16.4.26.tar.gz"
+ # Improve: accept archive type, such as .tar.gz or .zip, to return
+ # And yes, I know this parses html with awk. Get over it.
+ # Works, but unused as of 2020-11-04
+ ___repo="${1}"
+ _page="$( curl -s "${___repo}/tags" )"
+ # tail grabs the highest number, so most recent available tarball from the page
+ echo "${_page}" | grep -oE "href=[\"'][^\"']+archive[^\"']+tar\.gz\"" | sed -r -e 's/^href=.//;' -e 's/"$//;' | sort -n | uniq | tail -n1 | sed -r -e "s/^/https:\/\/github.com/;"
+}
+
+show_xpi_for_latest_tag() {
+ # call: fetch_xpi_for_latest_tag "https://github.com/gorhill/uBlock-for-firefox-legacy"
+ # returns: "https://github.com/gorhill/uBlock-for-firefox-legacy/releases/download/firefox-legacy-1.16.4.26/uBlock0_1.16.4.26.firefox-legacy.xpi"
+ # How it works:
+ # 1. visit list of tags
+ # 2. visit highest sorted tag (can only see page one of github results)
+ # 3. visit that tag page, and find assets section and then find .xpi file. So this is hard-coded for exactly one xpi file.
+ ___repo="${1}"
+ _page1="$( curl -s "${___repo}/tags" )"
+ _url2="https://github.com$( echo "${_page1}" | grep -oE 'href=[^>]+\/tag\/[^>]+' | sort -n | tail -n1 | sed -r -e "s/^href=[\"']?//;" -e 's/"$//;' )"
+ _page2="$( curl -s "${_url2}" )"
+ #echo "${_page2}"
+ _asset="https://github.com$( echo "${_page2}" | sed -n '/Assets/,$p' ~/foo2 | grep -oE "href=.*\.xpi" | sed -r -e "s/^href=[\"']?//;" )"
+ echo "${_asset}"
+}
+
+### Flow
+
+# check dependencies
+#which jq 1>/dev/null 2>&1 || { echo "Please install jq! Aborted." ; exit 1; }
+
+## 1. learn latest version file
+#url_contents="$( curl -s "${frontpageurl}" )"
+#latest_file="$( echo "${url_contents}" | awk -F'[=>]' '/class="btn".*>Download</{print $4}' | sed -r -e 's/^"//g;' -e 's/"$//g;' | head -n1 )"
+latest_file="$( show_xpi_for_latest_tag "https://github.com/gorhill/uBlock-origin-for-firefox-legacy" )"
+latest_version="$( basename "${latest_file}" | grep -oE '_[0-9\.]+' | sed -r -e 's/^_//;' -e 's/\.$//;' )"
+
+## 2. dl it
+get "${latest_file}" "uBlock0.firefox-legacy.xpi"
+
+## 5. assemble orig tarball
+test -n "${DEBUG}" && ferror "mkdir -p \"${package_name}-${latest_version}\""
+test -z "${DRYRUN}" && { mkdir -p "${package_name}-${latest_version}" ; cd "${package_name}-${latest_version}" ; }
+
+test -n "${DEBUG}" && ferror "mv ../\"uBlock0.firefox-legacy.xpi\" ."
+test -z "${DRYRUN}" && mv ../"uBlock0.firefox-legacy.xpi" .
+
+test -n "${DEBUG}" && ferror "cd .."
+test -z "${DRYRUN}" && cd ..
+
+test -n "${DEBUG}" && ferror "tar -zcf \"${package_name}_${latest_version}.orig.tar.gz\" \"${package_name}-${latest_version}\""
+test -z "${DRYRUN}" && tar -zcf "${package_name}_${latest_version}.orig.tar.gz" "${package_name}-${latest_version}"
+
+# CLEAN UP
+rm -rf "${package_name}-${latest_version}/" "${tmpfile1}"
diff --git a/ublock-origin-combined/debian/changelog b/ublock-origin-combined/debian/changelog
index 483fcf9..9067709 100644
--- a/ublock-origin-combined/debian/changelog
+++ b/ublock-origin-combined/debian/changelog
@@ -1,3 +1,9 @@
+ublock-origin-combined (1.16.4.26-1+devuan) obs; urgency=medium
+
+ * Update
+
+ -- B Stack <bgstack15@gmail.com> Wed, 04 Nov 2020 13:34:43 -0500
+
ublock-origin-combined (1.16.4.25-1+devuan) obs; urgency=medium
* Combined package for all Mozilla-based browsers.
diff --git a/ublock-origin-combined/deploy-to-obs.sh b/ublock-origin-combined/deploy-to-obs.sh
new file mode 100755
index 0000000..a2913b0
--- /dev/null
+++ b/ublock-origin-combined/deploy-to-obs.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+# Startdate: 2020-11-04 15:06
+# Purpose: make it a oneliner to get into the OBS
+# Dependencies:
+# osc
+
+devdir=~/dev
+gitdir="${devdir}/stackrpms/ublock-origin-combined"
+obsdir="${devdir}/osc/home:bgstack15/ublock-origin-combined"
+
+# Flow
+cd "${devdir}"
+"${gitdir}/build-orig-tarball.sh"
+echo "DONE WITH build-orig-tarball"
+tf="$( find . -maxdepth 1 -name 'ublock*orig*z' -printf '%T@ %f\n' | sort -n -k1 | awk '{print $NF}' | tail -n1 )"
+tar -zxf "${tf}"
+cd "$( tar -zvtf "${tf}" | awk '/^d/{print $NF}' | head -n1 )"
+cp -pr "${gitdir}/debian" .
+debuild -us -uc # depends on dpkg-dev=1.19.7 and not 1.20.5 which is still broken in Ceres as of 2020-11-04
+test $? -eq 0 || { "debuild failed. Cannot continue. Aborted." ; exit 1 ; }
+cd "${devdir}"
+dsc_file="$( find . -maxdepth 1 -name 'ublock*dsc' -printf '%T@ %f\n' | sort -n -k1 | awk '{print $NF}' | tail -n1 | cut -d' ' -f2 )"
+debian_tar_file="$( find . -maxdepth 1 -name 'ublock*debian*z' -printf '%T@ %f\n' | sort -n -k1 | awk '{print $NF}' | tail -n1 | cut -d' ' -f2 )"
+
+# prep obs
+cd "${obsdir}"
+osc up
+osc rm *
+cd "${devdir}"
+cp -p "${dsc_file}" "${debian_tar_file}" "${tf}" "${obsdir}/"
+cd "${obsdir}"
+#find . -mindepth 1 -maxdepth 1 ! -name "${dsc_file}" ! -name "${debian_tar_file}" ! -name "${tf}" -delete
+osc add *
+osc commit # will prompt for commit name
diff --git a/ublock-origin-combined/ublock-origin-combined.spec b/ublock-origin-combined/ublock-origin-combined.spec
index 5b8eca6..8367d80 100644
--- a/ublock-origin-combined/ublock-origin-combined.spec
+++ b/ublock-origin-combined/ublock-origin-combined.spec
@@ -7,7 +7,7 @@
%global app_id \{ec8030f7-c20a-464f-9b0e-13a3a9e97384\}
Name: ublock-origin-combined
-Version: 1.16.4.25
+Version: 1.16.4.26
Release: 1
Summary: uBlock Origin installed to the system Mozilla-based extensions directories
@@ -68,6 +68,9 @@ rm -rf %{buildroot}
# something gets weird because of the curly braces in the expanded variable, but using the ../* syntax changes the evaluated string so it does not have to try to use curly braces in the owned filepath.
%changelog
+* Wed Nov 04 2020 B Stack <bgstack15@gmail.com> - 1.16.4.26-1
+- Update
+
* Tue Oct 20 2020 B Stack <bgstack15@gmail.com> - 1.16.4.25-1
- Forked from palemoon-ublock-origin
bgstack15