File stardict.spec of Package stardict-301

#
# 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
patch0:         sigc++.patch
patch1:         stardict_gcc43.patch
patch2:         stardict_mp3.patch
Requires:       enchant pulseaudio
BuildRequires:  gcc-c++ gnome-common intltool libgnomeui-devel perl-XML-Parser scrollkeeper sgml-skel
BuildRequires:  update-desktop-files
# new in version 3.x: festival and espeak support
BuildRequires:  enchant-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 -p1
%patch1 -p1
%patch2 -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

%build
#autoreconf -fi
%configure \
           --disable-espeak \
           --disable-festival \
           --disable-gnome-support \
           --disable-schemas-install \
           --disable-gucharmap \
           --disable-advertisement \
           --disable-updateinfo
%{__make} %{?jobs:-j%jobs}

%install
%makeinstall
rm -f %{buildroot}%{_libdir}/*.la
#%if 0%{?suse_version} < 1030
#export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
#%endif
#make DESTDIR=$RPM_BUILD_ROOT install
#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