Jared K. Smith 961d416
%{?nodejs_find_provides_and_requires}
Jared K. Smith 961d416
Jared K. Smith 961d416
%global packagename string-width
Jared K. Smith 961d416
%global enable_tests 0
Jared K. Smith 961d416
# tests disabled until such time as 'ava' is packaged for Fedora
Jared K. Smith 961d416
Jared K. Smith 961d416
Name:		nodejs-string-width
Jared K. Smith 961d416
Version:	1.0.1
19596ee
Release:	6%{?dist}
Jared K. Smith 961d416
Summary:	Get the visual width of a string
Jared K. Smith 961d416
Jared K. Smith 961d416
License:	MIT
Jared K. Smith 961d416
URL:		https://github.com/sindresorhus/string-width
Jared K. Smith 961d416
Source0:	https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
Jared K. Smith 961d416
# Get the test from the upstream repo, as the npm tarball doesn't contain tests
Jared K. Smith 961d416
Source1:	https://raw.githubusercontent.com/sindresorhus/string-width/f279cfd14835f0a3c8df69ba18e9a3960156e135/test.js
Jared K. Smith 961d416
Jared K. Smith 961d416
Jared K. Smith 961d416
ExclusiveArch:	%{nodejs_arches} noarch
Jared K. Smith 961d416
BuildArch:	noarch
Jared K. Smith 961d416
Jared K. Smith 961d416
BuildRequires:	nodejs-packaging
Jared K. Smith 961d416
BuildRequires:	npm(code-point-at)
Jared K. Smith 961d416
BuildRequires:	npm(is-fullwidth-code-point)
Jared K. Smith 961d416
BuildRequires:	npm(strip-ansi)
Jared K. Smith 961d416
%if 0%{?enable_tests}
Jared K. Smith 961d416
BuildRequires:	npm(ava)
Jared K. Smith 961d416
%endif
Jared K. Smith 961d416
Jared K. Smith 961d416
%description
Jared K. Smith 961d416
Get the visual width of a string - the number of columns required to display it
Jared K. Smith 961d416
Jared K. Smith 961d416
Jared K. Smith 961d416
%prep
Jared K. Smith 961d416
%setup -q -n package
Jared K. Smith 961d416
# setup the tests
Jared K. Smith 961d416
cp -r %{SOURCE1} .
Jared K. Smith 961d416
Jared K. Smith 961d416
Jared K. Smith 961d416
Jared K. Smith 961d416
%build
Jared K. Smith 961d416
# nothing to do!
Jared K. Smith 961d416
Jared K. Smith 961d416
%install
Jared K. Smith 961d416
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
Jared K. Smith 961d416
cp -pr package.json index.js \
Jared K. Smith 961d416
	%{buildroot}%{nodejs_sitelib}/%{packagename}
Jared K. Smith 961d416
Jared K. Smith 961d416
%nodejs_symlink_deps
Jared K. Smith 961d416
Jared K. Smith 961d416
%check
Jared K. Smith 961d416
%nodejs_symlink_deps --check
Jared K. Smith 961d416
%{__nodejs} -e 'require("./")'
Jared K. Smith 961d416
%if 0%{?enable_tests}
Jared K. Smith 961d416
%{__nodejs} test.js
Jared K. Smith 961d416
%else
Jared K. Smith 961d416
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
Jared K. Smith 961d416
%endif
Jared K. Smith 961d416
Jared K. Smith 961d416
Jared K. Smith 961d416
%files
Jared K. Smith 961d416
%{!?_licensedir:%global license %doc}
Jared K. Smith 961d416
%doc *.md
Jared K. Smith 961d416
%license license
Jared K. Smith 961d416
%{nodejs_sitelib}/%{packagename}
Jared K. Smith 961d416
Jared K. Smith 961d416
Jared K. Smith 961d416
Jared K. Smith 961d416
%changelog
19596ee
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-6
19596ee
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
19596ee
f8e8138
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-5
f8e8138
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
f8e8138
91eb791
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-4
91eb791
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
91eb791
49829c9
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.1-3
49829c9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
49829c9
Jared K. Smith 961d416
* Wed Mar 02 2016 Jared Smith <jsmith@fedoraproject.org> - 1.0.1-2
Jared K. Smith 961d416
- Fix BuildRequires
Jared K. Smith 961d416
Jared K. Smith 961d416
* Fri Oct 23 2015 Jared Smith <jsmith@fedoraproject.org> - 1.0.1-1
Jared K. Smith 961d416
- Initial packaging