File nodejs-node-gyp.spec of Package nodejs-node-gyp

#
# spec file for package nodejs-node-gyp
#
# Copyright (c) 2024 SUSE LLC
#
# 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/
#


%define mod_name node-gyp
Name:           nodejs-node-gyp
Version:        11.1.0
Release:        0
Summary:        Node.js native addon build tool
License:        MIT
# FIXME: use correct group, see "https://en.opensuse.org/openSUSE:Package_group_guidelines"
Group:          Development/Languages/NodeJS
URL:            git://github.com/nodejs/node-gyp.git
Source0:        node-gyp-%{version}.tgz
Source1:        node_modules-%{version}.tar.xz
Source2:        macros.node-gyp
BuildRequires:  fdupes
BuildRequires:  nodejs
Requires:       gcc-c++
Requires:       nodejs
Requires:       nodejs-devel
Requires:       nodejs-package-config
Requires:       python3
BuildArch:      noarch

%description
Nodejs application: Node.js native addon build tool

%prep
%setup -q -n package
tar xfJ %{SOURCE1}

%build

%install
# rm node_modules/console-control-strings/README.md~
rm -rf test
rm -rf gyp/.github
rm -rf gyp/.flake8
rm -rf gyp/tools/Xcode
rm -rf gyp/data
rm -rf .github
rm -rf mac*
rm -rf docs
rm -f *.md
rm -rf gyp/*.md
rm -rf node_modules/.bin
rm -rf src

find -name *.md | xargs rm
find -name .github | xargs rm -rf


mkdir -p %{buildroot}%{_prefix}/lib/node_modules/%{mod_name}
cp -r * %{buildroot}%{_prefix}/lib/node_modules/%{mod_name}

mkdir -p %{buildroot}%{_rpmmacrodir}
cp %{SOURCE2} %{buildroot}%{_rpmmacrodir}

mkdir -p %{buildroot}%{_prefix}/lib/node_modules/.bin
ln -sf %{_prefix}/lib/node_modules/%{mod_name}/bin/node-gyp.js %{buildroot}%{_prefix}/lib/node_modules/.bin/node-gyp

%fdupes %{buildroot}

%files
%dir %{_prefix}/lib/node_modules
%{_rpmmacrodir}/macros.node-gyp
%{_prefix}/lib/node_modules/node-gyp
%{_prefix}/lib/node_modules/.bin

%changelog
openSUSE Build Service is sponsored by