# 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} # Set up dependency generator for bundled(npm()) Provides %define _local_file_attrs node_deps %define __node_deps_provides %{S:4} %{_builddir}/%{buildsubdir}/package-lock.json %define __node_deps_path ^%{python3_sitelib}/yt_dlp_ejs$ # 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 # Generated by go-vendor-tools License: Unlicense AND ISC AND MIT URL: https://github.com/yt-dlp/ejs Source0: %{url}/archive/%{ref}/yt-dlp-ejs-%{ref}.tar.gz # npm vendor archive Source1: yt-dlp-ejs-%{ref}-vendor.tar.bz2 # Configuration for go-vendor-tools and bundle.py Source2: vendor.toml # Script for creating npm vendor archive Source3: bundle.py # Used by the local node_deps Provides generator Source4: node_deps_provides.py BuildArch: noarch BuildRequires: python3-devel BuildRequires: /usr/bin/esbuild # Go Vendor Tools' license scanning feature is designed to be flexible, so it's # usable for node also! BuildRequires: go-vendor-tools %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 %go_vendor_license_buildrequires -c %{S:2} %build export EJS_BUILD_SKIP_INSTALL=1 export SETUPTOOLS_SCM_PRETEND_VERSION=%{pyver} %pyproject_wheel %install %pyproject_install %pyproject_save_files yt_dlp_ejs %go_vendor_license_install -c %{S:2} -M %check %pyproject_check_import %go_vendor_license_check -c %{S:2} %files -n python3-yt-dlp-ejs -f %{pyproject_files} -f %{go_vendor_license_filelist} %doc README.md %changelog %autochangelog