File yarn.spec of Package yarn

#
# spec file for package yarn
#
# Copyright (c) 2017 Miquel Sabaté Solà <msabate@suse.com>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:           yarn
Version:        1.21.1
Release:        0
License:        BSD-2-Clause
Summary:        Fast, reliable, and secure dependency management
Url:            https://yarnpkg.com/en/
Group:          Development/Languages/NodeJS
Source0:        https://github.com/yarnpkg/yarn/releases/download/v%{version}/%{name}-v%{version}.tar.gz
BuildArch:     noarch

# Installing nodejs is only a recommendation because the user might already have
# nvm in place.
Recommends:     nodejs8

PreReq:         %fillup_prereq

%description
Yarn is a package manager for your code. It allows you to use and share code
with other developers from around the world. Yarn does this quickly, securely,
and reliably so you don’t ever have to worry.

Yarn allows you to use other developers’ solutions to different problems, making
it easier for you to develop your software. If you have problems, you can report
issues or contribute back, and when the problem is fixed, you can use Yarn to
keep it all up to date.

Code is shared through something called a package (sometimes referred to as a
module). A package contains all the code being shared as well as a package.json
file which describes the package.

%prep
%setup -q -n %{name}-v%{version}

%build
# fix shebang
sed -i 's,^#!/usr/bin/env node,#!/usr/bin/node,' bin/* lib/cli.js
# drop windows cmd files
rm bin/*.cmd

%install
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datadir}/yarn
cp -r package*json bin lib %{buildroot}%{_datadir}/yarn
ln -s ../share/yarn/bin/yarn{,pkg} %{buildroot}%{_bindir}

%files
%license LICENSE
%doc README.md
%{_bindir}/yarn
%{_bindir}/yarnpkg
%{_datadir}/yarn

%changelog
openSUSE Build Service is sponsored by