Blame SPECS/nodejs-string-width.spec

60f0f6
%{?scl:%scl_package nodejs-string-width}
60f0f6
%{!?scl:%global pkg_name %{name}}
60f0f6
60f0f6
%{?nodejs_find_provides_and_requires}
60f0f6
60f0f6
%global packagename string-width
60f0f6
%global enable_tests 0
60f0f6
# tests disabled until such time as 'ava' is packaged for Fedora
60f0f6
60f0f6
Name:		%{?scl_prefix}nodejs-string-width
60f0f6
Version:	1.0.1
998d49
Release:	4%{?dist}
60f0f6
Summary:	Get the visual width of a string
60f0f6
60f0f6
License:	MIT
60f0f6
URL:		https://github.com/sindresorhus/string-width
60f0f6
Source0:	https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
60f0f6
# Get the test from the upstream repo, as the npm tarball doesn't contain tests
60f0f6
Source1:	https://raw.githubusercontent.com/sindresorhus/string-width/f279cfd14835f0a3c8df69ba18e9a3960156e135/test.js
60f0f6
60f0f6
60f0f6
ExclusiveArch:	%{nodejs_arches} noarch
60f0f6
BuildArch:	noarch
60f0f6
60f0f6
%if 0%{?enable_tests}
60f0f6
BuildRequires:	%{?scl_prefix}npm(ava)
60f0f6
%endif
60f0f6
60f0f6
%description
60f0f6
Get the visual width of a string - the number of columns required to display it
60f0f6
60f0f6
%prep
60f0f6
%setup -q -n package
60f0f6
# setup the tests
60f0f6
cp -r %{SOURCE1} .
60f0f6
60f0f6
%build
60f0f6
# nothing to do!
60f0f6
60f0f6
%install
60f0f6
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
60f0f6
cp -pr package.json index.js \
60f0f6
	%{buildroot}%{nodejs_sitelib}/%{packagename}
60f0f6
60f0f6
%nodejs_symlink_deps
60f0f6
60f0f6
#%check
60f0f6
#%nodejs_symlink_deps --check
60f0f6
#%{__nodejs} -e 'require("./")'
60f0f6
#%if 0%{?enable_tests}
60f0f6
#%{__nodejs} test.js
60f0f6
#%else
60f0f6
#%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
60f0f6
#%endif
60f0f6
60f0f6
%files
60f0f6
%{!?_licensedir:%global license %doc}
60f0f6
%doc *.md
60f0f6
%license license
60f0f6
%{nodejs_sitelib}/%{packagename}
60f0f6
60f0f6
%changelog
998d49
* Mon May 28 2018 Zuzana Svetlikova <zsvetlik@redhat.com> - 1.0.1-4
998d49
- Resolves: RHBZ#1543198, rebuild for multiarch
998d49
60f0f6
* Thu Sep 15 2016 Zuzana Svetlikova <zsvetlik@redhat.com> - 1.0.1-3
60f0f6
- Built for RHSCL
60f0f6
- Remove %%BuildRequires
60f0f6
60f0f6
* Wed Mar 02 2016 Jared Smith <jsmith@fedoraproject.org> - 1.0.1-2
60f0f6
- Fix BuildRequires
60f0f6
60f0f6
* Fri Oct 23 2015 Jared Smith <jsmith@fedoraproject.org> - 1.0.1-1
60f0f6
- Initial packaging