archrelease: copy trunk to extra-x86_64
[arch-packages.git] / mythes-en / repos / extra-any / PKGBUILD
blob42fd27bd39e6e164257294a186cdc7621cc988a4
1 # Maintainer: AndyRTR <andyrtr@archlinux.org>
3 pkgname=mythes-en
4 # https://cgit.freedesktop.org/libreoffice/dictionaries/log/en
5 _commit=81c820ae2e0f447d3bd71855c3bc7e8912740d11 # last commit "en" subdir - 2022-11-02
6 pkgver=20221102
7 pkgrel=2
8 pkgdesc="English thesaurus"
9 arch=('any')
10 url="https://wiki.documentfoundation.org/Development/Dictionaries"
11 license=('LGPL')
12 makedepends=('git' 'libmythes')
13 optdepends=('libmythes: offers thesaurus library functions')
14 source=("git+https://anongit.freedesktop.org/git/libreoffice/dictionaries.git#commit=$_commit")
15 sha256sums=('SKIP')
17 package() {
18   cd dictionaries/en
19 #return 1
20   install -dm755 "${pkgdir}"/usr/share/mythes
21   cp -p th_en_US_v2.* "$pkgdir"/usr/share/mythes
23   pushd "$pkgdir"/usr/share/mythes/
24   # create sorted index *.idx file from structured thesaurus file 
25   for lang in `find -type f -name "*.dat" -printf '%P\n'`; do
26     cat "${lang}" | /usr/bin/th_gen_idx.pl > "${lang/.dat/}".idx
27   done
29   en_US_aliases="en_AG en_AU en_BS en_BW en_BZ en_CA en_DK en_GB en_GH en_IE en_IN en_JM en_NA en_NG en_NZ en_PH en_SG en_TT en_ZA en_ZW"
30   for lang in $en_US_aliases; do
31         ln -s th_en_US_v2.idx th_"$lang"_v2.idx
32         ln -s th_en_US_v2.dat th_"$lang"_v2.dat
33   done
34   popd
36   # the symlinks
37   install -dm755 "${pkgdir}"/usr/share/myspell/dicts
38   pushd "$pkgdir"/usr/share/myspell/dicts
39     for file in "$pkgdir"/usr/share/mythes/*; do
40       ln -sv /usr/share/mythes/$(basename $file) .
41     done
42   popd
43   
44   # docs
45   install -dm755 "${pkgdir}"/usr/share/doc/$pkgname
46   cp -p README_en_GB_thes.txt "$pkgdir"/usr/share/doc/$pkgname