libreoffice-compilar/scripts/dict-pkg.sh

35 lines
714 B
Bash
Raw Normal View History

#!/bin/bash
SRC=dict.lst
[[ -f $SRC ]] || exit 1
SPEC=CentOS-9/SPECS/libreoffice.spec
[[ -f $SPEC ]] || exit 2
for D in `cat dict.lst` ; do
LNG=`cut -d '-' -f 2-3 <<< $D`
LNW=`sed 's/#.*$//' $SPEC | grep 'langpack -l' | grep " $LNG " \
| head -1 | cut -d ' ' -f 5`
if [[ -n $LNW ]] ; then
if [[ -n `grep langpack <<< $LNW` ]] ; then
#echo "Looking for $LNG " >&2
LNW=`sed 's/#.*$//' $SPEC | grep -B1 $LNG | grep 'define' \
| head -1 | cut -d ' ' -f 3-9`
#LNW=$LNP
fi
#echo "$D - $LNW"
cat << EOF
%package myspell-$D
Summary: Myspell $LNW dictionary
BuildArch: noarch
%description myspell-$D
Myspell $LNW dictionary
%files myspell-$D
%{baseinstdir}/share/extensions/$D
EOF
fi
done