File piper-phonemize.spec of Package piper-phonemize

#
# spec file for package piper-phenomize
#
# Copyright (c) 2024 Andreas Schneider
#
# 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 https://bugs.opensuse.org/
#

%global piper_version 2023.11.14
%global piper_extra_version 4

%global api_version 1

Name:           piper-phonemize
Version:        %{piper_version}.0%{?piper_extra-version}
Release:        0
Summary:        A tool to convert text to phonemes for Piper TTS
License:        MIT
URL:            https://github.com/rhasspy/piper-phonemize/
Source:         %{url}/archive/refs/tags/%{piper_version}-%{piper_extra_version}/%{name}-%{piper_version}-%{piper_extra_version}.tar.gz
# Backport from https://github.com/rhasspy/piper-phonemize/pull/31
Patch0:         piper-phonemize-cmake.patch
BuildRequires:  cmake
BuildRequires:  espeak-ng-devel
BuildRequires:  gcc-c++
BuildRequires:  onnxruntime-devel

%description
A tool to convert text to phonemes for Piper TTS.

%package -n libpiper-phonemize%{api_version}
Summary:        C++ library for converting text to phonemes for Piper TTS

%description -n libpiper-phonemize%{api_version}
The Piper phonemization library is a C++ library for converting text to
phonemes for Piper TTS.

%package -n libpiper-phonemize-devel
Summary:        Development files for libpiper-phonemize
Requires:       libpiper-phonemize%{api_version} = %{version}

%description -n libpiper-phonemize-devel
Development files for The piper-phonemize library.

%prep
%autosetup -p1 -n %{name}-%{piper_version}-%{piper_extra_version}

%build
%cmake
%cmake_build

%install
%cmake_install

%post -n libpiper-phonemize%{api_version} -p /sbin/ldconfig
%postun -n libpiper-phonemize%{api_version} -p /sbin/ldconfig

%files
%{_bindir}/piper_phonemize

%files -n libpiper-phonemize%{api_version}
%license LICENSE.md
%doc README.md
%{_libdir}/libpiper_phonemize.so.*
%{_datadir}/%{name}

%files -n libpiper-phonemize-devel
%{_libdir}/libpiper_phonemize.so
%{_libdir}/cmake/piper_phonemize
%{_includedir}/%{name}

%changelog

openSUSE Build Service is sponsored by