File stardict.spec of Package stardict

# spec file for package stardict
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           stardict
Version:        3.0.3
Release:        0
Summary:        A cross-platform and internationalized dictionary
License:        GPL-3.0
Group:          Productivity/Office/Dictionary
Source0:        %{name}-%{version}.tar.bz2
Source1:        ru.po
# PATCH-FIX-OPENSUSE stardict-3.0.3-fix-path-for-sounds.patch -- adjust default path for sound files
Patch0:         stardict-3.0.3-fix-path-for-sounds.patch
# PATCH-FIX-OPENSUSE stardict-3.0.3-improve-desktop-file.patch -- add GenericName entry
Patch1:         stardict-3.0.3-improve-desktop-file.patch
# PATCH-FIX-UPSTREAM stardict-3.0.3-gcc46.patch -- rebased from Fedora package
Patch2:         stardict-3.0.3-gcc46.patch
# PATCH-FIX-UPSTREAM stardict-3.0.3-NetDictRequest.patch -- rebased from Arch Linux package
Patch3:         stardict-3.0.3-NetDictRequest.patch
# PATCH-FIX-UPSTREAM stardict-wrong-memset.patch -- Fix wrong memset size parameter
Patch4:         stardict-3.0.3-wrong-memset.patch
# PATCH-FIX-UPSTREAM stardict-3.0.3-fix-glib_h-include.patch -- Fix glib.h include
Patch5:         stardict-3.0.3-fix-glib_h-include.patch
# PATCH-FIX-UPSTREAM stardict-3.0.3-zlib-update.patch - fix zlib
Patch6:         stardict-3.0.3-zlib-update.patch
%if 0%{?suse_version}
BuildRequires:  update-desktop-files
BuildRequires:  enchant-devel
BuildRequires:  espeak-devel
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  gnome-common
BuildRequires:  gnome-doc-utils-devel
BuildRequires:  gtk2 >= 2.20
BuildRequires:  intltool
BuildRequires:  libgnomeui-devel
BuildRequires:  libsigc++2-devel
BuildRequires:  perl-XML-Parser
BuildRequires:  sgml-skel
BuildRequires:  zlib-devel
# gucharmap now uses gtk3, but stardict still uses gtk2
# BuildRequires:  gucharmap-devel
Requires:       enchant
Requires:       espeak
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

StarDict is a Cross-Platform and international dictionary written in

It has powerful features such as "Glob-style pattern matching", "Scan
selection word","Fuzzy query" etc.

%setup -q
%if 0%{?suse_version} > 1210
%patch6 -p1
cp %{SOURCE1} dict/po/

# Remove unneeded sigc++ header files to make it sure
# that we are using system-wide libsigc++
find src/sigc++* -name \*.h -or -name \*.cc | xargs rm -f

autoreconf -fi
%configure \
           --disable-tools \
           --disable-schemas-install \
           --disable-updateinfo \
           --disable-scrollkeeper \
           --disable-festival \
make %{?_smp_mflags}


#fix spurious-executable-perm RPMLINT warning
chmod 0644 COPYING

find %{buildroot}%{_libdir}/stardict/plugins -name "*.la" -print0 | xargs -0 rm -rf {} \;

%find_lang %{name}

cat %{name}.lang %{name}.schemas_list >%{name}.lst

%suse_update_desktop_file stardict Office Dictionary
# save space, create symlinks for identical files
%fdupes -s %{buildroot}

rm -rf %{buildroot}

%pre -f %{name}.schemas_pre

%posttrans -f %{name}.schemas_posttrans

%preun -f %{name}.schemas_preun

%files  -f %{name}.lst
%doc dict/doc/FAQ dict/doc/HACKING dict/doc/HowToCreateDictionary dict/doc/StarDictFileFormat dict/doc/Translation dict/AUTHORS COPYING dict/ChangeLog dict/README
%if 0%{?suse_version} < 1030
%dir %{_libdir}/bonobo
%dir %{_libdir}/bonobo/servers
%dir %{_datadir}/gnome
%dir %{_datadir}/gnome/help
%config %{sysconfdir}/gconf/schemas/stardict.schemas