%global npm_name yarn # name yarn would probably confict with cmdtest and hadoop-yarn # https://bugzilla.redhat.com/show_bug.cgi?id=1507312 %global fc_name nodejs-yarn %{?nodejs_find_provides_and_requires} %global enable_tests 1 # don't require bundled modules %global __requires_exclude_from ^%{_prefix}/lib/node_modules/yarn/.*$ Name: nodejs-yarn Version: 1.6.0 Release: 1%{?dist} Summary: Fast, reliable, and secure dependency management. Url: https://github.com/yarnpkg/yarn # we need tarball with node_modules Source0: %{npm_name}-v%{version}.tar.gz Source1: yarn-tarball.sh # Clarify the usage of renamed binaries Source10: README.Fedora License: BSD BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: nodejs-packaging BuildRequires: npm Requires: nodejs %description Fast, reliable, and secure dependency management. %prep %setup -q -n %{npm_name}-%{version} cp %{SOURCE10} . %build # use build script npm run build # remove build dependencies from node_modules npm prune --production %install mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name} cp -pr package.json lib bin node_modules \ %{buildroot}%{nodejs_sitelib}/%{npm_name} mkdir -p %{buildroot}%{_bindir} ln -sf ../lib/node_modules/yarn/bin/yarn.js %{buildroot}%{_bindir}/nodejs-yarn ln -sf ../lib/node_modules/yarn/bin/yarn.js %{buildroot}%{_bindir}/yarnpkg #%{nodejs_symlink_deps} %if 0%{?enable_tests} %check %nodejs_symlink_deps --check if [[ $(%{buildroot}/%{_bindir}/nodejs-yarn --version) == %{version} ]] ; then echo PASS; else echo FAIL; fi if [[ $(%{buildroot}/%{_bindir}/yarnpkg --version) == %{version} ]] ; then echo PASS; else echo FAIL; fi %endif %files %{nodejs_sitelib}/yarn %{_bindir}/nodejs-yarn %{_bindir}/yarnpkg %doc README.md README.Fedora %license LICENSE %changelog * Wed May 09 2018 Zuzana Svetlikova - 1.6.0-1 - Rebase, rebuild with new packaging * Wed Mar 21 2018 Zuzana Svetlikova - 1.5.1-2 - Add requires_exclude_from macro - rename nodejs-yarnpkg to yarn * Wed Mar 21 2018 Zuzana Svetlikova - 1.5.1-1 - Rebase * Tue Jan 30 2018 Zuzana Svetlikova - 1.4.1-1 - rebase - package from GH, build with npm * Tue Dec 05 2017 Zuzana Svetlikova - 1.3.2-2 - Add fedora readme so users are able to find renamed commands - change source url - rename license according to guidelines * Mon Nov 27 2017 Zuzana Svetlikova - 1.3.2-1 - Initial build