## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global npm_name undici # Note: clang runs wasm-opt automatically if found in $PATH, # which can cause confusing errors ("bulk memory is disabled"). # Workaround by disabling the wasm-opt on releases when this manifests. # Can be fixed by --no-wasm-opt flag, once that lands in released clang: # https://github.com/llvm/llvm-project/pull/95208 # Adjust as needed. %bcond wasm_opt %[0%{?fedora} > 39] %global llhttp_version_major 9 %global llhttp_version_minor 2 %global llhttp_version_patch 0 Name: nodejs-%{npm_name} Summary: An HTTP/1.1 client, written from scratch for Node.js Version: 7.2.0 Release: %autorelease License: MIT URL: https://undici.nodejs.org # See Source4 on how these archives were generated Source0: %{npm_name}-%{version}-stripped.tar.gz Source1: %{npm_name}-%{version}-nm-prod.tgz Source2: %{npm_name}-%{version}-nm-dev.tgz Source3: %{npm_name}-%{version}-bundled-licenses.txt Source4: %{npm_name}-sources.sh # Binary artifacts in this package are aimed at the wasm32-wasi "architecture". %global _binaries_in_noarch_packages_terminate_build 0 BuildArch: noarch # would be %%{nodejs_arches} noarch, but lld is not yet supported on s390x ExclusiveArch: %{ix86} x86_64 aarch64 ppc64le riscv64 noarch BuildRequires: clang lld wasi-libc-devel BuildRequires: nodejs-devel npm %if %{with wasm_opt} BuildRequires: binaryen %endif # for autosetup -S git_am BuildRequires: git-core # This package bundles it's own copy of llhttp Provides: bundled(llhttp) = %{llhttp_version_major}.%{llhttp_version_minor}.%{llhttp_version_patch} %description An HTTP/1.1 client, written from scratch for Node.js. %prep %autosetup -n %{npm_name}-%{version} -S git_am cp -p %{S:3} . # Check for bundled llhttp version if ! grep -q 'LLHTTP_VERSION_MAJOR %{llhttp_version_major}' deps/llhttp/include/llhttp.h \ || ! grep -q 'LLHTTP_VERSION_MINOR %{llhttp_version_minor}' deps/llhttp/include/llhttp.h \ || ! grep -q 'LLHTTP_VERSION_PATCH %{llhttp_version_patch}' deps/llhttp/include/llhttp.h then echo 'llhttp version mismatch' >&2; exit 2 fi # Link node_modules mkdir -p node_modules/.bin/ tar -xzf %{S:1} ln -srt node_modules/ node_modules_prod/* ln -srt node_modules/.bin/ node_modules_prod/.bin %build export WASM_CC=clang export WASM_CFLAGS='--target=wasm32-wasi --sysroot=/usr/wasm32-wasi' export WASM_LDFLAGS='-nodefaultlibs' export WASM_LDLIBS='-lc' %if %{with wasm_opt} export WASM_OPT=/usr/bin/wasm-opt %endif # `npm run build` uses docker; invoke the build script directly env EXTERNAL_PATH='%{nodejs_sitelib}/%{npm_name}' %{__nodejs} build/wasm.js npm --offline pack %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name} tar -C %{buildroot}%{nodejs_sitelib}/%{npm_name} -xzf %{npm_name}-%{version}.tgz --strip-components=1 cp -prt %{buildroot}%{nodejs_sitelib}/%{npm_name} node_modules_prod node_modules # Built (WASM) files are no longer packaged with npm pack install -p -Dt %{buildroot}%{nodejs_sitelib}/%{npm_name}/lib/llhttp/ lib/llhttp/*.wasm lib/llhttp/*.js install -p -Dt %{buildroot}%{nodejs_sitelib}/%{npm_name}/ loader.js %check %{__nodejs} -e 'require("./")' tar -xzf %{S:2} ln -fsrt node_modules/ node_modules_dev/* ln -fsrt node_modules/.bin/ node_modules_dev/.bin/* # Depends on the environment/OpenSSL version, etc. Informational only. npm --offline run test || : %files %doc README.md %license LICENSE %{npm_name}-%{version}-bundled-licenses.txt %dir %{nodejs_sitelib} %{nodejs_sitelib}/%{npm_name} %changelog ## START: Generated by rpmautospec * Thu Dec 19 2024 Andrei Radchenko - 7.2.0-1 - Uncommitted changes * Tue Dec 10 2024 Andrei Radchenko - 7.1.0-1 - Update to version 7.1.0 (rhbz#2307492) * Tue Aug 13 2024 Jan Staněk - 6.19.7-3 - workaround unexpected clang – wasi-opt interaction * Tue Aug 13 2024 Jan Staněk - 6.19.7-2 - use wasm-opt from distribution binaryen * Tue Aug 13 2024 Jan Staněk - 6.19.7-1 - Update to version 6.11.1 (rhbz#2274004) * Thu Jul 18 2024 Fedora Release Engineering - 6.11.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Wed Apr 03 2024 Jan Staněk - 6.11.1-2 - Install built files explicitly * Wed Apr 03 2024 Jan Staněk - 6.11.1-1 - Update to version 6.11.1 (rhbz#2252541) * Wed Apr 03 2024 Jan Staněk - 5.28.3-3 - enable gating * Fri Feb 09 2024 Zephyr Lykos - 5.28.3-2 - Use wildcards in gitignore * Fri Feb 09 2024 Zephyr Lykos - 5.28.3-1 - Update to 5.28.3 (rhbz#2261973) * Tue Jan 30 2024 Zephyr Lykos - 5.28.1-5 - Load WASM from .wasm files * Thu Jan 25 2024 Fedora Release Engineering - 5.28.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Mon Jan 22 2024 Yaakov Selkowitz - 5.28.1-3 - Do not attempt to build on s390x * Sun Jan 21 2024 Fedora Release Engineering - 5.28.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Tue Nov 28 2023 Jan Staněk - 5.28.1-1 - Update to version 5.28.1 (rhbz#2251486) * Wed Nov 15 2023 Jan Staněk - 5.27.2-5 - Import sources into Fedora (rhbz#2249060) * Tue Nov 14 2023 Jan Staněk - 5.27.2-2 - co-own %%{nodejs_sitelib} directory * Fri Nov 10 2023 Jan Staněk - 5.27.2-1 - update to version 5.27.2 * Fri Nov 10 2023 Jan Staněk - 5.26.4-1 - initial package import ## END: Generated by rpmautospec