%global npm_name unleash-proxy-client Name: nodejs-unleash-proxy-client Version: 3.8.2 Release: 1%{?dist} Summary: A browser client that can be used together with Unleash Edge or the Unleash Frontend API License: Apache-2.0 Group: Development/Libraries URL: https://github.com/unleash/unleash-js-sdk#readme Source0: https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz Source1: https://registry.npmjs.org/unleash-proxy-client/-/unleash-proxy-client-3.8.2.tgz Source2: nodejs-unleash-proxy-client-%{version}-package-lock.json BuildRequires: npm >= 7 BuildRequires: nodejs-packaging # The prep section runs node directly, so this is needed unconditionally. It # also works around https://issues.redhat.com/browse/RHEL-137712 on RHEL 10 # before 10.3, where the nodejs major version macro does not resolve without # node in the buildroot. BuildRequires: /usr/bin/node BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch Provides: npm(%{npm_name}) = %{version} Provides: bundled(npm(tiny-emitter)) = 2.1.0 Provides: bundled(npm(unleash-proxy-client)) = 3.8.2 AutoReq: no AutoProv: no %define npm_cache_dir npm_cache_%{name}-%{version}-%{release} %description %{summary} %prep # There is deliberately no setup section: every Source is consumed explicitly # below, so the build runs in the top-level build directory. Do not name the # setup macro here even in a comment - rpm expands macros inside comments, and # on rpm 6 that runs it, unpacking Source0 and cd-ing into a directory that # does not exist. mkdir -p %{npm_cache_dir} # npm ci installs the tree recorded in the lockfile: every entry carries a # resolved URL and an integrity hash, and npm serves the tarballs from the # cache primed here by content hash. No registry access is needed. for src in %{sources}; do case "$src" in *.tgz) npm cache add --cache %{npm_cache_dir} "$src" ;; *-package-lock.json) cp "$src" package-lock.json ;; *) echo "unexpected Source, do not know how to handle it: $src" >&2; exit 1 ;; esac done # Derive package.json from the lockfile so the two cannot disagree. node -e ' const fs = require("fs"); const lock = JSON.parse(fs.readFileSync("package-lock.json")); fs.writeFileSync("package.json", JSON.stringify({ name: lock.name, version: lock.version, dependencies: lock.packages[""].dependencies }, null, 2) + "\n"); ' %build npm ci --legacy-peer-deps --offline --cache %{_builddir}/%{npm_cache_dir} --omit optional %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pfr node_modules/%{npm_name}/node_modules %{buildroot}%{nodejs_sitelib}/%{npm_name} # npm creates a scope directory for every scope named in the lockfile, including # scopes whose packages were all omitted, which leaves empty dirs behind. # -delete implies -depth, so nested empties go bottom-up in a single pass. find %{buildroot}%{nodejs_sitelib}/%{npm_name} -type d -empty -delete cp -pfr node_modules/%{npm_name}/build %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pfr node_modules/%{npm_name}/examples %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pfr node_modules/%{npm_name}/package.json %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pfr node_modules/%{npm_name}/src %{buildroot}%{nodejs_sitelib}/%{npm_name} %clean rm -rf %{buildroot} %{npm_cache_dir} %files %{nodejs_sitelib}/%{npm_name} %license node_modules/%{npm_name}/LICENSE %doc node_modules/%{npm_name}/README.md %changelog * Thu Aug 06 2026 Foreman Packaging Automation 3.8.2-1 - Update to 3.8.2 * Thu Jul 30 2026 Zach Huntington-Meath - 3.8.0-2 - Regenerate with correct npm2rpm strategy * Thu Jul 30 2026 Zach Huntington-Meath 3.8.0-1 - Update to 3.8.0 * Thu Jul 30 2026 Zach Huntington-Meath 3.8.0-2 - Update to 3.8.0 * Wed Apr 29 2026 Foreman Packaging Automation 3.8.0-1 - Update to 3.8.0 * Wed Aug 06 2025 Foreman Packaging Automation 3.7.8-1 - Update to 3.7.8 * Sun Aug 03 2025 Foreman Packaging Automation 3.7.7-1 - Update to 3.7.7 * Wed Jul 09 2025 root 3.7.6-1 - Add nodejs-unleash-proxy-client generated by npm2rpm using the bundle strategy