%global enable_tests 1
%global srcname multiline
Name: nodejs-%{srcname}
Version: 1.0.2
Release: 4%{?dist}
Summary: Multiline strings in JavaScript
License: MIT
URL: https://github.com/sindresorhus/multiline
Source0: https://registry.npmjs.com/%{srcname}/-/%{srcname}-%{version}.tgz
# tests not in tarball
Source1: https://raw.githubusercontent.com/sindresorhus/multiline/v%{version}/test.js
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: npm(mocha)
BuildRequires: npm(strip-indent)
BuildRequires: npm(uglify-js)
%endif
%description
%{summary}.
%prep
%setup -q -n package
cp -p %{SOURCE1} .
rm -rf node_modules
%nodejs_fixdep --dev uglify-js
%nodejs_fixdep strip-indent
%build
#nothing to do
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{srcname}
cp -pr package.json index.js \
%{buildroot}%{nodejs_sitelib}/%{srcname}
%nodejs_symlink_deps
%check
%nodejs_symlink_deps --check
%{__nodejs} -e 'require("./")'
%if 0%{?enable_tests}
%{_bindir}/mocha -R spec
%else
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
%endif
%files
%doc readme.md
%license license
%{nodejs_sitelib}/%{srcname}
%changelog
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Sat Jul 16 2016 Jared Smith <jsmith@fedoraproject.org> - 1.0.2-3
- Relax version of npm(strip-indent)
- Add tests and run them during check phase
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Sat Aug 29 2015 Piotr Popieluch <piotr1212@gmail.com> - 1.0.2-1
- Initial package