nodejs18/macros.nodejs
T.C. Hollingsworth e69a9d539d make %nodejs_symlink_deps actually work
module packaging stuff is now complete (for pure-JS modules anyway)
and npm reviews will be filed shortly :-)
2013-01-02 00:05:33 -07:00

20 lines
810 B
Plaintext

# nodejs binary
%__nodejs %{_bindir}/node
# nodejs library directory
%nodejs_sitelib %{_prefix}/lib/node_modules
# currently installed nodejs version
%nodejs_version %(%{__nodejs} -v | sed s/v//)
# symlink dependencies so `npm link` works
# this should be run in every module's %%install section
# pass the module name if the npm metadata is incorrect (e.g. multiple versions)
%nodejs_symlink_deps %{_rpmconfigdir}/nodejs-symlink-deps %{nodejs_sitelib}
# patch package.json to fix a dependency
# see `man npm-json` for details on writing dependencies for package.json files
# e.g. `%%nodejs_fixdep frobber` makes any version of frobber do
# `%%nodejs_fixdep frobber '>1.0'` requires frobber > 1.0
# `%%nodejs_fixdep -r frobber removes the frobber dep
%nodejs_fixdep %{_rpmconfigdir}/nodejs-fixdep