%define name @PACKAGE@
%define version @VERSION@
Name: %{name}
Summary: A powerful dictionary platform written in GTK
Version: %{version}
Release: 1%{?dist}
Group: Applications/System
License: GPLv3
URL: http://stardict-4.sourceforge.net
Source0: https://sourceforge.net/projects/stardict-4/files/%{version}/%{name}-%{version}.tar.xz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: gtk3, enchant, espeak, libsigc++20 >= 2.0.17
Requires: gucharmap, libcanberra, libcanberra-gtk3
Requires: flite
#Requires: festival, speech-tools
Requires(preun): GConf2
Requires(post): GConf2, scrollkeeper
Requires(postun): scrollkeeper
BuildRequires: desktop-file-utils, gettext, intltool, perl-XML-Parser, scrollkeeper
BuildRequires: gtk3-devel, enchant-devel, espeak-devel, libsigc++20-devel
BuildRequires: gucharmap-devel, flite-devel, libcanberra-devel, libcanberra-gtk3-devel
#BuildRequires: festival-devel, speech-tools-devel
%description
StarDict is a Cross-Platform and international dictionary written in Gtk.
It has powerful features such as "Glob-style pattern matching,"
"Scan selection word," "Fuzzy query," etc.
%prep
%setup -q
%build
%configure --disable-schemas-install --disable-dictdotcn --disable-scrollkeeper --disable-festival --disable-tools
make -k %{_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" install
rm -f `find $RPM_BUILD_ROOT%{_libdir}/stardict/plugins -name "*.la"`
%find_lang %{name}
%clean
rm -rf $RPM_BUILD_ROOT
%files -f %{name}.lang
%defattr(-, root, root)
%{_bindir}/stardict
%{_datadir}/applications/*.desktop
%{_datadir}/stardict
%{_libdir}/stardict
%{_datadir}/idl/*
%{_libdir}/bonobo/servers/*.server
%{_datadir}/pixmaps/stardict.png
%{_sysconfdir}/gconf/schemas/*.schemas
%{_datadir}/omf/*
%{_mandir}/man1/*
%doc %{_datadir}/gnome/help/stardict
%doc dict/README COPYING dict/ChangeLog dict/AUTHORS dict/doc/FAQ dict/doc/HACKING dict/doc/HowToCreateDictionary dict/doc/StarDictFileFormat dict/doc/Translation
%preun
if [ "$1" -gt 1 ] ; then
export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` gconftool-2 --makefile-uninstall-rule %{_sysconfdir}/gconf/schemas/stardict.schemas >/dev/null || :
fi
%post
GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` gconftool-2 --makefile-install-rule %{_sysconfdir}/gconf/schemas/stardict.schemas >/dev/null || :
if which scrollkeeper-update>/dev/null 2>&1; then scrollkeeper-update; fi
%postun
if which scrollkeeper-update>/dev/null 2>&1; then scrollkeeper-update; fi