Jared K. Smith 2561cce
%{?nodejs_find_provides_and_requires}
Jared K. Smith 2561cce
Jared K. Smith 2561cce
%global packagename pkg-dir
Jared K. Smith 2561cce
%global enable_tests 0
Jared K. Smith 2561cce
# Tests disabled due to missing npm(ava)
Jared K. Smith 2561cce
Jared K. Smith 2561cce
Name:		nodejs-pkg-dir
Jared K. Smith 2561cce
Version:	1.0.0
2370811
Release:	6%{?dist}
Jared K. Smith 2561cce
Summary:	Find the root directory of a npm package
Jared K. Smith 2561cce
Jared K. Smith 2561cce
License:	MIT
Jared K. Smith 2561cce
URL:		https://github.com/sindresorhus/pkg-dir
Jared K. Smith 2561cce
Source0:	https://registry.npmjs.org/%{packagename}/-/%{packagename}-%{version}.tgz
Jared K. Smith 2561cce
# The test files are not included in the npm tarball.
Jared K. Smith 2561cce
Source1:	https://raw.githubusercontent.com/sindresorhus/pkg-dir/v%{version}/test.js
Jared K. Smith 2561cce
Jared K. Smith 2561cce
Jared K. Smith 2561cce
BuildArch:	noarch
Jared K. Smith 2561cce
%if 0%{?fedora} >= 19
Jared K. Smith 2561cce
ExclusiveArch: %{nodejs_arches} noarch
Jared K. Smith 2561cce
%else
Jared K. Smith 2561cce
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
Jared K. Smith 2561cce
%endif
Jared K. Smith 2561cce
Jared K. Smith 2561cce
BuildRequires:	nodejs-packaging
Jared K. Smith 2561cce
BuildRequires:	npm(find-up)
Jared K. Smith 2561cce
%if 0%{?enable_tests}
Jared K. Smith 2561cce
BuildRequires:	npm(ava)
Jared K. Smith 2561cce
%endif
Jared K. Smith 2561cce
Jared K. Smith 2561cce
%description
Jared K. Smith 2561cce
Find the root directory of a npm package
Jared K. Smith 2561cce
Jared K. Smith 2561cce
Jared K. Smith 2561cce
%prep
Jared K. Smith 2561cce
%setup -q -n package
Jared K. Smith 2561cce
# setup the tests
Jared K. Smith 2561cce
cp -p %{SOURCE1} .
Jared K. Smith 2561cce
Jared K. Smith 061dcda
%nodejs_fixdep find-up
Jared K. Smith 2561cce
Jared K. Smith 2561cce
%build
Jared K. Smith 2561cce
# nothing to do!
Jared K. Smith 2561cce
Jared K. Smith 2561cce
%install
Jared K. Smith 2561cce
mkdir -p %{buildroot}%{nodejs_sitelib}/%{packagename}
Jared K. Smith 2561cce
cp -pr package.json *.js \
Jared K. Smith 2561cce
	%{buildroot}%{nodejs_sitelib}/%{packagename}
Jared K. Smith 2561cce
Jared K. Smith 2561cce
%nodejs_symlink_deps
Jared K. Smith 2561cce
Jared K. Smith 2561cce
%check
Jared K. Smith 2561cce
%nodejs_symlink_deps --check
Jared K. Smith 2561cce
%{__nodejs} -e 'require("./")'
Jared K. Smith 2561cce
%if 0%{?enable_tests}
Jared K. Smith 2561cce
# insert test suite here
Jared K. Smith 2561cce
%else
Jared K. Smith 2561cce
%{_bindir}/echo -e "\e[101m -=#=- Tests disabled -=#=- \e[0m"
Jared K. Smith 2561cce
Jared K. Smith 2561cce
%endif
Jared K. Smith 2561cce
Jared K. Smith 2561cce
Jared K. Smith 2561cce
%files
Jared K. Smith 2561cce
%{!?_licensedir:%global license %doc}
Jared K. Smith 2561cce
%doc *.md
Jared K. Smith 2561cce
%license license
Jared K. Smith 2561cce
%{nodejs_sitelib}/%{packagename}
Jared K. Smith 2561cce
Jared K. Smith 2561cce
Jared K. Smith 2561cce
%changelog
2370811
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-6
2370811
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
2370811
c43585c
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-5
c43585c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
c43585c
1b72464
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-4
1b72464
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
1b72464
Jared K. Smith 4c437d1
* Thu Apr 20 2017 Jared Smith <jsmith@fedoraproject.org> - 1.0.0-3
Jared K. Smith 061dcda
- Allow newer version of npm(find-up)
Jared K. Smith 061dcda
42bd8bf
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-2
42bd8bf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
42bd8bf
Jared K. Smith 2561cce
* Fri Feb 12 2016 Jared Smith <jsmith@fedoraproject.org> - 1.0.0-1
Jared K. Smith 2561cce
- Initial packaging