File espeak.spec of Package espeak

#
# spec file for package espeak
#
# 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/
#



Name:           espeak
Version:        1.43.03
Release:        7
%define _version %{version}-source
License:        GPLv3+
Summary:        Software speech synthesizer (text-to-speech)
Url:            http://espeak.sourceforge.net
Group:          Productivity/Other
Source:         %{name}-%{_version}.tar.bz2
Source1:        espeak.1
# PATCH-FIX-UPSTREAM espeak-audio-runtime-detection.patch vuntz@opensuse.org -- Taken from Fedora
Patch0:         espeak-audio-runtime-detection.patch
# PATCH-FIX-SUSE espeak-volume-full-fix.diff tiwai@suse.de -- Fix full-volume with PulseAudio (bnc#679975)
Patch1:         espeak-volume-full-fix.diff
BuildRequires:  gcc-c++
BuildRequires:  portaudio-devel
BuildRequires:  pulseaudio-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
eSpeak is a compact open source software speech synthesizer for English
and other languages.

eSpeak uses a "formant synthesis" method. This allows many languages to
be provided in a small size. The speech is clear, and can be used at
high speeds, but is not as natural or smooth as larger synthesizers
which are based on human speech recordings.

%package devel
License:        GPLv3+
Summary:        Software speech synthesizer (text-to-speech) -- Development Files
Group:          Productivity/Other
Requires:       espeak

%description devel
eSpeak is a compact open source software speech synthesizer for English
and other languages.

eSpeak uses a "formant synthesis" method. This allows many languages to
be provided in a small size. The speech is clear, and can be used at
high speeds, but is not as natural or smooth as larger synthesizers
which are based on human speech recordings.

%prep
%setup -q -n %{name}-%{_version}
%patch0 -p1
%patch1 -p1
# Don't use the included binary voice dictionaries; we compile these from
# source
%{__rm} espeak-data/*_dict
# Build against portaudio v19 (see ReadMe)
%{__cp} -f src/portaudio19.h src/portaudio.h

%build
cd src
make %{?_smp_mflags} CFLAGS="%{optflags}"
cd ..
# Build the TTS voice dictionaries
export ESPEAK_DATA_PATH=%{_builddir}/%{name}-%{_version}
cd dictsource
for voice in $(../src/speak --voices | awk '{print $2}{print $5}' | egrep -v Language\|File\|/ | uniq); do
    ../src/speak --compile=$voice;
done

%install
cd src
make LIBDIR=%{_libdir} DESTDIR=%{buildroot} install
cd ..
# Remove static libraries
%{__rm} %{buildroot}%{_libdir}/*.a
# Install manpage
%{__install} -D -m 0644 %{SOURCE1} %{buildroot}%{_mandir}/man1/espeak.1
# Rename docs subdir for installation with %doc
%{__mv} docs/ html/

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr (-,root,root,755)
%doc ChangeLog License.txt ReadMe html/
%{_bindir}/espeak
%{_libdir}/libespeak.so.*
%{_datadir}/espeak-data/
%doc %{_mandir}/man1/espeak.1.*

%files devel
%defattr (-,root,root,755)
%{_includedir}/espeak/
%{_libdir}/libespeak.so

%changelog
openSUSE Build Service is sponsored by