%{?nodejs_find_provides_and_requires}
%global packagename nopt-usage
%global enable_tests 1
Name: nodejs-nopt-usage
Version: 0.1.0
Release: 1%{?dist}
Summary: This module generates a usage string for nopt options
License: MIT
URL: https://github.com/zaach/nopt-usage
Source0: https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
# No license file upstream. Requested at https://github.com/zaach/nopt-usage/issues/3
Source1: LICENSE-MIT.txt
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}
# nothing
%endif
%description
This module generates a usage string for nopt options. It's based on
[this](https://github.com/npm/nopt/pull/13) PR from Filirom1.
%prep
%autosetup -n package
cp -p %{SOURCE1} .
%build
# nothing to do
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
cp -pr package.json index.js \
%{buildroot}%{nodejs_sitelib}/%{packagename}
%nodejs_symlink_deps
%check
%nodejs_symlink_deps --check
%{__nodejs} -e 'require("./")'
%if 0%{?enable_tests}
%{_bindir}/echo -e "\e[102m -=#=- This package has no tests -=#=- \e[0m"
%else
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
%endif
%files
%{!?_licensedir:%global license %doc}
%doc *.md
%license LICENSE-MIT.txt
%{nodejs_sitelib}/%{packagename}
%changelog
* Thu Jul 28 2016 Jared Smith <jsmith@fedoraproject.org> - 0.1.0-1
- Initial packaging