Blame SPECS/nodejs-undefsafe.spec

12a810
%{?scl:%scl_package nodejs-%{npm_name}}
12a810
%{!?scl:%global pkg_name %{name}}
12a810
12a810
%{?nodejs_find_provides_and_requires}
12a810
%global npm_name undefsafe
12a810
12a810
# Tests disabled due to dependencies not in brew yet
12a810
%global enable_tests 0
12a810
12a810
Summary:       Undefined safe way of extracting object properties
12a810
Name:          %{?scl_prefix}nodejs-%{npm_name}
12a810
Version:       0.0.3
12a810
Release:       2%{?dist}
12a810
License:       MIT
12a810
URL:           https://github.com/remy/undefsafe
12a810
Source0:       http://registry.npmjs.org/%{npm_name}/-/%{npm_name}-%{version}.tgz
12a810
BuildRequires: nodejs010-runtime
12a810
ExclusiveArch: %{nodejs_arches} noarch
12a810
BuildArch:     noarch
12a810
Provides:      %{?scl_prefix}nodejs-%{npm_name} = %{version}
12a810
12a810
%if 0%{?enable_tests}
12a810
BuildRequires: %{?scl_prefix}nodejs(mocha)
12a810
%endif
12a810
12a810
%description
12a810
Undefined safe way of extracting object properties
12a810
12a810
Simple function for retrieving deep object properties 
12a810
without getting "Cannot read property 'X' of undefined"
12a810
12a810
%prep
12a810
%setup -q -n package
12a810
12a810
%build
12a810
12a810
%install
12a810
mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name}
12a810
cp -pr lib package.json %{buildroot}%{nodejs_sitelib}/%{npm_name}
12a810
12a810
%nodejs_symlink_deps
12a810
12a810
%if 0%{?enable_tests}
12a810
12a810
%check
12a810
%nodejs_symlink_deps --check
12a810
mocha --ui bdd test/**/*.test.js
12a810
%endif
12a810
12a810
%files
12a810
%doc README.md
12a810
%{nodejs_sitelib}/%{npm_name}
12a810
12a810
%changelog
12a810
* Wed Jan 06 2016 Tomas Hrcka <thrcka@redhat.com> - 0.0.3-2
12a810
- Enable scl macros
12a810
12a810
* Mon Dec 14 2015 Troy Dawson <tdawson@redhat.com> - 0.0.3-1
12a810
- Initial package