PKGBUILD 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. # Maintainer (arch): Levente Polyak <anthraxx[at]archlinux[dot]org>
  2. # Maintainer (arch): Jan de Groot <jgc@archlinux.org>
  3. # Contributor: Andrea Scarpino <andrea@archlinux.org>
  4. # Contributor: Thomas Baechler <thomas@archlinux.org>
  5. # Maintainer: Andreas Grapentin <andreas@grapentin.org>
  6. # Contributor: André Silva <emulatorman@hyperbola.info>
  7. # Contributor: Márcio Silva <coadde@hyperbola.info>
  8. # Contributor: bill-auger <bill-auger@programmer.net>
  9. # parabola changes and rationale:
  10. # - rebranded to icedove
  11. # - added replaces, conflicts: thunderbird-i18n-*
  12. # - incorperate iceowl
  13. _pkgbase=icedove
  14. pkgbase=${_pkgbase}-l10n
  15. epoch=1
  16. _pkgver_armv7h=68.6.0
  17. _pkgver_i686=68.9.0
  18. _pkgver_x86_64=68.9.0
  19. _pkgrel_armv7h=1
  20. _pkgrel_i686=1
  21. _pkgrel_x86_64=1
  22. eval "pkgver=\$_pkgver_${CARCH}" # this is actually an 'any' package
  23. eval "pkgrel=\$_pkgrel_${CARCH}" # but our different arches do not always roll at the same speed
  24. # https://developer.mozilla.org/en-US/docs/Mozilla/Calendar/Calendar_Versions
  25. _calbase=iceowl
  26. _calver=$pkgver
  27. pkgdesc="Language pack for ${_pkgbase^} and ${_calbase}."
  28. arch=('armv7h' 'i686' 'x86_64')
  29. url="https://wiki.parabola.nu/icedove"
  30. license=('MPL' 'GPL')
  31. makedepends=('unzip' 'zip')
  32. pkgname=()
  33. source=(brand.dtd
  34. brand.properties
  35. region.properties
  36. languages.${CARCH}
  37. sha512sums.${CARCH})
  38. # load languages list and .xpi checksums
  39. source languages.${CARCH} &> /dev/null # sets $_languages
  40. source sha512sums.${CARCH} &> /dev/null # sets $_sha512sums
  41. # compile package names and .xpi sources
  42. # NOTE: there is currently no localization for Iceowl:
  43. # https://bugzilla.mozilla.org/show_bug.cgi?id=1469678
  44. # might be temporarily fixable through this:
  45. # https://gist.github.com/progandy/ce857358c4f3b8eb09887a085e4bea30
  46. _src_url=https://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/${pkgver}/linux-x86_64/xpi
  47. for _lang in "${_languages[@]}"; do
  48. _locale=${_lang%% *}
  49. _pkgname=${pkgbase}-${_locale,,}
  50. # _calurl=https://ftp.mozilla.org/pub/calendar/lightning/candidates/${_calver}-candidates/build1/linux-${_src_arch}
  51. pkgname+=($_pkgname)
  52. source+=(${pkgbase}-${pkgver}-${_locale}.xpi::${_src_url}/${_locale}.xpi)
  53. # ${_calbase}-l10n-${_calver}-${_locale}.xpi::${_calurl}/lightning-${_calver}.${_locale}.linux-${_src_arch}.xpi)
  54. eval "package_${_pkgname}() {
  55. _package ${_lang}
  56. }"
  57. done
  58. # compile checksums
  59. _languages_armv7h_shasum='048575a6fe88ee3de5ddd5c2419893d5c4cdc1f1a7b5f015647ddc59a5c385b7ab13c80bbdc65213b921d4224573c8159445dc06f37ab6612ec012927fe6e6c1'
  60. _languages_i686_shasum='048575a6fe88ee3de5ddd5c2419893d5c4cdc1f1a7b5f015647ddc59a5c385b7ab13c80bbdc65213b921d4224573c8159445dc06f37ab6612ec012927fe6e6c1'
  61. _languages_x86_64_shasum='048575a6fe88ee3de5ddd5c2419893d5c4cdc1f1a7b5f015647ddc59a5c385b7ab13c80bbdc65213b921d4224573c8159445dc06f37ab6612ec012927fe6e6c1'
  62. _sha512sums_armv7h_shasum='1e63d7b4230d0e64b0ecd9637a913517d5371537de009affd928809742cc812622814c1861ebbd490c356abb2a60b8ecc736064b45e0aff5c517c236ce142dcb'
  63. _sha512sums_i686_shasum='0cde0eabb54642aa00dae4362bca31d9686103049b74c2859c1f7deb105c886d7134f62b8de9f11272567618bc3049c32e162b8b3eeec0037fc370ad60678e74'
  64. _sha512sums_x86_64_shasum='0cde0eabb54642aa00dae4362bca31d9686103049b74c2859c1f7deb105c886d7134f62b8de9f11272567618bc3049c32e162b8b3eeec0037fc370ad60678e74'
  65. sha512sums=('75d15604c01e76acd6d1dfd872ebc23296c8e76ed936f4a20a5616a73fa42a04a5a509946a4b728e6c052cc7f2ae81306a48cd27b4b1aae63d2d6a3cbff2ade6' # brand.dtd
  66. '934b0e299f1366d19b3a88f572971a36c94213004182fc3de1d2400a5de987aeb57821ad3f5ba8cda81655fcf24394e1779936541acbed646709a6417be3165b' # brand.properties
  67. 'd3120b7e0072b1951ea8d5cdd950fca2ed6bcc4dca2a93a3d40e88bfde0cab288590cb03e7d1359201072c21331fe422bfc3440a38effc1f164155d82c2a0b76' # region.properties
  68. $(eval "echo \$_languages_${CARCH}_shasum") # languages.${CARCH}
  69. $(eval "echo \$_sha512sums_${CARCH}_shasum") # sha512sums.${CARCH}
  70. "${_sha512sums[@]}")
  71. # Don't extract anything
  72. noextract=(${source[@]%%::*})
  73. _package() {
  74. pkgdesc="$2 for Icedove and Iceowl."
  75. depends=("$_pkgbase>=$epoch:$pkgver")
  76. replaces=(thunderbird-i18n-${1,,})
  77. provides=(thunderbird-i18n-${1,,})
  78. mkdir $1
  79. unzip $_pkgbase-l10n-$pkgver-$1.xpi -d $1/$_pkgbase
  80. rm -v $_pkgbase-l10n-$pkgver-$1.xpi
  81. #unzip $_calbase-l10n-$_calver-$1.xpi -d $1/$_calbase
  82. #rm -v $_calbase-l10n-$_calver-$1.xpi
  83. local localizedRe
  84. localizedRe="$(cat $1/$_pkgbase/chrome/$1/locale/$1/messenger-region/region.properties | grep '^[^#]*localizedRe')"
  85. if [ -z "$localizedRe" ]; then
  86. localizedRe="mailnews.localizedRe="
  87. fi
  88. install -vDm644 $srcdir/brand.dtd $1/$_pkgbase/chrome/$1/locale/$1/branding
  89. install -vDm644 $srcdir/brand.properties $1/$_pkgbase/chrome/$1/locale/$1/branding
  90. install -vDm644 $srcdir/region.properties $1/$_pkgbase/chrome/$1/locale/$1/messenger-region
  91. echo "$localizedRe" >> $1/$_pkgbase/chrome/$1/locale/$1/messenger-region/region.properties
  92. #cp -R $1/$_calbase/chrome/calendar-$1 $1/$_pkgbase/chrome/
  93. #cp -R $1/$_calbase/chrome/lightning-$1 $1/$_pkgbase/chrome/
  94. # cat >> $1/$_pkgbase/chrome/de.manifest << EOF
  95. #locale calendar de calendar-de/locale/de/calendar/
  96. #locale lightning de lightning-de/locale/de/lightning/
  97. #EOF
  98. sed -i -e 's/thunderbird/icedove/' $1/$_pkgbase/manifest.json
  99. sed -i -e 's/Thunderbird/Icedove/' $1/$_pkgbase/manifest.json
  100. rm -rv $1/$_pkgbase/chrome/$1/locale/$1/global-platform/{mac,win}
  101. cd $1/$_pkgbase
  102. zip -r langpack-$1@$_pkgbase.mozilla.org.xpi .
  103. mv -v langpack-$1@$_pkgbase.mozilla.org.xpi $srcdir
  104. cd ../..
  105. rm -rv $1
  106. install -vDm644 langpack-$1@$_pkgbase.mozilla.org.xpi \
  107. "$pkgdir/usr/lib/$_pkgbase/extensions/langpack-$1@$_pkgbase.mozilla.org.xpi"
  108. }