# Generated by go2rpm 1.12.0 %bcond_without check # https://github.com/evanw/esbuild %global goipath github.com/evanw/esbuild Version: 0.24.2 %gometa -L -f %global common_description %{expand: This is a JavaScript bundler and minifier. It packages up JavaScript and TypeScript code for distribution on the web.} %global golicenses LICENSE.md %global godocs docs CHANGELOG.md README.md version.txt Name: golang-github-evanw-esbuild Release: %autorelease Summary: Fast JavaScript bundler and minifier License: MIT URL: %{gourl} Source: %{gosource} BuildRequires: nodejs BuildRequires: nodejs-devel %description %{common_description} %gopkg %package -n nodejs-esbuild Summary: ESBuild ESM module Requires: %{name} = %{version}-%{release} %description -n nodejs-esbuild %{common_description} (JavaScript library) %prep %goprep -A %autopatch -p1 %generate_buildrequires %go_generate_buildrequires %build %gobuild -o %{gobuilddir}/bin/esbuild %{goipath}/cmd/esbuild # Build the "esbuild" ESM module node scripts/esbuild.js %{gobuilddir}/bin/esbuild --neutral %install %gopkginstall install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ # Detect node platform name (e.g., "linux-x64") node_platform=$(node -p 'process.platform + "-" + process.arch') # Install esbuild JavaScript module install -m 0755 -vd %{buildroot}%{nodejs_sitelib}/esbuild cp -pr npm/esbuild/lib %{buildroot}%{nodejs_sitelib}/esbuild/ install -m 0644 -vp npm/esbuild/package.json %{buildroot}%{nodejs_sitelib}/esbuild/ # Install the @esbuild/platform module install -m 0755 -vd %{buildroot}%{nodejs_sitelib}/@esbuild/${node_platform}/bin install -m 0644 -vp npm/@esbuild/${node_platform}/package.json %{buildroot}%{nodejs_sitelib}/@esbuild/${node_platform}/ ln -s %{_bindir}/esbuild %{buildroot}%{nodejs_sitelib}/@esbuild/${node_platform}/bin/esbuild %if %{with check} %check # css_parser: failed on ppc64le and s390x. %ifarch ppc64le s390x %gocheck -d internal/css_parser %else %gocheck %endif %endif %files %license LICENSE.md %doc docs CHANGELOG.md README.md %{_bindir}/esbuild %gopkgfiles %files -n nodejs-esbuild %{nodejs_sitelib}/*esbuild %changelog %autochangelog