|
|
30582b |
# nodejs binary
|
|
|
30582b |
%__nodejs %{_bindir}/node
|
|
|
30582b |
|
|
|
30582b |
# nodejs library directory
|
|
|
30582b |
%nodejs_sitelib %{_prefix}/lib/node_modules
|
|
|
30582b |
|
|
|
30582b |
#arch specific library directory
|
|
|
30582b |
#for future-proofing only; we don't do multilib
|
|
|
30582b |
%nodejs_sitearch %{nodejs_sitelib}
|
|
|
30582b |
|
|
|
30582b |
# currently installed nodejs version
|
|
|
30582b |
%nodejs_version %(%{__nodejs} -v | sed s/v//)
|
|
|
30582b |
|
|
|
30582b |
# symlink dependencies so `npm link` works
|
|
|
30582b |
# this should be run in every module's %%install section
|
|
|
30582b |
# pass --check to work in the current directory instead of the buildroot
|
|
|
30582b |
# pass --no-devdeps to ignore devDependencies when --check is used
|
|
|
30582b |
%nodejs_symlink_deps %{_rpmconfigdir}/nodejs010-symlink-deps %{nodejs_sitelib}
|
|
|
30582b |
|
|
|
30582b |
# patch package.json to fix a dependency
|
|
|
30582b |
# see `man npm-json` for details on writing dependencies for package.json files
|
|
|
30582b |
# e.g. `%%nodejs_fixdep frobber` makes any version of frobber do
|
|
|
30582b |
# `%%nodejs_fixdep frobber '>1.0'` requires frobber > 1.0
|
|
|
30582b |
# `%%nodejs_fixdep -r frobber removes the frobber dep
|
|
|
30582b |
%nodejs_fixdep %{_rpmconfigdir}/nodejs010-fixdep
|
|
|
30582b |
|
|
|
30582b |
# macro to filter unwanted provides from Node.js binary native modules
|
|
|
30582b |
%nodejs_default_filter %{?filter_setup: %{expand: \
|
|
|
30582b |
%filter_provides_in %{nodejs_sitearch}/.*\\.node$ \
|
|
|
30582b |
%filter_setup \
|
|
|
30582b |
}}
|
|
|
30582b |
|
|
|
30582b |
# macro to invoke the Node.js provides and requires generators
|
|
|
30582b |
%nodejs_find_provides_and_requires %{expand: \
|
|
|
30582b |
%global _use_internal_dependency_generator 0
|
|
|
30582b |
%global __find_provides %{_rpmconfigdir}/nodejs010-provide.sh
|
|
|
30582b |
%global __find_requires %{_rpmconfigdir}/nodejs010-require.sh
|
|
|
30582b |
}
|