## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 8; 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 cjs-module-lexer %global prebuilt_blobs lib/lexer.wasm Name: nodejs-%{npm_name} Summary: A very fast lexer used to detect the named exports of a CommonJS module Version: 1.2.3 Release: %autorelease License: MIT URL: https://www.npmjs.com/package/cjs-module-lexer # The npmjs.org archive does not contain sources, only built artifacts Source: https://github.com/nodejs/%{npm_name}/archive/%{version}/%{npm_name}-%{version}.tar.gz # Production archive is not needed Source2: %{npm_name}-%{version}-nm-dev.tgz Source3: %{npm_name}-%{version}-bundled-licenses.txt # Adapt Makefile for easier rebuilds Patch: 0001-parametrize-wasm-compilation-process.patch # Binary files in this package are aimed at the wasm32-wasi "architecture". %global _binaries_in_noarch_packages_terminate_build 0 BuildArch: noarch # change this conditional to the fedora and rhel releases containing lld # versions which include support for s390x: # https://github.com/llvm/llvm-project/issues/57097 %if 0 ExclusiveArch: %{nodejs_arches} noarch %else ExclusiveArch: %{ix86} x86_64 aarch64 ppc64le riscv64 noarch %endif BuildRequires: clang lld make wasi-libc-devel BuildRequires: nodejs-devel npm # for autosetup -S git_am BuildRequires: git-core %description A very fast JS CommonJS module syntax lexer used to detect the most likely list of named exports of a CommonJS module. This project is used in Node.js core for detecting the named exports available when importing a CJS module into ESM, and is maintained for this purpose. %prep %autosetup -n %{npm_name}-%{version} -S git_am cp -p %{S:3} . %build rm -rf %{prebuilt_blobs} tar -xzf %{S:2} && ln -rsf node_modules_dev node_modules %make_build -j1 \ WASM_CC=clang \ WASM_CFLAGS='--target=wasm32-wasi --sysroot=/usr/wasm32-wasi' \ WASM_LDFLAGS='-nostartfiles -nodefaultlibs -lc' \ clean lib/lexer.wasm npm --offline run build npm --offline pack %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name} tar --strip-components=1 -xzf %{npm_name}-%{version}.tgz -C %{buildroot}%{nodejs_sitelib}/%{npm_name} %check %{__nodejs} -e 'require("./")' %nodejs_symlink_deps --check npm --offline run test %files %license LICENSE %{npm_name}-%{version}-bundled-licenses.txt %doc README.md %dir %{nodejs_sitelib} %{nodejs_sitelib}/%{npm_name}/ %changelog ## START: Generated by rpmautospec * Tue Oct 29 2024 Troy Dawson - 1.2.3-8 - Bump release for October 2024 mass rebuild: * Thu Aug 01 2024 Jakub Heger - 1.2.3-7 - Setup gating for c10s * Mon Jun 24 2024 Troy Dawson - 1.2.3-6 - Bump release for June 2024 mass rebuild * Thu Jan 25 2024 Fedora Release Engineering - 1.2.3-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Mon Jan 22 2024 Yaakov Selkowitz - 1.2.3-4 - Do not attempt to build on s390x * Sun Jan 21 2024 Fedora Release Engineering - 1.2.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Tue Nov 14 2023 Jan Staněk - 1.2.3-2 - own %%{nodejs_sitelib} directory * Mon Oct 23 2023 Jan Staněk - 1.2.3-1 - initial import (rhbz#2245271) ## END: Generated by rpmautospec