# Copyright (C) 2026 Maxwell G # Copyright (C) Fedora Project Authors # SPDX-License-Identifier: MIT # Set these macros when packaging a commit snapshot. # Comment them out otherwise. # NOTE(gotmax23): We are packaging a git snapshot because upstream has made # some build system changes on main, and I don't want to have to adapt the # packaging a second time. %global commit d60b8244e704cecec53aa908c31a901441d2945c %global date 20260524 # Helper macros. Use %%define for lazy-expansion. # # Snapshot version %define snap %{?commit:^%date.%{sub %commit 1 7}} # Git ref %define ref %{?commit}%{?!commit:%version} # Python-formatted version %define pyver %{basever} # This is a python packaged that ships Javascript assets. # Since we are building it like a Python package with the pyproject macros, # we follow the Python Naming Guidelines. Name: python-yt-dlp-ejs %global basever 0.8.0 Version: %{basever}%{snap} Release: %autorelease Summary: External JavaScript for yt-dlp # meriyah: ISC # astring: MIT License: Unlicense AND ISC AND MIT URL: https://github.com/yt-dlp/ejs Source0: %{url}/archive/%{ref}/yt-dlp-ejs-%{ref}.tar.gz Source1: yt-dlp-ejs-%{ref}-vendor.tar.bz2 # Script and config for creating npm vendor archive Source2: vendor.toml Source3: bundle.py BuildArch: noarch BuildRequires: python3-devel BuildRequires: /usr/bin/esbuild %description %{summary}. %package -n python3-yt-dlp-ejs Summary: %{summary} Requires: /usr/bin/node %description -n python3-yt-dlp-ejs %{summary}. %prep %autosetup -C -p1 tar -xf %{S:1} %generate_buildrequires export SETUPTOOLS_SCM_PRETEND_VERSION=%{pyver} %pyproject_buildrequires %build export EJS_BUILD_SKIP_INSTALL=1 export SETUPTOOLS_SCM_PRETEND_VERSION=%{pyver} %pyproject_wheel %install %pyproject_install %pyproject_save_files yt_dlp_ejs --assert-license %check %pyproject_check_import %files -n python3-yt-dlp-ejs -f %{pyproject_files} %doc README.md %license node_modules/astring/LICENSE %license node_modules/meriyah/LICENSE.md %changelog %autochangelog