File espeak-gui.spec of Package espeak-gui

#
# spec file for package espeak-gui
#
# Copyright (c) 2012 Malcolm J Lewis <malcolmlewis@opensuse.org>
#
# 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/
#

Name:           espeak-gui
Version:        0.4
Release:        0
License:        GPL-3.0+
Summary:        Graphical User Interface for eSpeak
Url:            https://launchpad.net/espeak-gui
Group:          Productivity/Multimedia/Sound/Utilities
Source0:        http://launchpad.net/espeak-gui/trunk/0.4/+download/%{name}-%{version}.tar.gz
BuildRequires:  fdupes
BuildRequires:  gconf2-devel
BuildRequires:  intltool
BuildRequires:  python-distutils-extra
BuildRequires:  update-desktop-files
Requires:       python-espeak
Requires:       python-gconf
Requires:       python-gtk
Requires:       python-gtksourceview
Requires:       python-gtkspell
Requires:       python-xdg
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version}
%gconf_schemas_requires
%py_requires
%if 0%{?suse_version} > 1110
BuildArch:      noarch
%endif
%endif
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}

%description
espeak-gui provides a simple graphical user interface for the eSpeak
speech synthesizer.

%lang_package
%prep
%setup -q

%build
python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
# Fix for gconf schemas that are not correctly installed (lp#954884)
mkdir -p %{buildroot}%{_sysconfdir}/gconf/schemas/
mv %{buildroot}%{_datadir}/gconf/schemas/espeak-gui.schemas %{buildroot}%{_sysconfdir}/gconf/schemas
# Fix for installing man page (lp#921148)
test ! -f %{buildroot}%{_mandir}/man1/%{name}.1
install -D -m0644 extra/%{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
%suse_update_desktop_file %{name} Player
%find_lang %{name} %{?no_lang_C}
%find_gconf_schemas
%fdupes %{buildroot}

%if 0%{?suse_version} > 1130

%post
%desktop_database_post
%endif

%if 0%{?suse_version} > 1130

%postun
%desktop_database_postun
%endif

%pre -f %{name}.schemas_pre

%preun -f %{name}.schemas_preun

%posttrans -f %{name}.schemas_posttrans

%files -f %{name}.schemas_list
%defattr(-,root,root)
%doc AUTHORS COPYING NEWS README
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/%{name}/
%{_mandir}/man1/%{name}.1%{?ext_man}
%{_datadir}/pixmaps/%{name}.png
# Version is wrong, see lp#954873
%{python_sitelib}/espeak_gui-0.3-py%{py_ver}.egg-info

%files lang -f %{name}.lang

%changelog
openSUSE Build Service is sponsored by