Name:           espeak-ng
Version:        1.51
Release:        1
Summary:        eSpeak NG is an open source speech synthesizer
License:        GPLv3+ and Apache-2.0 and BSD-2-Clause
URL:            https://github.com/espeak-ng/espeak-ng
Source0:        https://github.com/espeak-ng/espeak-ng/archive/%{name}-%{version}.tar.gz
BuildRequires:  make autoconf automake libtool pkgconfig rubygem-ronn-ng rubygem-kramdown pcaudiolib-devel
BuildRequires:  gcc-c++
Provides:       espeak-ng-vim = %{version}-%{release}
Obsoletes:      espeak-ng-vim < %{version}-%{release}

%description
The eSpeak NG is a compact open source software text-to-speech synthesizer for
Linux, Windows, Android and other operating systems. It supports 70 languages
and accents. It is based on the eSpeak engine created by Jonathan Duddington.

%package        devel
Summary:        Development files for espeak-ng
Requires:       espeak-ng = %{version}-%{release}

%description    devel
Development files for espeak-ng.

%package        help
Summary:        Documentation for espeak-ng
BuildArch:      noarch
Requires:       espeak-ng = %{version}-%{release}
Provides:       espeak-ng-doc = %{version}-%{release}
Obsoletes:      espeak-ng-doc < %{version}-%{release}

%description    help
Documentation for espeak-ng.

%prep
%autosetup -n espeak-ng-%{version} -p1
rm -rf src/include/compat/endian.h src/compat/getopt.c android/
%build
./autogen.sh
%configure
%make_build src/espeak-ng src/speak-ng
make
LC_ALL=C.UTF-8 make docs
%install
%make_install
mv %{buildroot}%{_datadir}/vim/addons %{buildroot}%{_datadir}/vim/vimfiles
%check
ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} src/espeak-ng ...
%post
/sbin/ldconfig
%postun
/sbin/ldconfig

%files
%doc COPYING COPYING.APACHE COPYING.BSD2 README.md CHANGELOG.md
%{_bindir}/{speak-ng,espeak-ng}
%{_libdir}/libespeak-ng.so.*
%{_datadir}/espeak-ng-data
%{_datadir}/vim/vimfiles/ftdetect/espeakfiletype.vim
%{_datadir}/vim/vimfiles/syntax/{espeaklist.vim,espeakrules.vim}
%exclude %{_bindir}/{speak,espeak}
%exclude %{_datadir}/vim/registry

%files devel
%{_libdir}/pkgconfig/espeak-ng.pc
%{_libdir}/libespeak-ng.so
%{_includedir}/espeak-ng
%exclude %{_libdir}/libespeak-ng-test.so*
%exclude %{_libdir}/*.{a,la}
%exclude %{_includedir}/espeak

%files help
%doc docs/*.html
%{_mandir}/man1/{speak-ng.1.gz,espeak-ng.1.gz}

%changelog
* Thu Oct 19 2023 Ge Wang <wang__ge@126.com> - 1.51-1
- Update to version 1.51

* Tue Aug 03 2021 liping <liping136@huawei.com> - 1.49.2-7
- fix by upgrade to GCC-10

* Sun Feb 07 2020 huanghaitao <huanghaitao8@huawei.com> - 1.49.2-6
- Swith rubygem-ronn-ng to drop rubygem-ronn

* Tue Dec 03 2019 Ling Yang <lingyang2@huawei.com> - 1.49.2-5
- Package init
