Files
python-streamlink/python-streamlink.spec
2025-12-14 14:11:57 -05:00

151 lines
4.8 KiB
RPMSpec

#
# spec file for package python-streamlink
#
# Copyright (c) 2025 SUSE LLC
#
# 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/
#
%define skip_python311 1
%define skip_python312 1
%define base_name streamlink
# Account for oddity where .0 in X.Y.0 is dropped
%define version_end_digit %(echo %{version} | awk -F. '{print $NF}')
Name: python-streamlink
Version: 8.1.0
Release: 0
Summary: Streamlink is a CLI tool to extract streams from various services
License: BSD-2-Clause
URL: https://github.com/streamlink/streamlink
Source0: https://files.pythonhosted.org/packages/source/s/streamlink/streamlink-%{version}.tar.gz
BuildRequires: python-rpm-macros
BuildRequires: %{python_module PySocks}
BuildRequires: %{python_module importlib-metadata}
BuildRequires: %{python_module isodate}
BuildRequires: %{python_module lxml}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pycountry}
BuildRequires: %{python_module pycryptodome}
BuildRequires: %{python_module requests}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module tomli}
BuildRequires: %{python_module versioningit}
BuildRequires: %{python_module websocket-client}
BuildRequires: fdupes
Requires: python3-PySocks
Requires: python3-certifi
Requires: python3-isodate
Requires: python3-lxml
Requires: python3-pycountry
Requires: python3-pycryptodome
Requires: python3-requests
Requires: python3-trio
Requires: python3-trio-websocket
Requires: python3-urllib3
Requires: python3-websocket-client
Requires(post): update-alternatives
Requires(postun): update-alternatives
Recommends: python-streamlink-manpage
BuildArch: noarch
#%%if %%{version_end_digit} == 0
#Provides: python3dist(streamlink) = %%{version}
#%%endif
%python_subpackages
%description
Streamlink is a command-line utility that extracts streams from various services and pipes them into a video player of choice.
%package -n %{name}-bash-completion
Summary: Bash Completion for %{name}
#Requires: python3dist(streamlink) = %%{version}
Requires: python3-streamlink
Requires: bash-completion
Supplements: (python3-streamlink and bash)
BuildArch: noarch
%description -n %{name}-bash-completion
Tab completion with bash shell for %{name}.
%package -n %{name}-zsh-completion
Summary: Zsh Completion for %{name}
#Requires: python3dist(streamlink) = %%{version}
Requires: python3-streamlink
Requires: zsh
Supplements: (python3-streamlink and zsh)
BuildArch: noarch
%description -n %{name}-zsh-completion
Tab completion with zsh shell for %{name}.
%package -n %{name}-manpage
Summary: Manpage for %{name}
#Provides: python39-streamlink-manpage
#Provides: python310-streamlink-manpage
Provides: python311-streamlink-manpage
Provides: python312-streamlink-manpage
Provides: python313-streamlink-manpage
#Requires: python3dist(streamlink) = %%{version}
Requires: python3-streamlink
Requires: man
Supplements: (python3-streamlink and man)
BuildArch: noarch
%description -n %{name}-manpage
Manual page for %{name}.
%prep
%setup -q -n streamlink-%{version}
%build
#%%python_build
%pyproject_wheel
%install
#%%python_install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/streamlink
install -m 644 -D completions/bash/streamlink %{buildroot}%{_datadir}/bash-completion/completions/streamlink
install -m 644 -D completions/zsh/_streamlink %{buildroot}%{_datadir}/zsh/site-functions/_streamlink
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%post
%python_install_alternative streamlink
%postun
%python_uninstall_alternative streamlink
%files %{python_files}
%doc AUTHORS CHANGELOG.md README.md
%license LICENSE
%python_alternative %{_bindir}/streamlink
%{python_sitelib}/%{base_name}*
%files -n %{name}-bash-completion
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/streamlink
%files -n %{name}-zsh-completion
%dir %{_datadir}/zsh
%dir %{_datadir}/zsh/site-functions
%{_datadir}/zsh/site-functions/_streamlink
%files -n %{name}-manpage
%doc %{_mandir}/man1/streamlink.1.gz
%changelog