summaryrefslogtreecommitdiff
path: root/waterfox-g/debian/add_new_i18n_packages.sh
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-08-19 17:18:07 -0400
committerB. Stack <bgstack15@gmail.com>2023-08-19 17:18:07 -0400
commitb2237bccba179e5483e083edf5ebbd313d240dfd (patch)
tree19d822c24051e2308c32c04a102547f4e5188679 /waterfox-g/debian/add_new_i18n_packages.sh
parentuse cgit url (diff)
downloadstackrpms-b2237bccba179e5483e083edf5ebbd313d240dfd.tar.gz
stackrpms-b2237bccba179e5483e083edf5ebbd313d240dfd.tar.bz2
stackrpms-b2237bccba179e5483e083edf5ebbd313d240dfd.zip
add waterfox-g
Diffstat (limited to 'waterfox-g/debian/add_new_i18n_packages.sh')
-rwxr-xr-xwaterfox-g/debian/add_new_i18n_packages.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/waterfox-g/debian/add_new_i18n_packages.sh b/waterfox-g/debian/add_new_i18n_packages.sh
new file mode 100755
index 0000000..ee7631a
--- /dev/null
+++ b/waterfox-g/debian/add_new_i18n_packages.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+SCRIPT_PATH=$(dirname "$0")
+
+sed -i '/Package: waterfox-g-i18n-/Q' $SCRIPT_PATH/control
+mapfile -t _languages < <(cat $SCRIPT_PATH/locales.shipped)
+
+for _lang in "${_languages[@]}"; do
+ _locale_file=$(echo $_lang | awk -F: '{print $1}')
+ _locale_pkg=$(echo $_lang | awk -F: '{print tolower($1)}')
+ _locale_desc=$(echo $_lang | awk -F: '{print $2}')
+ _pkgname=waterfox-g-i18n-$_locale_pkg
+ _pkgname_trans3=waterfox-g3-i18n-$_locale_pkg
+ _pkgname_trans4=waterfox-g4-i18n-$_locale_pkg
+ cat <<EOT >> $SCRIPT_PATH/control
+Package: $_pkgname
+Architecture: all
+Depends: \${misc:Depends}, waterfox-g (>= \${source:Version})
+Replaces: $_pkgname_trans4 (<< 4.1.1-0~), $_pkgname_trans3 (<< 4.1.1-0~)
+Breaks: $_pkgname_trans4 (<< 4.1.1-0~), $_pkgname_trans3 (<< 4.1.1-0~)
+Description: $_locale_desc language pack for Waterfox G
+ This package contains $_locale_desc translations for Waterfox G
+
+EOT
+touch $SCRIPT_PATH/${_pkgname}.install
+
+ cat <<EOT > $SCRIPT_PATH/${_pkgname}.install
+extensions/langpack-${_locale_file}@l10n.waterfox.net.xpi /usr/lib/waterfox-g/browser/extensions
+EOT
+done
+
+sed -i '$ d' $SCRIPT_PATH/control
bgstack15