archrelease: copy trunk to extra-x86_64
[arch-packages.git] / hunspell-es / trunk / PKGBUILD
blobd92a86c08543a838f70e7ee4bdc9acbeca16bd35
1 # Maintainer: Angel Velasquez <angvp@archlinux.org> 
2 # Maintainer: AndyRTR <andyrtr@archlinux.org>
4 pkgbase=hunspell-es
5 pkgname=(hunspell-es_any hyphen-es mythes-es)
6 pkgver=2.6
7 pkgrel=2
8 epoch=1
9 arch=(any)
10 url="https://github.com/sbosio/rla-es"
11 license=(LGPL3)
12 makedepends=(qt6-webengine)
13 _countries=(
14   'AR "Argentina"'
15   'BO "Bolivia"'
16   'CL "Chile"'
17   'CO "Colombia"'
18   'CR "Costa Rica"'
19   'CU "Cuba"'
20   'DO "Dominican Republic"'
21   'EC "Ecuador"'
22   'ES "Spain"'
23   'GT "Guatemala"'
24   'HN "Honduras"'
25   'MX "Mexico"'
26   'NI "Nicaragua"'
27   'PA "Panama"'
28   'PE "Peru"'
29   'PR "Puerto Rico"'
30   'PY "Paraguay"'
31   'SV "El Salvador"'
32   'UY "Uruguay"'
33   'VE "Venezuela"'
36 source=(https://github.com/sbosio/rla-es/releases/download/v$pkgver/es.oxt)
37 noextract=(es.oxt)
39 for _co in "${_countries[@]}"; do
40   _code=${_co%% *}
41   noextract+=(es_$_code.oxt)
42   source+=("https://github.com/sbosio/rla-es/releases/download/v$pkgver/es_$_code.oxt")
43   _pkgname=hunspell-es_${_code,,}
44   pkgname+=($_pkgname)
45   eval "package_$_pkgname() {
46     _package $_co
47   }"
48 done
50 sha256sums=('10fa51dffb78f0fc15fd791770813f551da43cf007b52cb8fb6ccb0b4117e85f'
51             '1075b8471797fb2b420a70f12e2da55035e121cad3a307d033a8a9c4575932af'
52             '7fa4a0a261f97bd8c36216a1be32b4f7d77cb1018ae40deffa22b9e87d525713'
53             '1c35ea3f3ebb344903e0c4bde3513b68d7ac153a4ebeef0f101d5c87a09f9202'
54             '260e25e8799af8eea483b7c5c0794580583fd0d9fc90158d3dd479476b2cccef'
55             '445b2bf4e4ef423967d99ded28188be040bb7a473742c213d27f91cbc5f09d98'
56             'b6c26f66e0a1c62c5d6c0ab5c056313d765da2af952cd58aa9db7c966759384a'
57             '018851b1dd6b2431fdb3bbf1e4c1f9bcf976d8bb400397b6ece9b7bd91a142df'
58             '2469b2d20051aa4270e67c9de465c2cb9846bb39370844c9130c145c1df33e93'
59             'b6d372b3e0fc51315e28c8bf46e9121ef935fb4a5456902f662ba92ec247837e'
60             'c5292c0b22be9002dd3606763dda8ed6a39cd5f497ffa344d0c04e7d62ff5260'
61             '96af0fe67b9ee70d6c0a30295554d8390e0b256924a578e0b9c79215b8400db3'
62             '2ebefeb14870d219b924d3a253c54bc401dac07d316f73aa37b2202344d1b7ae'
63             '0d15ca525ee21cf0eef107743e4d5ec8132a3d173073d39b04a240c5e0d1ccad'
64             '019637b48b57313e2dd7b5c618aad3a071d79bf1f49d7a99ac5f5f5f5a142414'
65             'f171141aad4f85897ae955c8b770a391b4b0b5b0530bf7233a5f09be4d6bda58'
66             '7613c31667ba5b0a7e9fb9d30902beaf33d4a38da4254164b8b38cbfcffe1069'
67             'ef38c998ebbe41801106bc2846bb2751933ca203e17121e4bf037f15bd18a81e'
68             '7369dd2aeb8a9f9d5d185fd8a7b46f02277ba58a8bfa993cd13729f2ddfb4c88'
69             'f01ef40500aa5416faa9ee6b6b198f5ddc10b30ef35c305173cedd9561634230'
70             '6fdf74b7ac069541354321c82ba7e780aeaff15b2f5b2b8ae118d439d275ffa8')
72 _package() {
73   pkgdesc="Spanish ($2) hunspell dictionary"
74   depends=(hunspell)
75   conflicts=(hunspell-es)
77   LANG=en_US.utf8 bsdtar -xf es_$1.oxt
79   install -dm755 "$pkgdir"/usr/share/hunspell
80   install -Dm644 es_$1.dic es_$1.aff "$pkgdir/usr/share/hunspell"
82   install -d "$pkgdir"/usr/share/myspell/dicts
83   pushd "$pkgdir/usr/share/myspell/dicts"
84     for _file in "$pkgdir"/usr/share/hunspell/*; do
85       ln -sv /usr/share/hunspell/$(basename $_file) .
86     done
87   popd
89 # Install webengine dictionaries   
90   install -d "$pkgdir"/usr/share/qt{,6}/qtwebengine_dictionaries/
91   for _file in "$pkgdir"/usr/share/hunspell/*.dic; do
92   _filename=$(basename $_file)
93     /usr/lib/qt6/qwebengine_convert_dict $_file "$pkgdir"/usr/share/qt6/qtwebengine_dictionaries/${_filename/\.dic/\.bdic}
94   ln -rs "$pkgdir"/usr/share/qt6/qtwebengine_dictionaries/${_filename/\.dic/\.bdic} "$pkgdir"/usr/share/qt/qtwebengine_dictionaries/
95   done
97   install -Dm644 README.txt -t "$pkgdir/usr/share/doc/$pkgname"
100 package_hunspell-es_any() {
101   pkgdesc="Spanish (generic) hunspell dictionary"
102   depends=(hunspell)
103   conflicts=(hunspell-es)
104   replaces=(hunspell-es)
106   LANG=en_US.utf8 bsdtar -xf es.oxt
108   install -Dm644 es.dic es.aff -t "$pkgdir"/usr/share/hunspell
110   install -d "${pkgdir}/usr/share/myspell/dicts"
111   pushd "$pkgdir/usr/share/myspell/dicts"
112     for file in "$pkgdir"/usr/share/hunspell/*; do
113       ln -sv /usr/share/hunspell/$(basename $file) .
114     done
115   popd
116   
117 # Install webengine dictionaries   
118   install -d "$pkgdir"/usr/share/qt{,6}/qtwebengine_dictionaries/
119   for _file in "$pkgdir"/usr/share/hunspell/*.dic; do
120   _filename=$(basename $_file)
121     /usr/lib/qt6/qwebengine_convert_dict $_file "$pkgdir"/usr/share/qt6/qtwebengine_dictionaries/${_filename/\.dic/\.bdic}
122   ln -rs "$pkgdir"/usr/share/qt6/qtwebengine_dictionaries/${_filename/\.dic/\.bdic} "$pkgdir"/usr/share/qt/qtwebengine_dictionaries/
123   done
125   install -Dm644 README.txt -t "$pkgdir/usr/share/doc/$pkgname"
128 package_hyphen-es() {
129   pkgdesc="Spanish hyphenation rules"
130   depends=(hyphen)
132   install -Dm644 hyph_es.dic -t "$pkgdir"/usr/share/hyphen/
134   pushd "$pkgdir"/usr/share/hyphen/
135   for _co in "${_countries[@]}"; do
136     ln -s hyph_es.dic hyph_es_${_co%% *}.dic
137   done
138   popd
140   install -d "$pkgdir"/usr/share/myspell/dicts
141   pushd "$pkgdir"/usr/share/myspell/dicts
142     for file in "$pkgdir"/usr/share/hyphen/*; do
143       ln -sv /usr/share/hyphen/$(basename $file) .
144     done
145   popd
146   
147   install -Dm644 README_hyph_es.txt -t "$pkgdir"/usr/share/doc/$pkgname/
150 package_mythes-es() {
151   pkgdesc="Spanish thesaurus"
152   depends=(libmythes)
154   LANG=en_US.utf8 bsdtar -xf es.oxt
155   install -Dm644 th_es_v2.* -t "$pkgdir"/usr/share/mythes
157   pushd "$pkgdir"/usr/share/mythes/
158   for _co in "${_countries[@]}"; do
159     ln -s th_es_v2.idx "th_es_"${_co%% *}"_v2.idx" || true
160     ln -s th_es_v2.dat "th_es_"${_co%% *}"_v2.dat" || true
161   done
162   popd
164   install -d "$pkgdir"/usr/share/myspell/dicts
165   pushd "$pkgdir"/usr/share/myspell/dicts
166   for file in "$pkgdir"/usr/share/mythes/*; do
167     ln -sv /usr/share/mythes/$(basename $file) .
168   done
169   popd
170   
171   install -Dm644 README_th_es.txt -t "$pkgdir"/usr/share/doc/$pkgname/