File yt-dlp.spec of Package yt-dlp
134
1
#
2
# spec file for package yt-dlp
3
#
4
# Copyright (c) 2025 SUSE LLC
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via https://bugs.opensuse.org/
16
#
17
18
19
%define skip_python2 1
20
%define skip_python36 1
21
%define skip_python37 1
22
# For SLE-15-SP4, this would otherwise build against
23
# python3.6, which is not supported any more.
24
%if 0%{?sle_version} == 150400
25
#%%define skip_python3 1
26
%global pythons python310
27
%else
28
%if 0%{?suse_version} < 1600
29
%global pythons python312
30
%else
31
%{?sle15_python_module_pythons}
32
%endif
33
%endif
34
Name: yt-dlp
35
Version: 2025.02.19
36
Release: 0
37
Summary: Enhanced fork of youtube-dl, a video site downloader for offline watching
38
License: CC-BY-SA-3.0 AND SUSE-Public-Domain
39
Group: Productivity/Networking/Web/Utilities
40
URL: https://github.com/yt-dlp/yt-dlp
41
Source: https://github.com/yt-dlp/yt-dlp/releases/download/%version/yt-dlp.tar.gz
42
Source9: yt-dlp-rpmlintrc
43
BuildRequires: %{python_module hatchling}
44
BuildRequires: %{python_module pip}
45
BuildRequires: fdupes
46
BuildRequires: make >= 4
47
BuildRequires: python-rpm-macros
48
BuildRequires: zip
49
BuildArch: noarch
50
Obsoletes: yt-dlp-bash-completion < %version-%release
51
Provides: yt-dlp-bash-completion = %version-%release
52
Obsoletes: yt-dlp-fish-completion < %version-%release
53
Provides: yt-dlp-fish-completion = %version-%release
54
Obsoletes: yt-dlp-zsh-completion < %version-%release
55
Provides: yt-dlp-zsh-completion = %version-%release
56
%if 0%{?suse_version} < 1600
57
Requires: python312-yt-dlp = %version
58
%else
59
Requires: python3-yt-dlp = %version
60
%endif
61
%define python_subpackage_only 1
62
%python_subpackages
63
64
%description
65
yt-dlp is a command-line program to retrieve videos from
66
YouTube.com and other video sites for later watching.
67
68
%package -n yt-dlp-youtube-dl
69
Summary: Compat symlinks for youtube-dl
70
Requires: yt-dlp
71
Provides: youtube-dl
72
Conflicts: youtube-dl
73
74
%description -n yt-dlp-youtube-dl
75
This package installs "youtube-dl" as a symlink to yt-dlp.
76
77
%package -n python-yt-dlp
78
Summary: yt-dlp Python library
79
Group: Development/Languages/Python
80
Requires: ffmpeg
81
Suggests: python-Brotli
82
Suggests: python-certifi
83
Suggests: python-mutagen
84
Suggests: python-pycryptodomex
85
Suggests: python-websockets
86
87
%description -n python-yt-dlp
88
The direct Python interface into yt-dlp.
89
90
%prep
91
%autosetup -p1 -n %name
92
93
%build
94
rm -f youtube-dl yt-dlp
95
#
96
# A self-decompressing yt-dlp is built only when python_build is not
97
# exercised; else yt-dlp is a loader.
98
#
99
%pyproject_wheel
100
%make_build yt-dlp
101
102
%install
103
b="%buildroot"
104
%pyproject_install
105
ln -s yt-dlp "$b/%_bindir/youtube-dl"
106
rm -Rf "$b/%_datadir/doc"
107
# if you leave everything as-is, rpmlint complains about
108
# python312-yt-dlp.noarch: W: files-duplicate
109
# /usr/lib/python3.12/site-packages/yt_dlp/utils/__pycache__/progress.cpython-312.pyc
110
# /usr/lib/python3.12/site-packages/yt_dlp/utils/__pycache__/progress.cpython-312.opt-1.pyc
111
# if you add fdupes, rpmlint complains about
112
# python312-yt-dlp.noarch: E: python-bytecode-inconsistent-mtime
113
# /usr/lib/python3.12/site-packages/yt_dlp/extractor/__pycache__/screencastomatic.cpython-312.pyc
114
# 2024-09-29T18:11:02
115
# /usr/lib/python3.12/site-packages/yt_dlp/extractor/screencastomatic.py
116
# 2024-09-29T18:11:01
117
118
%files -n yt-dlp
119
%license LICENSE
120
%doc README.md
121
%_bindir/%name
122
%_mandir/man1/%name.1%ext_man
123
%_datadir/bash-completion/
124
%_datadir/fish/
125
%_datadir/zsh/
126
127
%files -n yt-dlp-youtube-dl
128
%_bindir/youtube-dl
129
130
%files %{python_files yt-dlp}
131
%python_sitelib/y*
132
133
%changelog
134