Jared K. Smith 4f06173
%{?nodejs_find_provides_and_requires}
Jared K. Smith 4f06173
Jared K. Smith 4f06173
%global packagename read-file
Jared K. Smith 4f06173
%global enable_tests 1
Jared K. Smith 4f06173
Jared K. Smith 4f06173
Name:		nodejs-read-file
Jared K. Smith 4f06173
Version:	0.2.0
d65ccc1
Release:	3%{?dist}
Jared K. Smith 4f06173
Summary:	Thin wrapper around fs.readFile and fs.readFileSync
Jared K. Smith 4f06173
Jared K. Smith 4f06173
License:	MIT
Jared K. Smith 4f06173
URL:		https://github.com/jonschlinkert/read-file
Jared K. Smith 4f06173
Source0:	https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
Jared K. Smith 4f06173
# The test files are not included in the npm tarball.
Jared K. Smith 4f06173
Source1:	https://raw.githubusercontent.com/jonschlinkert/read-file/master/test.js
Jared K. Smith 4f06173
Jared K. Smith 4f06173
Jared K. Smith 4f06173
BuildArch:	noarch
Jared K. Smith 4f06173
%if 0%{?fedora} >= 19
Jared K. Smith 4f06173
ExclusiveArch: %{nodejs_arches} noarch
Jared K. Smith 4f06173
%else
Jared K. Smith 4f06173
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
Jared K. Smith 4f06173
%endif
Jared K. Smith 4f06173
Jared K. Smith 4f06173
BuildRequires:	nodejs-packaging
Jared K. Smith 4f06173
Jared K. Smith 4f06173
%if 0%{?enable_tests}
Jared K. Smith 4f06173
BuildRequires:	mocha
Jared K. Smith 4f06173
%endif
Jared K. Smith 4f06173
Jared K. Smith 4f06173
%description
Jared K. Smith 4f06173
Thin wrapper around fs.readFile and fs.readFileSync that also strips byte order
Jared K. Smith 4f06173
marks when `utf8` encoding is chosen. Also optionally replaces windows newlines
Jared K. Smith 4f06173
with unix newlines.
Jared K. Smith 4f06173
Jared K. Smith 4f06173
Jared K. Smith 4f06173
%prep
Jared K. Smith 4f06173
%autosetup -n package
Jared K. Smith 4f06173
# setup the tests
Jared K. Smith 4f06173
cp -p %{SOURCE1} .
Jared K. Smith 4f06173
Jared K. Smith 4f06173
mkdir fixtures
Jared K. Smith 4f06173
echo -n "FILE CONTENTS!!!" > fixtures/a.txt
Jared K. Smith 4f06173
Jared K. Smith 4f06173
%build
Jared K. Smith 4f06173
# nothing to do
Jared K. Smith 4f06173
Jared K. Smith 4f06173
%install
Jared K. Smith 4f06173
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
Jared K. Smith 4f06173
cp -pr package.json index.js \
Jared K. Smith 4f06173
	%{buildroot}%{nodejs_sitelib}/%{packagename}
Jared K. Smith 4f06173
Jared K. Smith 4f06173
%nodejs_symlink_deps
Jared K. Smith 4f06173
Jared K. Smith 4f06173
%check
Jared K. Smith 4f06173
%nodejs_symlink_deps --check
Jared K. Smith 4f06173
%{__nodejs} -e 'require("./")'
Jared K. Smith 4f06173
%if 0%{?enable_tests}
Jared K. Smith 4f06173
NODE_ENV=test %{_bindir}/mocha -R spec
Jared K. Smith 4f06173
%else
Jared K. Smith 4f06173
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
Jared K. Smith 4f06173
%endif
Jared K. Smith 4f06173
Jared K. Smith 4f06173
%files
Jared K. Smith 4f06173
%{!?_licensedir:%global license %doc}
Jared K. Smith 4f06173
%doc *.md
Jared K. Smith 4f06173
%license LICENSE
Jared K. Smith 4f06173
%{nodejs_sitelib}/%{packagename}
Jared K. Smith 4f06173
Jared K. Smith 4f06173
%changelog
d65ccc1
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-3
d65ccc1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
d65ccc1
bfdce50
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-2
bfdce50
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
bfdce50
Jared K. Smith 4f06173
* Fri Jul 29 2016 Jared Smith <jsmith@fedoraproject.org> - 0.2.0-1
Jared K. Smith 4f06173
- Initial packaging