PKGBUILD 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. # Maintainer (arch): Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
  2. # Contributor: Thomas Baechler <thomas@archlinux.org>
  3. # Contributor: Jaroslaw Swierczynski <swiergot@juvepoland.com>
  4. # Contributor: Michal Hybner <dta081@gmail.com>
  5. # Contributor: Andrea Scarpino <andrea@archlinux.org>
  6. # Maintainer: Andreas Grapentin <andreas@grapentin.org>
  7. # Contributor: Márcio Silva <coadde@hyperbola.info>
  8. # Contributor: André Silva <emulatorman@hyperbola.info>
  9. # Contributor: Luke Shumaker <lukeshu@parabola.nu>
  10. # Contributor: fauno <fauno@kiwwwi.com.ar>
  11. # Contributor: Figue <ffigue@gmail.com>
  12. # Contributor: bill-auger <bill-auger@programmer.net>
  13. # parabola changes and rationale:
  14. # - rebranded to iceweasel
  15. # - added replaces, conflicts: firefox-i18n-*
  16. _pkgbase=iceweasel
  17. pkgbase=${_pkgbase}-l10n
  18. epoch=1
  19. _pkgver_armv7h=75.0
  20. _pkgver_i686=87.0
  21. _pkgver_x86_64=87.0
  22. _pkgrel_armv7h=1.parabola1
  23. _pkgrel_i686=1.parabola1
  24. _pkgrel_x86_64=1.parabola1
  25. eval "pkgver=\$_pkgver_${CARCH}" # this is actually an 'any' package
  26. eval "pkgrel=\$_pkgrel_${CARCH}" # but our different arches do not always roll at the same speed
  27. pkgdesc="Language pack for ${_pkgbase^}"
  28. arch=('armv7h' 'i686' 'x86_64')
  29. url=https://wiki.parabola.nu/iceweasel
  30. license=(MPL GPL LGPL)
  31. depends=(iceweasel=${epoch}:${pkgver})
  32. makedepends=('unzip' 'zip')
  33. pkgname=()
  34. source=(brand.dtd
  35. brand.properties
  36. region.properties
  37. languages.${CARCH}
  38. sha512sums.${CARCH})
  39. # load languages list and .xpi checksums
  40. source languages.${CARCH} &> /dev/null # sets $_languages
  41. source sha512sums.${CARCH} &> /dev/null # sets $_sha512sums
  42. # compile package names and .xpi sources
  43. _src_url=https://ftp.mozilla.org/pub/firefox/releases/${pkgver}/linux-x86_64/xpi
  44. for _lang in "${_languages[@]}"; do
  45. _locale=${_lang%% *}
  46. _pkgname=${pkgbase}-${_locale,,}
  47. pkgname+=($_pkgname)
  48. source+=(${pkgbase}-${pkgver}-${_locale}.xpi::${_src_url}/${_locale}.xpi)
  49. eval "package_${_pkgname}() {
  50. _package ${_lang}
  51. }"
  52. done
  53. # compile checksums
  54. _languages_armv7h_shasum='c259b9886024281a92fa8c834c673cf0dd34480a1ba227209872c5e923841d7f343d45885e245fe33b8ca3d24c7f2b527e6c49d6c665133781825076ee4f2cf9'
  55. _languages_i686_shasum="6541960f06b734e954c65b5c5c3b0c22aa263f5912a49f798450594cc7531a6769d3655bcda4d9a49e483c01e40517e62fe6ff021db60c3a139b372c71c7d1e5"
  56. _languages_x86_64_shasum="6541960f06b734e954c65b5c5c3b0c22aa263f5912a49f798450594cc7531a6769d3655bcda4d9a49e483c01e40517e62fe6ff021db60c3a139b372c71c7d1e5"
  57. _sha512sums_armv7h_shasum='ba69d1ac848440397617011bf94fdffd83bdda39c21bcb6ddfcf621e76db380bf5ec0e2afe535e226efd450506dd90594f47ab12e84705efc09c3bf7cca31359'
  58. _sha512sums_i686_shasum="304a53ba47e2456a166cbc5d946533d5fced874bb4739c69e875c867e0be6214dfb5fd3e938b402cee2162d4d15feb9891441af71a017e8d1b1f4ca2fd0bd6c2"
  59. _sha512sums_x86_64_shasum="304a53ba47e2456a166cbc5d946533d5fced874bb4739c69e875c867e0be6214dfb5fd3e938b402cee2162d4d15feb9891441af71a017e8d1b1f4ca2fd0bd6c2"
  60. sha512sums=('bfe82e11a3a1b8006b58a54897f297bd17191ca2e7b08f95d66ec6bfe356caf9eb4d96b3dde5f36db0331d012bde2f03e7087aad1e087800b404f82fa9d786ad' # brand.dtd
  61. 'a1a7e44f3358b131157d2acec243d35ef234e42a6522edfa5b2be9b497a65b2227c64b7fb989c0780c55333c0075f8f2198d99cde8f602bb3f9b8619dc57ab2c' # brand.properties
  62. '31d33e90be1b5c0e76a0c374684f9a7b4076f7bcca8b76309048b2e3fc7f27c0bc8a2a9f9e66bd8c51fe8780a52a1011c540b071dc82f78d72a1d5ad29fee4f9' # region.properties
  63. $(eval "echo \$_languages_${CARCH}_shasum") # languages.${CARCH}
  64. $(eval "echo \$_sha512sums_${CARCH}_shasum") # sha512sums.${CARCH}
  65. "${_sha512sums[@]}")
  66. # Don't extract anything
  67. noextract=(${source[@]%%::*})
  68. _package() {
  69. pkgdesc="$2 for Iceweasel"
  70. replaces=(firefox-i18n-${1,,})
  71. conflicts=(firefox-i18n-${1,,})
  72. # explode for branding
  73. unzip $pkgbase-$pkgver-$1.xpi -d $1
  74. rm -v $pkgbase-$pkgver-$1.xpi
  75. # apply parabola branding
  76. sed -i 's|Mozilla Firefox|Parabola GNU/Linux-libre Iceweasel|g' $(grep -rlI 'Mozilla Firefox' $1)
  77. sed -i 's|Firefox|Iceweasel|g' $(grep -rlI 'Firefox' $1)
  78. install -vDm644 "$srcdir"/brand.dtd $1/browser/chrome/$1/locale/branding
  79. install -vDm644 "$srcdir"/brand.properties $1/browser/chrome/$1/locale/branding
  80. install -vDm644 "$srcdir"/region.properties $1/browser/chrome/$1/locale/browser-region
  81. if [ -f $1/chrome/$1/locale/$1/global/aboutRights.dtd ]; then
  82. sed -i 's|Parabola GNU/Linux-libre Iceweasel|Mozilla Firefox|' $1/chrome/$1/locale/$1/global/aboutRights.dtd
  83. sed -i 's|Iceweasel|Firefox|' $1/chrome/$1/locale/$1/global/aboutRights.dtd
  84. fi
  85. rm -rv $1/chrome/$1/locale/$1/global-platform/{mac,win}
  86. # re-pack
  87. cd $1
  88. zip -r "$srcdir"/$pkgbase-$pkgver-$1.xpi .
  89. cd ..
  90. rm -rv $1
  91. install -Dm644 $pkgbase-$pkgver-$1.xpi \
  92. "$pkgdir/usr/lib/iceweasel/browser/extensions/langpack-$1@firefox.mozilla.org.xpi"
  93. }