%global pypi_name pywhispercpp %global forgeurl https://github.com/absadiki/pywhispercpp Name: python-%{pypi_name} Version: 1.3.3 Release: 1%{?dist} Summary: Python bindings for whisper.cpp with a simple Pythonic API License: MIT URL: %{forgeurl} Source0: %{pypi_source} # Architecture-specific due to C/C++ extensions BuildRequires: gcc BuildRequires: cmake BuildRequires: ninja-build BuildRequires: gcc-c++ BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-wheel BuildRequires: python3-pip BuildRequires: auditwheel BuildRequires: chrpath # For building from source with whisper.cpp BuildRequires: git-core %global _description %{expand: pywhispercpp provides Python bindings for whisper.cpp with a simple Pythonic API on top of it. It allows you to use OpenAI's Whisper speech recognition model with the performance benefits of the C++ implementation. The package supports various acceleration backends including CUDA, CoreML, Vulkan, OpenBLAS, and OpenVINO.} %description %{_description} %package -n python3-%{pypi_name} Summary: %{summary} # ffmpeg is needed for transcribing files other than wav Recommends: ffmpeg %description -n python3-%{pypi_name} %{_description} %package -n python3-%{pypi_name}+examples Summary: Extra dependencies for %{name} examples Requires: python3-%{pypi_name} = %{version}-%{release} %description -n python3-%{pypi_name}+examples This package installs extra dependencies needed to run the examples included with pywhispercpp. %package -n python3-%{pypi_name}+gui Summary: GUI support for %{name} Requires: python3-%{pypi_name} = %{version}-%{release} Requires: python3-qt5 %description -n python3-%{pypi_name}+gui This package provides GUI support for pywhispercpp using PyQt5. It provides the pwcpp-gui command for a graphical interface. %prep %autosetup -p1 -n %{pypi_name}-%{version} # Remove any pre-compiled Cython files if present #find . -name '*.c' -o -name '*.cpp' | grep -v whisper.cpp | xargs rm -f 2>/dev/null || true %build # Build with basic CPU support (default) # Users can rebuild with GGML_CUDA=1, WHISPER_COREML=1, etc. for hardware acceleration export NO_REPAIR=1 #export LDFLAGS="%{build_ldflags} -Wl,--disable-new-dtags -Wl,--remove-rpath" %pyproject_wheel %install %pyproject_install %pyproject_save_files %{pypi_name} _pywhispercpp find %{buildroot}%{python3_sitearch} -type f \( -name "*.so" -o -name "*.so.*" \) -exec chrpath --delete {} \; || : %check # Basic smoke test - import the module %{python3} -c "import pywhispercpp; import _pywhispercpp" %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.md %{_bindir}/pwcpp %{_bindir}/pwcpp-assistant %files -n python3-%{pypi_name}+examples # This is a metapackage, files are tracked via dependencies %files -n python3-%{pypi_name}+gui %{_bindir}/pwcpp-gui %changelog * Mon Nov 17 2025 Package Maintainer - 1.3.3-1 - Initial import