%{?nodejs_find_provides_and_requires}
%global enable_tests 1
Name: nodejs-showdown
Version: 0.3.1
Release: 8%{?dist}
Summary: A JavaScript port of the original Perl version of Markdown
License: BSD
Group: System Environment/Libraries
URL: https://github.com/coreyti/showdown
Source0: http://registry.npmjs.org/showdown/-/showdown-%{version}.tgz
BuildArch: noarch
%if 0%{?fedora} >= 19
ExclusiveArch: %{nodejs_arches} noarch
%else
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
%endif
BuildRequires: nodejs-packaging
%if 0%{?enable_tests}
BuildRequires: npm(mocha)
BuildRequires: npm(should)
%endif
%description
%{summary}.
%prep
%setup -q -n package
# Fix wrong-file-end-of-line-encoding rpmlint warnings.
sed -i -e 's/\r//' license.txt example/showdown-gui.js README.md
%build
#nothing to do
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/showdown
cp -pr package.json compressed/ src/ \
%{buildroot}%{nodejs_sitelib}/showdown
%nodejs_symlink_deps
%if 0%{?enable_tests}
%check
%nodejs_symlink_deps --check
%{nodejs_sitelib}/mocha/bin/mocha --require should --ui bdd
%endif
%files
%doc license.txt README.md example/
%{nodejs_sitelib}/showdown
%changelog
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.3.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Mon Jul 29 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.3.1-5
- restrict to compatible arches
- enable tests
* Wed Jun 19 2013 T.C. Hollingsworth <tchollingsworth@gmail.com> - 0.3.1-4
- rebuild for missing npm(showdown) provides on EL6
* Sat Mar 09 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.3.1-3
- fix wrong-file-end-of-line-encoding rpmlint warnings
* Sun Feb 17 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.3.1-2
- amend mocha options
* Sun Feb 17 2013 Jamie Nguyen <jamielinux@fedoraproject.org> - 0.3.1-1
- initial package