2017-07-07 16:14:44 +02:00
|
|
|
#
|
|
|
|
# spec file for package nodejs-common
|
|
|
|
#
|
2022-01-12 10:18:55 +01:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2017-07-07 16:14:44 +02:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2019-02-01 16:58:55 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2017-07-07 16:14:44 +02:00
|
|
|
#
|
|
|
|
|
2017-08-02 16:59:33 +02:00
|
|
|
|
2017-07-12 14:32:58 +02:00
|
|
|
###########################################################
|
|
|
|
#
|
|
|
|
# WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
|
|
|
|
#
|
|
|
|
# This spec file is generated from a template hosted at
|
|
|
|
# https://github.com/AdamMajer/nodejs-packaging
|
|
|
|
#
|
|
|
|
###########################################################
|
|
|
|
|
2021-05-07 16:22:59 +02:00
|
|
|
%define NODEJS_LTS 16
|
2022-01-12 10:18:55 +01:00
|
|
|
%define NODEJS_CURRENT 17
|
2020-06-09 13:19:22 +02:00
|
|
|
|
2021-06-22 00:33:02 +02:00
|
|
|
%if 0%{?suse_version} > 1500 || 0%{?fedora_version}
|
2021-06-10 12:30:57 +02:00
|
|
|
%bcond_without libalternatives
|
|
|
|
%else
|
2021-05-31 18:33:47 +02:00
|
|
|
%bcond_with libalternatives
|
2021-06-10 12:30:57 +02:00
|
|
|
%endif
|
2021-05-31 18:33:47 +02:00
|
|
|
|
2020-06-09 13:19:22 +02:00
|
|
|
# SLE-12 variants
|
|
|
|
%if 0%{?suse_version} < 1500
|
|
|
|
%define default_node_ver %NODEJS_LTS
|
2021-05-07 16:22:59 +02:00
|
|
|
|
|
|
|
%else
|
2020-06-09 13:19:22 +02:00
|
|
|
|
|
|
|
# TW
|
|
|
|
%if 0%{?suse_version} > 1500
|
|
|
|
%define default_node_ver %NODEJS_CURRENT
|
2021-02-05 16:24:41 +01:00
|
|
|
|
|
|
|
%else
|
2020-06-09 13:19:22 +02:00
|
|
|
|
|
|
|
# SLE-15 variants, variation based on SP
|
|
|
|
%if 0%{?sle_version} >= 150000 && 0%{?sle_version} < 150200
|
|
|
|
%define default_node_ver 10
|
2021-05-07 16:22:59 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if 0%{?sle_version} >= 150200 && 0%{?sle_version} < 150300
|
2021-02-05 16:16:15 +01:00
|
|
|
%define default_node_ver 12
|
2021-05-07 16:22:59 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if 0%{?sle_version} >= 150300 && 0%{?sle_version} < 150400
|
|
|
|
%define default_node_ver 14
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if 0%{?sle_version} >= 150400 && 0%{?sle_version} < 150500
|
2021-02-09 16:27:38 +01:00
|
|
|
%define default_node_ver %NODEJS_LTS
|
2020-06-09 13:19:22 +02:00
|
|
|
%endif
|
2021-05-07 16:22:59 +02:00
|
|
|
|
2021-02-05 16:24:41 +01:00
|
|
|
# SLE-15 variants
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# TW
|
2020-06-09 13:19:22 +02:00
|
|
|
%endif
|
|
|
|
|
2017-07-07 16:14:44 +02:00
|
|
|
Name: nodejs-common
|
2021-06-11 09:38:29 +02:00
|
|
|
Version: 5.0
|
2017-07-07 16:14:44 +02:00
|
|
|
Release: 0
|
2017-07-12 14:32:00 +02:00
|
|
|
Summary: Common files for the NodeJS ecosystem
|
2017-08-02 16:59:33 +02:00
|
|
|
License: MIT
|
2017-07-07 16:14:44 +02:00
|
|
|
Group: Development/Languages/NodeJS
|
2021-02-05 16:16:15 +01:00
|
|
|
URL: https://github.com/AdamMajer/nodejs-packaging
|
2019-02-01 16:58:55 +01:00
|
|
|
Source1: node.c
|
2018-06-22 15:55:12 +02:00
|
|
|
Source2: LICENSE
|
2017-07-07 16:14:44 +02:00
|
|
|
Requires: nodejs
|
|
|
|
Conflicts: nodejs4 < 4.8.4
|
|
|
|
Conflicts: nodejs6 < 6.11.1
|
|
|
|
Conflicts: nodejs7 < 7.10.1
|
|
|
|
Conflicts: nodejs8 < 8.1.4
|
2019-02-01 16:58:55 +01:00
|
|
|
BuildRequires: gcc
|
2021-05-31 18:33:47 +02:00
|
|
|
%if %{with libalternatives}
|
|
|
|
BuildRequires: libalternatives-devel
|
2021-05-31 18:43:15 +02:00
|
|
|
%define libalternatives_cflags -DHAVE_LIBALTERNATIVES_H
|
|
|
|
%define libalternatives_lflags -lalternatives
|
2021-05-31 18:33:47 +02:00
|
|
|
%endif
|
2017-07-07 16:14:44 +02:00
|
|
|
|
|
|
|
%description
|
|
|
|
Common NodeJS files that allow recursive invocation of Node executable
|
|
|
|
while retaining the same codestream version.
|
|
|
|
|
2020-06-09 12:43:01 +02:00
|
|
|
%package -n nodejs-default
|
2020-06-09 13:19:22 +02:00
|
|
|
Summary: Default version of nodejs
|
2020-06-09 12:43:01 +02:00
|
|
|
Group: Development/Languages/NodeJS
|
2020-06-09 13:19:22 +02:00
|
|
|
Requires: nodejs%{default_node_ver}
|
2020-06-09 12:43:01 +02:00
|
|
|
Requires: nodejs-common
|
2021-03-08 16:26:31 +01:00
|
|
|
Provides: nodejs = %default_node_ver
|
2021-05-07 16:22:59 +02:00
|
|
|
Provides: nodejs(engine) = %default_node_ver
|
2020-06-09 12:43:01 +02:00
|
|
|
|
2020-06-09 13:19:22 +02:00
|
|
|
%description -n nodejs-default
|
|
|
|
Depends on the most current and recommended version of nodejs for
|
|
|
|
the current architecture and codestream.
|
2020-06-09 12:43:01 +02:00
|
|
|
|
2020-06-09 13:19:22 +02:00
|
|
|
%package -n npm-default
|
|
|
|
Summary: Default version of npm
|
|
|
|
Group: Development/Languages/NodeJS
|
|
|
|
Requires: nodejs-default
|
|
|
|
Requires: npm%{default_node_ver}
|
2021-03-08 16:26:31 +01:00
|
|
|
Provides: npm = %default_node_ver
|
2020-06-09 12:43:01 +02:00
|
|
|
|
2020-06-09 13:19:22 +02:00
|
|
|
%description -n npm-default
|
|
|
|
Depends on the npm version associated with the current default
|
|
|
|
version of nodejs for the current architecture and codestream.
|
2020-06-09 12:43:01 +02:00
|
|
|
|
2020-06-09 13:19:22 +02:00
|
|
|
%package -n nodejs-devel-default
|
|
|
|
Summary: Headers for default version of nodejs
|
|
|
|
Group: Development/Languages/NodeJS
|
|
|
|
Requires: nodejs%{default_node_ver}-devel
|
|
|
|
Requires: npm-default
|
2021-03-09 18:36:48 +01:00
|
|
|
Provides: nodejs-devel = %default_node_ver
|
2020-06-09 12:43:01 +02:00
|
|
|
|
2020-06-09 13:19:22 +02:00
|
|
|
%description -n nodejs-devel-default
|
2020-06-09 12:43:01 +02:00
|
|
|
Depends on the most current and up-to-date version of nodejs for
|
|
|
|
the current architecture and codestream.
|
|
|
|
|
2017-07-07 16:14:44 +02:00
|
|
|
%prep
|
|
|
|
%build
|
2018-06-22 15:55:12 +02:00
|
|
|
cp %{S:2} .
|
2021-05-31 18:43:15 +02:00
|
|
|
gcc ${RPM_OPT_FLAGS} %?libalternatives_cflags -o node %{S:1} %?libalternatives_lflags
|
2018-06-22 15:55:12 +02:00
|
|
|
|
2021-02-05 16:16:15 +01:00
|
|
|
echo "Default Node version: " %{default_node_ver}
|
|
|
|
|
2017-07-07 16:14:44 +02:00
|
|
|
%install
|
2019-10-27 15:35:06 +01:00
|
|
|
install -D -m 0755 node %{buildroot}%{_bindir}/node
|
2019-10-28 12:15:13 +01:00
|
|
|
ln node %{buildroot}%{_bindir}/npm
|
|
|
|
ln node %{buildroot}%{_bindir}/npx
|
2017-07-07 16:14:44 +02:00
|
|
|
|
|
|
|
%files
|
2019-02-01 16:58:55 +01:00
|
|
|
%license LICENSE
|
2021-03-09 18:31:37 +01:00
|
|
|
%{_bindir}/node
|
|
|
|
%{_bindir}/npm
|
|
|
|
%{_bindir}/npx
|
2017-07-07 16:14:44 +02:00
|
|
|
|
2020-06-09 12:44:38 +02:00
|
|
|
%files -n nodejs-default
|
|
|
|
|
2020-06-09 13:19:22 +02:00
|
|
|
%files -n npm-default
|
|
|
|
|
|
|
|
%files -n nodejs-devel-default
|
|
|
|
|
2017-07-07 16:14:44 +02:00
|
|
|
%changelog
|