%global modulename pkg-dir

%global npmlib_dir %{npmlib_sitelib}
%global nodejs_dir %{nodejs_sitelib}

%define __requires_exclude_from ^%{npmlib_dir}/%{modulename}/%{version}/tests?/.*

Name:           npmlib-pkg-dir
Version:        1.0.0
Release:        1%{?dist}
Summary:        Find the root directory of a npm package

License:        MIT
URL:            https://github.com/sindresorhus/pkg-dir#readme
Source0:        https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz


BuildRequires:  npmlib-packaging

BuildArch:      noarch
ExclusiveArch:  %{nodejs_arches} noarch

BuildRequires:  ((npmlib(find-up) >= 1.0.0 with npmlib(find-up) < 2.0.0))

Requires:       npmlib(%{modulename}) = %{version}

%description
Find the root directory of a npm package

%package 1.0.0
Summary:        Find the root directory of a npm package


%description 1.0.0
Find the root directory of a npm package

%prep
%autosetup -p0 -n package

%build
# Nothing to build

%install
mkdir -p %{buildroot}%{npmlib_dir}/%{modulename}/%{version}
cp -pr index.js %{buildroot}%{npmlib_dir}/%{modulename}/%{version}
cp -pr package.json %{buildroot}%{npmlib_dir}/%{modulename}/%{version}



mkdir -p %{buildroot}%{nodejs_dir}
ln -s %{npmlib_dir}/%{modulename}/%{version} %{buildroot}/%{nodejs_dir}/%{modulename}

%{npmlib_symlink_deps}

%check
rm -rf node_modules && %{npmlib_symlink_deps} .
%{__nodejs} -e 'require("./")'

%files
%doc readme.md
%license license
%{nodejs_dir}/%{modulename}

%files 1.0.0
%doc readme.md
%license license
%{npmlib_dir}/%{modulename}/%{version}
%dir %{npmlib_dir}/%{modulename}/

%changelog
* Tue Nov 20 2018 npm2srpm <dshea@redhat.com> - 1.0.0-1
- Package automatically generated by npm2srpm