%global npm_name playwright Name: nodejs-%{npm_name} Version: 1.56.1 Release: 1%{?dist} Summary: Node library to automate the Chromium, WebKit and Firefox browsers License: MIT AND ISC URL: https://npm.io/package/playwright Source0: https://registry.npmjs.org/%{npm_name}/-/%{npm_name}-%{version}.tgz Source1: %{npm_name}-%{version}-nm-prod.tgz Source2: %{npm_name}-%{version}-nm-dev.tgz Source3: %{npm_name}-%{version}-bundled-licenses.txt BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch Requires: nodejs BuildRequires: nodejs BuildRequires: nodejs-devel %description %{summary}. %prep %setup -q -n package cp %{SOURCE3} . # Setup bundled runtime(prod) node modules tar xfz %{SOURCE1} mkdir -p node_modules pushd node_modules ln -s ../node_modules_prod/* . ln -s ../node_modules_prod/.bin . popd %build #nothing to do %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pr package.json index.js index.mjs jsx-runtime.js jsx-runtime.mjs lib/ \ %{buildroot}%{nodejs_sitelib}/%{npm_name} # Copy over bundled nodejs modules cp -pr node_modules node_modules_prod \ %{buildroot}%{nodejs_sitelib}/%{npm_name} mkdir -p %{buildroot}%{_bindir} ln -sr %{nodejs_sitelib}/playwright/cli.js %{buildroot}%{_bindir}/playwright %check %{__nodejs} -e 'require("./")' # Setup bundled dev node_modules for testing # Note: this cannot be in %%prep or the dev node_modules # can get pulled into the regular rpm tar xfz %{SOURCE2} pushd node_modules ln -s ../node_modules_dev/* . || true popd pushd node_modules/.bin ln -s ../../node_modules_dev/.bin/* . || true popd %files %doc README.md %license LICENSE %{npm_name}-%{version}-bundled-licenses.txt NOTICE ThirdPartyNotices.txt %{nodejs_sitelib}/playwright %{_bindir}/playwright %changelog