From 4ba09a3eca397bed485793fa739ed73392ea5ac7ede730c44ef9be0b56bf64f5 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 25 Oct 2023 04:05:29 +0000 Subject: [PATCH 1/4] - Rework Python build procedure [boo#1216467] OBS-URL: https://build.opensuse.org/package/show/network:utilities/yt-dlp?expand=0&rev=72 --- yt-dlp.changes | 5 ++++ yt-dlp.spec | 62 ++++++++++++-------------------------------------- 2 files changed, 19 insertions(+), 48 deletions(-) diff --git a/yt-dlp.changes b/yt-dlp.changes index 93a4319..a7ee08a 100644 --- a/yt-dlp.changes +++ b/yt-dlp.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Oct 25 03:06:38 UTC 2023 - Jan Engelhardt + +- Rework Python build procedure [boo#1216467] + ------------------------------------------------------------------- Sun Oct 22 22:36:58 UTC 2023 - Jan Engelhardt diff --git a/yt-dlp.spec b/yt-dlp.spec index 766f200..594ece0 100644 --- a/yt-dlp.spec +++ b/yt-dlp.spec @@ -24,42 +24,21 @@ License: CC-BY-SA-3.0 AND SUSE-Public-Domain Group: Productivity/Networking/Web/Utilities URL: https://github.com/yt-dlp/yt-dlp Source: https://github.com/yt-dlp/yt-dlp/releases/download/%version/yt-dlp.tar.gz +BuildRequires: %{python_module setuptools} BuildRequires: make >= 4 -%if 0%{?suse_version} > 1500 -BuildRequires: python3-devel >= 3.8 -%else -%if 0%{?sle_version} > 150400 -BuildRequires: python311-devel -%else -%if 0%{?sle_version} > 150300 -BuildRequires: python310-devel -%else -BuildRequires: python39-devel -%endif -%endif -%endif +BuildRequires: python-rpm-macros BuildRequires: zip BuildArch: noarch Requires: ffmpeg -BuildRequires: %{python_module setuptools} %if 0%{?suse_version} > 1500 Requires: python3 >= 3.8 -Suggests: python3-Brotli -Suggests: python3-certifi -Suggests: python3-mutagen -Suggests: python3-pycryptodomex -Suggests: python3-websockets -%else -%if 0%{?sle_version} > 150400 -Requires: python311 -%else -%if 0%{?sle_version} > 150300 -Requires: python310 -%else -Requires: python39 -%endif -%endif %endif +Requires: python3-yt-dlp +Suggests: %{python_module Brotli} +Suggests: %{python_module certifi} +Suggests: %{python_module mutagen} +Suggests: %{python_module pycryptodomex} +Suggests: %{python_module websockets} %python_subpackages %description @@ -105,28 +84,15 @@ The direct Python interface into yt-dlp. %build rm -f youtube-dl yt-dlp -%if 0%{?suse_version} > 1500 -PYTHON="%_bindir/python3" \ -%else -%if 0%{?sle_version} > 150400 -PYTHON="%_bindir/python3.11" \ -%else -%if 0%{?sle_version} > 150300 -PYTHON="%_bindir/python3.10" \ -%else -PYTHON="%_bindir/python3.9" \ -%endif -%endif -%endif - %make_build yt-dlp +# +# A self-decompressing yt-dlp is built only when python_build is not +# exercised; else yt-dlp is a loader. +# +%python_build +%make_build yt-dlp %install b="%buildroot" -install -Dvm0755 yt-dlp "$b/%_bindir/yt-dlp" -install -Dvm0644 completions/bash/yt-dlp "$b/%_datadir/bash-completion/completions/yt-dlp" -install -Dvm0644 completions/zsh/_yt-dlp "$b/%_datadir/zsh/site-functions/_yt-dlp" -install -Dvm0644 completions/fish/yt-dlp.fish "$b/%_datadir/fish/completions/yt-dlp.fish" -install -Dvm0644 yt-dlp.1 "$b/%_mandir/man1/yt-dlp.1" %python_install rm -Rf "$b/%_datadir/doc" From 1dd25f58f945639a7be1760cadd42f970946af51a4d3b005eb90bcfc69cbe9e1 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 25 Oct 2023 04:46:46 +0000 Subject: [PATCH 2/4] +incantations for Leap OBS-URL: https://build.opensuse.org/package/show/network:utilities/yt-dlp?expand=0&rev=73 --- yt-dlp.spec | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/yt-dlp.spec b/yt-dlp.spec index 594ece0..1fbe323 100644 --- a/yt-dlp.spec +++ b/yt-dlp.spec @@ -16,6 +16,10 @@ # +%define skip_python2 1 +%define skip_python36 1 +%define skip_python37 1 +%sle15_python_module_pythons Name: yt-dlp Version: 2023.10.13 Release: 0 @@ -25,20 +29,18 @@ Group: Productivity/Networking/Web/Utilities URL: https://github.com/yt-dlp/yt-dlp Source: https://github.com/yt-dlp/yt-dlp/releases/download/%version/yt-dlp.tar.gz BuildRequires: %{python_module setuptools} +BuildRequires: fdupes BuildRequires: make >= 4 BuildRequires: python-rpm-macros BuildRequires: zip BuildArch: noarch Requires: ffmpeg -%if 0%{?suse_version} > 1500 -Requires: python3 >= 3.8 -%endif -Requires: python3-yt-dlp -Suggests: %{python_module Brotli} -Suggests: %{python_module certifi} -Suggests: %{python_module mutagen} -Suggests: %{python_module pycryptodomex} -Suggests: %{python_module websockets} +Requires: python-yt-dlp +Suggests: python-Brotli +Suggests: python-certifi +Suggests: python-mutagen +Suggests: python-pycryptodomex +Suggests: python-websockets %python_subpackages %description @@ -94,6 +96,7 @@ rm -f youtube-dl yt-dlp %install b="%buildroot" %python_install +%fdupes %buildroot/usr rm -Rf "$b/%_datadir/doc" %files -n yt-dlp From d1f9ebcf78eed1264b3a832ba69df640bacc09f3475568472ad5d3acaac098c0 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 25 Oct 2023 05:17:16 +0000 Subject: [PATCH 3/4] OBS-URL: https://build.opensuse.org/package/show/network:utilities/yt-dlp?expand=0&rev=74 --- yt-dlp.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt-dlp.spec b/yt-dlp.spec index 1fbe323..e7c022d 100644 --- a/yt-dlp.spec +++ b/yt-dlp.spec @@ -19,7 +19,7 @@ %define skip_python2 1 %define skip_python36 1 %define skip_python37 1 -%sle15_python_module_pythons +%{?sle15_python_module_pythons} Name: yt-dlp Version: 2023.10.13 Release: 0 From c0be150265e4950408319b642b79f0c39f6b34884a8a6eec820cdf574f57651d Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 25 Oct 2023 05:22:30 +0000 Subject: [PATCH 4/4] OBS-URL: https://build.opensuse.org/package/show/network:utilities/yt-dlp?expand=0&rev=75 --- yt-dlp.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt-dlp.spec b/yt-dlp.spec index e7c022d..9e71869 100644 --- a/yt-dlp.spec +++ b/yt-dlp.spec @@ -35,7 +35,7 @@ BuildRequires: python-rpm-macros BuildRequires: zip BuildArch: noarch Requires: ffmpeg -Requires: python-yt-dlp +Requires: python3-yt-dlp Suggests: python-Brotli Suggests: python-certifi Suggests: python-mutagen