#!/bin/sh
# <Debian Mint Ubuntu> da 'grafik yazı editörleri' için Kwrite, Kate, Gedit ile ”aspell-tr yazım denetimi”
# Copyright (C) 2011 Yaşar Yeğin (Felâsife) <yasar @ imeyil.com>
# doctus.org && debian.org.tr
#####This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
#####This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#####You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
if [ $USER != root ]; then
echo "Hata: betik yönetici haklarıyla (su ile) çalıştırılmalıdır.
bye"
sleep 0;
exit 0
fi
###
echo "1. Kurmak mı istiyorsunuz?"
echo "2. Kaldırmak mı istiyorsunuz?"
echo -n "Secenek giriniz : "
read secenek
case $secenek in
1)
echo " "
file="/usr/lib/aspell/tr.multi"
if [ ! -e $file ]; then
echo "Kurulum devam ediyor.."
else
echo "Üzgünüz!
Daha önce kurulum yapmışsınız, önce kaldırmanız gerekmektedir."
sleep 0;
exit 0
fi
#######
cd /tmp
wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/zemberek/full.txt.tr.tar.gz
cd /tmp
tar xvf full.txt.tr.tar.gz
cat full.txt.tr > tr.txt
sort -u <tr.txt | word-list-compress c >tr.cwl
####### aspell-tr paketimizi çekelim....
wget http://mirrors.ibiblio.org/gnu/aspell/dict/tr/aspell-tr-0.50-0.tar.bz2
tar xvf aspell-tr-0.50-0.tar.bz2
rm -f /aspell-tr-0.50-0/tr.cwl
cp -a /tmp/tr.cwl /tmp/aspell-tr-0.50-0/
####### Devam ediyoruz ve dizin içine giriyoruz...
cd /tmp/aspell-tr-0.50-0/
echo "name tr
data-encoding utf-8
charset iso8859-9
special - -*-
soundslike generic
affix-compress false" > ./tr.dat
####### derleme başlasın...
./configure
make
make install
####### kalanları temizleyelim....
cd /tmp
rm -f ./tr.cwl
rm -f ./tr.txt
rm -f ./full.txt.tr
rm -Rf full.txt.tr.tar.gz
rm -Rf aspell-tr-0.50-0.tar.bz2
rm -Rf aspell-tr-0.50-0
#######
echo
aspell dump dicts | grep tr
echo "Kurulum bitti..."
;;
2)
echo ""
file="/usr/lib/aspell/tr.multi"
if [ -e $file ]; then
echo "Kaldırma işlemi başladı.."
else
echo "Üzgünüz!
Betiği kurmadan kaldıramazsınız.."
sleep 0
exit 0
fi
#######
cd /tmp
wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/zemberek/full.txt.tr.tar.gz
cd /tmp
tar xvf full.txt.tr.tar.gz
cat full.txt.tr > tr.txt
sort -u <tr.txt | word-list-compress c >tr.cwl
####### aspell-tr paketimizi çekelim....
wget http://mirrors.ibiblio.org/gnu/aspell/dict/tr/aspell-tr-0.50-0.tar.bz2
tar xvf aspell-tr-0.50-0.tar.bz2
rm -f /aspell-tr-0.50-0/tr.cwl
cp -a /tmp/tr.cwl /tmp/aspell-tr-0.50-0/
####### Devam ediyoruz ve dizin içine giriyoruz...
cd /tmp/aspell-tr-0.50-0/
echo "name tr
data-encoding utf-8
charset iso8859-9
special - -*-
soundslike generic
affix-compress false" > ./tr.dat
####### derleme ve kaldırma işlemi başlasın...
./configure
make
make uninstall
####### kalanları da temizleyelim....
cd /tmp
rm -f ./tr.cwl
rm -f ./tr.txt
rm -f ./full.txt.tr
rm -Rf full.txt.tr.tar.gz
rm -Rf aspell-tr-0.50-0.tar.bz2
rm -Rf aspell-tr-0.50-0
#######
echo
aspell dump dicts | grep tr
echo "Kaldırma işlemi bitti..."
;;
*)
echo bye
esac