recipe 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. # Build recipe for tde-i18n.
  2. #
  3. # Copyright (c) 2021-2022 Matias Fonzo, <selk@dragora.org>.
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. # Exit immediately on any error
  17. set -e
  18. # This recipe does not produce a main package, but sub-packages
  19. opt_nopkg=opt_nopkg
  20. program=tde-i18n
  21. version=20220504_e67bfc8629
  22. arch=noarch
  23. release=1
  24. # Define a category for the output of the package name
  25. pkgcategory=tde_i18n
  26. tarname=${program}-${version}.tar.lz
  27. # Remote source(s)
  28. fetch="
  29. https://dragora.mirror.garr.it/current/sources/$tarname
  30. rsync://rsync.dragora.org/current/sources/$tarname
  31. "
  32. description="TDE internationalization translations."
  33. homepage=https://www.trinitydesktop.org/
  34. license=GPLv2+
  35. # Source documentation
  36. docs="AUTHORS COPYING* README*"
  37. docsdir="${docdir}/${program}-${version}"
  38. build()
  39. {
  40. unpack "${tardir}/$tarname"
  41. cd "$srcdir"
  42. # Set sane permissions
  43. chmod -R u+w,go-w,a+rX-s .
  44. for langdir in tde-i18n-*
  45. do
  46. unset -v pkgname destdir full_pkgname description
  47. pkgname="$langdir"
  48. destdir="${TMPDIR}/package-$pkgname"
  49. full_pkgname="${pkgname}_${pkgversion}_${arch}-${release}${pkgcategory}"
  50. # Set description for each generated package
  51. case $langdir in
  52. tde-i18n-af)
  53. langdescription="Afrikaans (af)"
  54. ;;
  55. tde-i18n-ar)
  56. langdescription="Arabic (ar)"
  57. ;;
  58. tde-i18n-az)
  59. langdescription="Azerbaijani (az)"
  60. ;;
  61. tde-i18n-be)
  62. langdescription="Belarusian (be)"
  63. ;;
  64. tde-i18n-bg)
  65. langdescription="Bulgarian (bg)"
  66. ;;
  67. tde-i18n-bn)
  68. langdescription="Bengali (bn)"
  69. ;;
  70. tde-i18n-br)
  71. langdescription="Breton (br)"
  72. ;;
  73. tde-i18n-bs)
  74. langdescription="Bosnian (bs)"
  75. ;;
  76. tde-i18n-ca)
  77. langdescription="Catalan (ca)"
  78. ;;
  79. tde-i18n-cs)
  80. langdescription="Czech (cs)"
  81. ;;
  82. tde-i18n-csb)
  83. langdescription="Kashubian (csb)"
  84. ;;
  85. tde-i18n-cy)
  86. langdescription="Welsh (cy)"
  87. ;;
  88. tde-i18n-da)
  89. langdescription="Danish (da)"
  90. ;;
  91. tde-i18n-de)
  92. langdescription="German (de)"
  93. ;;
  94. tde-i18n-el)
  95. langdescription="Greek (el)"
  96. ;;
  97. tde-i18n-en_GB)
  98. langdescription="British English (en_GB)"
  99. ;;
  100. tde-i18n-eo)
  101. langdescription="Esperanto (eo)"
  102. ;;
  103. tde-i18n-es)
  104. langdescription="Spanish (es)"
  105. ;;
  106. tde-i18n-es_AR)
  107. langdescription="Spanish Argentina (es_AR)"
  108. ;;
  109. tde-i18n-et)
  110. langdescription="Estonian (et)"
  111. ;;
  112. tde-i18n-eu)
  113. langdescription="Basque (eu)"
  114. ;;
  115. tde-i18n-fa)
  116. langdescription="Farsi, Persian (fa)"
  117. ;;
  118. tde-i18n-fi)
  119. langdescription="Finnish (fi)"
  120. ;;
  121. tde-i18n-fr)
  122. langdescription="French (fr)"
  123. ;;
  124. tde-i18n-fy)
  125. langdescription="Frisian (fy)"
  126. ;;
  127. tde-i18n-ga)
  128. langdescription="Irish (ga)"
  129. ;;
  130. tde-i18n-gl)
  131. langdescription="Galician (gl)"
  132. ;;
  133. tde-i18n-he)
  134. langdescription="Hebrew (he)"
  135. ;;
  136. tde-i18n-hi)
  137. langdescription="Hindi (hi)"
  138. ;;
  139. tde-i18n-hr)
  140. langdescription="Croatian (hr)"
  141. ;;
  142. tde-i18n-hu)
  143. langdescription="Hungarian (hu)"
  144. ;;
  145. tde-i18n-ie)
  146. # "tde-i18n-ie" lacks a valid CMakeList file
  147. #langdescription="Occidental (ie)"
  148. continue;
  149. ;;
  150. tde-i18n-is)
  151. langdescription="Icelandic (is)"
  152. ;;
  153. tde-i18n-it)
  154. langdescription="Italian (it)"
  155. ;;
  156. tde-i18n-ja)
  157. langdescription="Japanese (ja)"
  158. ;;
  159. tde-i18n-kk)
  160. langdescription="Kazakh (kk)"
  161. ;;
  162. tde-i18n-km)
  163. langdescription="Khmer (km)"
  164. ;;
  165. tde-i18n-ko)
  166. langdescription="Korean (ko)"
  167. ;;
  168. tde-i18n-lt)
  169. langdescription="Lithuanian (lt)"
  170. ;;
  171. tde-i18n-lv)
  172. langdescription="Latvian (lv)"
  173. ;;
  174. tde-i18n-mk)
  175. langdescription="Macedonian (mk)"
  176. ;;
  177. tde-i18n-mn)
  178. langdescription="Mongolian (mn)"
  179. ;;
  180. tde-i18n-ms)
  181. langdescription="Malay (ms)"
  182. ;;
  183. tde-i18n-nb)
  184. langdescription="Norwegian Bookmal (nb)"
  185. ;;
  186. tde-i18n-nds)
  187. langdescription="Low Saxon (nds)"
  188. ;;
  189. tde-i18n-nl)
  190. langdescription="Dutch (nl)"
  191. ;;
  192. tde-i18n-nn)
  193. langdescription="Norwegian Nynorsk (nn)"
  194. ;;
  195. tde-i18n-pa)
  196. langdescription="Punjabi (pa)"
  197. ;;
  198. tde-i18n-pl)
  199. langdescription="Polish (pl)"
  200. ;;
  201. tde-i18n-pt)
  202. langdescription="Portuguese (pl)"
  203. ;;
  204. tde-i18n-pt_BR)
  205. langdescription="Brazilian Portuguese (pt_BR)"
  206. ;;
  207. tde-i18n-ro)
  208. langdescription="Romanian (ro)"
  209. ;;
  210. tde-i18n-ru)
  211. langdescription="Russian (ru)"
  212. ;;
  213. tde-i18n-rw)
  214. langdescription="Kinyarwanda (rw)"
  215. ;;
  216. tde-i18n-se)
  217. langdescription="Northern Sami (se)"
  218. ;;
  219. tde-i18n-sk)
  220. langdescription="Slovak (sk)"
  221. ;;
  222. tde-i18n-sl)
  223. langdescription="Slovenian (sl)"
  224. ;;
  225. tde-i18n-sr)
  226. langdescription="Serbian (sr)"
  227. ;;
  228. tde-i18n-sr@Latn)
  229. langdescription="Serbian (sr@Latn)"
  230. ;;
  231. tde-i18n-ss)
  232. langdescription="Swati (ss)"
  233. ;;
  234. tde-i18n-sv)
  235. langdescription="Swedish (sv)"
  236. ;;
  237. tde-i18n-ta)
  238. langdescription="Tamil (ta)"
  239. ;;
  240. tde-i18n-te)
  241. langdescription="Telugu (te)"
  242. ;;
  243. tde-i18n-tg)
  244. langdescription="Tajik (tg)"
  245. ;;
  246. tde-i18n-th)
  247. langdescription="Thai (th)"
  248. ;;
  249. tde-i18n-tr)
  250. langdescription="Turkish (tr)"
  251. ;;
  252. tde-i18n-uk)
  253. langdescription="Ukrainian (uk)"
  254. ;;
  255. tde-i18n-uz)
  256. langdescription="Uzbek (uz)"
  257. ;;
  258. tde-i18n-uz@cyrillic)
  259. langdescription="Uzbek (uz@cyrillic)"
  260. ;;
  261. tde-i18n-vi)
  262. langdescription="Vietnamese (vi)"
  263. ;;
  264. tde-i18n-wa)
  265. langdescription="Walloon (wa)"
  266. ;;
  267. tde-i18n-zh_CN)
  268. langdescription="Chinese Simplified (zh_CN)"
  269. ;;
  270. tde-i18n-zh_TW)
  271. langdescription="Chinese Traditional (zh_TW)"
  272. ;;
  273. *)
  274. langdescription="$langdir"
  275. ;;
  276. esac
  277. description="${langdescription} translation for TDE."
  278. cd -- "$langdir"
  279. rm -rf BUILD
  280. mkdir BUILD
  281. cd BUILD
  282. cmake \
  283. -DCMAKE_INSTALL_PREFIX=/usr \
  284. -DLIB_SUFFIX=${libSuffix} \
  285. -DCMAKE_VERBOSE_MAKEFILE=ON \
  286. -DCMAKE_SKIP_RPATH=OFF \
  287. -DCMAKE_INSTALL_PREFIX=/opt/trinity \
  288. -DCONFIG_INSTALL_DIR=/etc/trinity \
  289. -DSYSCONF_INSTALL_DIR=/etc/trinity \
  290. -DCMAKE_LIBRARY_PATH=/opt/trinity/lib${libSuffix} \
  291. -DCMAKE_INCLUDE_PATH=/opt/trinity/include \
  292. -DBUILD_DOC=ON \
  293. -DBUILD_DATA=ON \
  294. -DBUILD_MESSAGES=ON \
  295. -G Ninja ..
  296. ninja -j${jobs}
  297. DESTDIR="$destdir" ninja -j${jobs} install
  298. # Produce the sub-package by invoking the internal Qi function
  299. do_meta > "${outdir}/${full_pkgname}.tlz.txt"
  300. mkdir -p -- "${destdir}/var/lib/qi"
  301. cp -p "${outdir}/${full_pkgname}.tlz.txt" \
  302. "${destdir}/var/lib/qi/${full_pkgname}.txt"
  303. cd -- "$destdir" && mode_create "${outdir}/${full_pkgname}.tlz"
  304. # Install or upgrade the package after build
  305. if test "$opt_install" = opt_install
  306. then
  307. mode_install "${outdir}/${full_pkgname}.tlz"
  308. elif test "$opt_upgrade" = opt_upgrade
  309. then
  310. mode_upgrade "${outdir}/${full_pkgname}.tlz"
  311. fi
  312. # Check given options to Qi in order to remove 'destdir' or not
  313. if test "$opt_keep" != opt_keep && test -z "$keep_destdir"
  314. then
  315. cd ..
  316. rm -r "$destdir"
  317. fi
  318. # Switch back to the source directory
  319. cd -- "${TMPDIR}/$srcdir"
  320. done
  321. unset -v pkgname destdir full_pkgname description
  322. }