%{?scl:%scl_package nodejs-%{npm_name}} %{!?scl:%global pkg_name %{name}} %global npm_name bbgurl Name: %{?scl_prefix}nodejs-bbgurl Version: 2.1.4 Release: 1%{?dist} Summary: a cli http client using undici License: MIT Group: Development/Libraries URL: https://github.com/jfhbrook/public#readme Source0: https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz Source1: https://registry.npmjs.org/bbgurl/-/bbgurl-2.1.4.tgz Source2: https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz Source3: https://registry.npmjs.org/progress/-/progress-2.0.3.tgz Source4: https://registry.npmjs.org/stream-progressbar/-/stream-progressbar-1.4.0.tgz Source5: https://registry.npmjs.org/undici/-/undici-4.16.0.tgz Source6: nodejs-bbgurl-%{version}-registry.npmjs.org.tgz BuildRequires: nodejs-npm %if 0%{!?scl:1} BuildRequires: nodejs-packaging %endif BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch Provides: %{?scl_prefix}npm(%{npm_name}) = %{version} Provides: bundled(npm(ansi-colors)) = 4.1.3 Provides: bundled(npm(bbgurl)) = 2.1.4 Provides: bundled(npm(minimist)) = 1.2.8 Provides: bundled(npm(progress)) = 2.0.3 Provides: bundled(npm(stream-progressbar)) = 1.4.0 Provides: bundled(npm(undici)) = 4.16.0 AutoReq: no AutoProv: no %if 0%{?scl:1} %define npm_cache_dir npm_cache %else %define npm_cache_dir /tmp/npm_cache_%{name}-%{version}-%{release} %endif %description %{summary} %prep mkdir -p %{npm_cache_dir} %{?scl:scl enable %{?scl_nodejs} - << \end_of_scl} for tgz in %{sources}; do echo $tgz | grep -q registry.npmjs.org || npm cache add --cache %{npm_cache_dir} $tgz done %{?scl:end_of_scl} %setup -T -q -a 6 -D -n %{npm_cache_dir} %build %{?scl:scl enable %{?scl_nodejs} - << \end_of_scl} npm install --cache-min Infinity --cache %{?scl:../}%{npm_cache_dir} --no-shrinkwrap --no-optional --global-style true %{npm_name}@%{version} %{?scl:end_of_scl} %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pfr node_modules/%{npm_name}/node_modules %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pfr node_modules/%{npm_name}/bin %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pfr node_modules/%{npm_name}/index.js %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pfr node_modules/%{npm_name}/justfile %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pfr node_modules/%{npm_name}/package.json %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pfr node_modules/%{npm_name}/package.yml %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pfr node_modules/%{npm_name}/test %{buildroot}%{nodejs_sitelib}/%{npm_name} mkdir -p %{buildroot}%{_bindir}/ chmod 0755 %{buildroot}%{nodejs_sitelib}/%{npm_name}/bin/bbgurl ln -sf %{nodejs_sitelib}/%{npm_name}/bin/bbgurl %{buildroot}%{_bindir}/bbgurl %clean rm -rf %{buildroot} %{npm_cache_dir} %files %{nodejs_sitelib}/%{npm_name} %{_bindir}/bbgurl %changelog