Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > d7db48600d4c0586ca5c05d1ab3f7148 > files > 1

aspell-fi-0.50.0-1mdk.src.rpm

%define src_ver 0.02

%define languageenglazy Finnish
%define languagecode fi
%define lc_ctype fi_FI

Summary:       %{languageenglazy} files for aspell
Name:          aspell-%{languagecode}
Version:       0.50.0
Release:       1mdk
Group:         System/Internationalization
#Source:        ftp://ftp.gnu.org/gnu/aspell/dict/aspell-%{languagecode}-%{src_ver}.tar.bz2
# sources for ispell
Source:        finnish.tar.bz2
URL:           http://aspell.net/
License:	   GPL
BuildRoot:     %{_tmppath}/%{name}-%{version}-root
Provides:	   spell-%{languagecode}
# old ispell is repalced with aspell
Obsoletes:	   ispell-%{languagecode}

# the sources are for ispell; so we need ispell to build
#  a plain word list
BuildRequires: ispell

BuildRequires: aspell >= 0.50
BuildRequires: make
Requires:      aspell >= 0.50

# Mandrake Stuff
Requires:      locales-%{languagecode}
Provides:      aspell-dictionary
Provides:	   aspell-%{lc_ctype}

Autoreqprov:   no

%description
A %{languageenglazy} dictionary for use with aspell, a spelling checker.

%prep
#%setup -q -n %{name}-%{src_ver}
%setup -n finnish
cp finnish.medium.aff finnish.aff

%build

# don't use configure macro
#./configure

buildhash finnish.dict finnish.aff finnish.hash
cat finnish.dict | ispell -d ./finnish -e > fi.lst

# the character ':' can appear on middle of some words
# (to join a foreing word (often an acronym) and a grammatical ending)
# however, aspell 0.50 crashes with them; so they need to be removed
# (665 out of a total of 1880385)
cat fi.lst | tr ' ' '\n' | LC_ALL=C sort -u | grep -v ':' > fi.tmp && \
	mv fi.tmp fi.lst

#%make

echo "add fi.rws" > fi.multi
cat << EOF > fi.dat
name fi
charset iso8859-1
# the character - can appear on middle of a word
# the character ' can appear on middle of a word
# the character : can appear on middle of a word (but it doesn't work yet)
special - -*- ' -*-
EOF

aspell --lang=fi create master ./fi.rws < fi.lst

%install
rm -fr $RPM_BUILD_ROOT

#%makeinstall_std

#mv -f README README.%{languagecode}
#chmod 644 Copyright README.%{languagecode} doc/*

mkdir -p $RPM_BUILD_ROOT/%{_datadir}/aspell
mkdir -p $RPM_BUILD_ROOT/%{_libdir}/aspell

install -m 644 fi.multi $RPM_BUILD_ROOT/%{_libdir}/aspell/
install -m 644 fi.rws $RPM_BUILD_ROOT/%{_libdir}/aspell/
install -m 644 fi.dat $RPM_BUILD_ROOT/%{_datadir}/aspell/


%clean
rm -fr $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
#%doc README.%{languagecode} Copyright doc/*
%dir %{_datadir}/aspell
%{_datadir}/aspell/*
%dir %{_libdir}/aspell
%{_libdir}/aspell/*

%changelog
* Mon Jul 19 2004 Pablo Saratxaga <pablo@mandrakesoft.com> 0.50.0-1mdk
- first version for aspell (wordlist taken from ispell Finnish dictionnary;
  none of the aspell niceties is used for now)