Skip to content

Commit

Permalink
add: yt-dlp (#978)
Browse files Browse the repository at this point in the history
* add: yt-dlp

* I forgot about the nightly part

* Update yt-dlp-nightly.spec

Signed-off-by: madomado <[email protected]>

* Update yt-dlp-nightly.spec

Signed-off-by: madomado <[email protected]>

* tests?

Signed-off-by: madomado <[email protected]>

* ??

Signed-off-by: madomado <[email protected]>

* Update yt-dlp-nightly.spec

Signed-off-by: madomado <[email protected]>

* Update yt-dlp-nightly.spec

Signed-off-by: madomado <[email protected]>

* add: conflicts and provides yt-dlp to yt-dlp-nightly.spec

* add provides and conflicts for completions

---------

Signed-off-by: madomado <[email protected]>
Co-authored-by: june-fish <[email protected]>
Co-authored-by: lea <[email protected]>
  • Loading branch information
3 people authored Mar 24, 2024
1 parent 3dd4360 commit 1f44be8
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 0 deletions.
8 changes: 8 additions & 0 deletions anda/tools/yt-dlp/anda.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
project pkg {
rpm {
spec = "yt-dlp-nightly.spec"
}
labels {
nightly = "1"
}
}
8 changes: 8 additions & 0 deletions anda/tools/yt-dlp/update.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if filters.contains("nightly") {
rpm.global("commit", gh_commit("yt-dlp/yt-dlp"));
if rpm.changed() {
rpm.global("ver", gh("yt-dlp/yt-dlp"));
rpm.global("commit_date", date());
rpm.release();
}
}
127 changes: 127 additions & 0 deletions anda/tools/yt-dlp/yt-dlp-nightly.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
#bcond_without tests
%global commit 263a4b55ac17a796e8991ca8d2d86a3c349f8a60
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global commit_date 20240310
%global ver 2023.12.30

Name: yt-dlp-nightly
Version: %ver^%commit_date.%shortcommit
Release: 1%{?dist}
Summary: A command-line program to download videos from online video platforms

License: Unlicense
URL: https://github.com/yt-dlp/yt-dlp
Source: %url/archive/%commit.tar.gz
# License of the specfile
Source: https://src.fedoraproject.org/rpms/yt-dlp/raw/rawhide/f/yt-dlp.spec.license

BuildArch: noarch

BuildRequires: python3-devel

%if %{with tests}
# Needed for %%check
BuildRequires: %{py3_dist pytest}
%endif

# Needed for docs
BuildRequires: pandoc
BuildRequires: make

# ffmpeg-free is now available in Fedora.
Recommends: /usr/bin/ffmpeg
Recommends: /usr/bin/ffprobe

Provides: yt-dlp
Conflicts: yt-dlp

Suggests: python3dist(keyring)

%global _description %{expand:
yt-dlp is a command-line program to download videos from many different online
video platforms, such as youtube.com. The project is a fork of youtube-dl with
additional features and fixes.}

%description %{_description}

%package bash-completion
Summary: Bash completion for yt-dlp
Requires: %{name} = %{version}-%{release}
Requires: bash-completion
Supplements: (%{name} and bash-completion)

Provides: yt-dlp-bash-completion
Conflicts: yt-dlp-bash-completion

%description bash-completion
Bash command line completion support for %{name}.

%package zsh-completion
Summary: Zsh completion for %{name}
Requires: %{name} = %{version}-%{release}
Requires: zsh
Supplements: (%{name} and zsh)

Provides: yt-dlp-zsh-completion
Conflicts: yt-dlp-zsh-completion

%description zsh-completion
Zsh command line completion support for %{name}.

%package fish-completion
Summary: Fish completion for %{name}
Requires: %{name} = %{version}-%{release}
Requires: fish
Supplements: (%{name} and fish)

Provides: yt-dlp-fish-completion
Conflicts: yt-dlp-fish-completion

%description fish-completion
Fish command line completion support for %{name}.

%prep
%autosetup -n yt-dlp-%commit

# Remove unnecessary shebangs
find -type f ! -executable -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{}' +
# Relax version constraints
sed -i 's@"\(requests\|urllib3\|websockets\)>=.*"@"\1"@' pyproject.toml

%generate_buildrequires
%pyproject_buildrequires -r

%build
# Docs and shell completions
make yt-dlp.1 completion-bash completion-zsh completion-fish

# Docs and shell completions are also included in the wheel.
%pyproject_wheel

%install
%pyproject_install
%pyproject_save_files yt_dlp

%check
%if %{with tests}
# See https://github.com/yt-dlp/yt-dlp/blob/master/devscripts/run_tests.sh
%pytest -m 'not download'
%endif

%files -f %{pyproject_files}
%{_bindir}/yt-dlp
%{_mandir}/man1/yt-dlp.1*
%doc README.md
%license LICENSE

%files bash-completion
%{bash_completions_dir}/yt-dlp

%files zsh-completion
%{zsh_completions_dir}/_yt-dlp

%files fish-completion
%{fish_completions_dir}/yt-dlp.fish

%changelog
%autochangelog

0 comments on commit 1f44be8

Please sign in to comment.