File uglify-js.spec of Package uglify-js

#
# spec file for package uglify-js
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2020 Stasiek Michalski <stasiek@michalski.cc>.
#
# 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 https://bugs.opensuse.org/
#


Name:           uglify-js
Version:        3.17.4
Release:        0
Summary:        JavaScript parser, mangler/compressor and beautifier toolkit
License:        BSD
URL:            https://github.com/mishoo/UglifyJS2
Source0:        https://registry.npmjs.org/uglify-js/-/uglify-js-%{version}.tgz
BuildRequires:  nodejs-commander2
BuildRequires:  nodejs-packaging-fedora
BuildRequires:  nodejs-source-map0.6
Provides:       nodejs-uglify-js = %{version}-%{release}
BuildArch:      noarch

%description
JavaScript parser, mangler/compressor and beautifier toolkit.

This package ships the uglifyjs command-line tool and a library suitable for
use within Node.js.

%prep
%autosetup -n package

%build

%install
mkdir -p %{buildroot}%{nodejs_sitelib}/uglify-js
cp -pr package.json bin lib tools LICENSE %{buildroot}%{nodejs_sitelib}/uglify-js/
chmod +x %{buildroot}%{nodejs_sitelib}/uglify-js/bin/uglifyjs

%{nodejs_symlink_deps}

mkdir -p %{buildroot}%{_bindir}
ln -sf %{nodejs_sitelib}/uglify-js/bin/uglifyjs %{buildroot}%{_bindir}/uglifyjs

%check
%{nodejs_symlink_deps} --check
%{__nodejs} -e 'require("./")'

%files
%dir %{nodejs_sitelib}
%{nodejs_sitelib}/uglify-js
%{_bindir}/uglifyjs

%changelog
openSUSE Build Service is sponsored by