File stardict.spec of Package stardict

#
# spec file for package stardict
#
# Copyright (c) 2011 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 http://bugs.opensuse.org/
#

# norootforbuild


Name:           stardict
Summary:        A cross-platform and internationalized dictionary
Version:        3.0.1
Release:        70
License:        GPLv2+
Group:          Productivity/Office/Dictionary
Url:            http://stardict.sourceforge.net
Source0:        %{name}-%{version}.tar.bz2
Source1:        stardict.desktop
Source2:        stardict-rpmlintrc
Source3:        ru.po
Source4:        lt.po
Source5:        LINGUAS
Patch0:         stardict-2.4.8-dont-install-omf.patch
Patch1:         stardict-3.0.1-festival.h-path-fix.patch 
Patch2:         stardict-3.0.1-includes.patch
Patch3:         stardict-transparent_trayicon.patch
Patch4:         configure-festival.diff
Patch5:         stardict-gucharmap.patch
Patch6:         fix_gethostbynamer.patch
Patch7:         stardict-3.0.1-gcc44.patch
Patch8:         stardict-adjust-path-for-sounds.patch
Requires:       enchant festival espeak pulseaudio
BuildRequires:  gcc-c++ gnome-common intltool libgnomeui-devel perl-XML-Parser scrollkeeper sgml-skel
BuildRequires:  gucharmap-devel update-desktop-files
# new in version 3.x: festival and espeak support
BuildRequires:  enchant-devel festival-devel libsigc++2-devel
%if 0%{?suse_version} > 1020
BuildRequires:  fdupes
%gconf_schemas_prereq
%if 0%{?suse_version} > 1100
BuildRequires:  espeak-devel
%else
BuildRequires:  espeak
%endif
%else
%define prefix     /opt/gnome
%define sysconfdir /etc%{prefix}
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
StarDict is a Cross-Platform and international dictionary written in
Gtk2.

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



Authors:
--------
    Maintainers:
        Hu Zheng <huzheng_001@163.com> http://forlinux.yeah.net
    Contributors:
        Alex Murygin <murygin@aitoc.com>

%prep
%setup -q
%patch0 -p0
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5
%patch6 -p1
%patch7 -p1
%patch8 -p1
# 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
cp %{SOURCE3} po/
cp %{SOURCE4} po/
cp %{SOURCE5} po/

%build
autoreconf -fi
%configure \
           --disable-schemas-install \
%if 0%{?suse_version} < 1110
            --disable-gucharmap \
%endif
           --disable-advertisement \
           --disable-updateinfo
%{__make} %{?jobs:-j%jobs}

%install
%if 0%{?suse_version} < 1030
export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
%endif
%makeinstall
find %buildroot%{_libdir}/stardict/plugins -name "*.la" -print0 | xargs -0 rm -rf {} \;
%find_lang %{name}
%if 0%{?suse_version} > 1020
%find_gconf_schemas
cat %{name}.lang %{name}.schemas_list >%{name}.lst
%else
%{__install} -d -m755 %buildroot%{sysconfdir}/gconf/schemas/
%{__mv} %buildroot%{_sysconfdir}/gconf/schemas/stardict.schemas %buildroot%{sysconfdir}/gconf/schemas/
cat %{name}.lang >%{name}.lst
%endif
install -D -m 644 %{SOURCE1} ${RPM_BUILD_ROOT}/%{_datadir}/applications/stardict.desktop
%suse_update_desktop_file stardict Office Dictionary 
# save space, create symlinks for identical files
%if 0%{?suse_version} > 1020
%fdupes -s %buildroot
%endif

%clean
rm -rf %buildroot
%if 0%{?suse_version} > 1020

%pre -f %{name}.schemas_pre
# Remove orphan file created by stardict.spec in SuSE <= 10.2.
# Can be removed after openSUSE 10.3.
if [ -f var/adm/SuSEconfig/run-scrollkeeper-update ]; then
	rm -f var/adm/SuSEconfig/run-scrollkeeper-update 2>/dev/null
fi

%posttrans -f %{name}.schemas_posttrans

%preun -f %{name}.schemas_preun
%else

%post
export GCONF_CONFIG_SOURCE=`opt/gnome/bin/gconftool-2 --get-default-source`
opt/gnome/bin/gconftool-2 --makefile-install-rule %{sysconfdir}/gconf/schemas/stardict.schemas >/dev/null
touch var/adm/SuSEconfig/run-scrollkeeper-update
%endif

%files  -f %{name}.lst
%defattr(-,root,root)
%doc %{_mandir}/man?/*.*
%doc doc/FAQ doc/HACKING doc/HowToCreateDictionary README AUTHORS COPYING TODO
%{_libdir}/bonobo/servers/*
%{_libdir}/stardict
%{_bindir}/*
%{_datadir}/applications/*.desktop
%{_datadir}/idl
%{_datadir}/omf
%{_datadir}/pixmaps/*.png
%{_datadir}/stardict
%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
%endif

%changelog
openSUSE Build Service is sponsored by