%global enable_tests 0
%global module_name caller-path
Name: nodejs-%{module_name}
Version: 0.1.0
Release: 1%{?dist}
Summary: Get the path of the caller module
License: MIT
URL: https://github.com/sindresorhus/caller-path
Source0: http://registry.npmjs.org/%{module_name}/-/%{module_name}-%{version}.tgz
Source1: https://raw.githubusercontent.com/sindresorhus/caller-path/master/license
Source2: https://raw.githubusercontent.com/sindresorhus/caller-path/master/test.js
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: npm(fixture)
BuildRequires: npm(mocha)
%endif
%description
Get the path of the caller module. You can't use module.parent as modules are
cached and it will return the first caller module, not necessarily the current
one.
%prep
%setup -q -n package
rm -rf node_modules
cp -p %{SOURCE1} %{SOURCE2} .
%nodejs_fixdep callsites ~1.x
%build
# nothing to build
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{module_name}
cp -pr package.json *.js %{buildroot}%{nodejs_sitelib}/%{module_name}
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
mocha
%endif
%files
%doc readme.md license
%{nodejs_sitelib}/%{module_name}
%changelog
* Mon Dec 08 2014 Parag Nemade <pnemade AT redhat DOT com> - 0.1.0-1
- Initial packaging