%global enable_tests 1
%global module_name minstache
Name: nodejs-%{module_name}
Version: 1.2.0
Release: 6%{?dist}
Summary: Mini mustache template engine
License: MIT
URL: https://github.com/visionmedia/minstache
Source0: http://registry.npmjs.org/%{module_name}/-/%{module_name}-%{version}.tgz
Source1: https://raw.githubusercontent.com/visionmedia/minstache/master/test/index.js
# https://github.com/visionmedia/minstache/pull/16
Source2: LICENSE
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: npm(mocha)
BuildRequires: npm(should)
%endif
Requires: npm(commander)
%description
%{summary}.
%prep
%setup -q -n package
rm -rf node_modules
cp -p %{SOURCE2} .
mkdir test
cp -p %{SOURCE1} test
%nodejs_fixdep commander ~2.x
%build
# nothing to build
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{module_name}
cp -pr package.json index.js bin/ %{buildroot}%{nodejs_sitelib}/%{module_name}
mkdir -p %{buildroot}%{_bindir}
ln -s %{nodejs_sitelib}/%{module_name}/bin/minstache %{buildroot}%{_bindir}/minstache
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
mocha --require should --reporter spec
%endif
%files
%doc Readme.md LICENSE
%{_bindir}/minstache
%{nodejs_sitelib}/%{module_name}
%changelog
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.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.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sun Dec 07 2014 Parag Nemade <pnemade AT redhat DOT com> - 1.2.0-1
- Initial packaging