Blob Blame History Raw
%global enable_tests 1
%global module_name as-number

Name:           nodejs-%{module_name}
Version:        1.0.0
Release:        3%{?dist}
Summary:        Tiny function that returns the given number, or a default value

License:        MIT
URL:            https://github.com/mattdesl/as-number
Source0:        http://registry.npmjs.org/%{module_name}/-/%{module_name}-%{version}.tgz
# upstream missed test.js in tarball
Source1:        https://raw.githubusercontent.com/mattdesl/as-number/master/test.js
BuildArch:      noarch
ExclusiveArch:  %{nodejs_arches} noarch

BuildRequires:  nodejs-packaging

%if 0%{?enable_tests}
BuildRequires:  npm(tape)
%endif

Requires:       npm(commander)

%description
%{summary}.

%prep
%setup -q -n package
rm -rf node_modules

cp -p %{SOURCE1} .

%build
# nothing to build

%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{module_name}
cp -pr package.json index.js %{buildroot}%{nodejs_sitelib}/%{module_name}

%nodejs_symlink_deps

%if 0%{?enable_tests}
%check
%{__nodejs} -e 'require("./")'
%nodejs_symlink_deps --check
node test.js
%endif

%files
%doc README.md LICENSE.md
%{nodejs_sitelib}/%{module_name}

%changelog
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sun Dec 07 2014 Parag Nemade <pnemade AT redhat DOT com> - 1.0.0-1
- Initial packaging