nodejs-nan/nodejs-nan.spec

68 lines
2.2 KiB
RPMSpec
Raw Normal View History

2020-08-21 16:53:17 +08:00
%global npm_name nan
%{?nodejs_find_provides_and_requires}
Summary: Native Abstractions for Node.js
Name: nodejs-%{npm_name}
2023-10-30 20:07:23 +08:00
Version: 2.18.0
2020-08-21 16:53:17 +08:00
Release: 1
License: MIT
URL: https://github.com/nodejs/nan
2023-10-30 20:07:23 +08:00
Source0: https://github.com/nodejs/nan/archive/v%{version}/%{npm_name}-%{version}.tar.gz
2020-08-21 16:53:17 +08:00
BuildRequires: nodejs-packaging
BuildArch: noarch
ExclusiveArch: %{nodejs_arches} noarch
Provides: nodejs-nan-devel = %{version}-%{release}
Provides: nodejs-nan-static = %{version}-%{release}
%description
A header file filled with macro and utility goodness
for making add on development for Node.js easier across
versions 0.8, 0.10 and 0.11, and eventually 0.12.
Thanks to the crazy changes in V8 (and some in Node core),
keeping native add-on compiling happily across versions,
particularly 0.10 to 0.11/0.12, is a minor nightmare.
The goal of this project is to store all logic necessary
to develop native Node.js add-on without having to inspect
NODE_MODULE_VERSION and get yourself into a macro-tangle.
%prep
2023-10-30 20:07:23 +08:00
%autosetup -n %{npm_name}-%{version} -p1
2020-08-21 16:53:17 +08:00
%build
%install
mkdir -p %{buildroot}%{nodejs_sitelib}/%{npm_name}@2
cp -pr include_dirs.js nan*.h package.json %{buildroot}%{nodejs_sitelib}/%{npm_name}@2
ln -sf nan@2 %{buildroot}%{nodejs_sitelib}/%{npm_name}
%files
%doc CHANGELOG.md README.md doc
%license LICENSE.md
%{nodejs_sitelib}/%{npm_name}
%{nodejs_sitelib}/%{npm_name}@2
%pretrans -p <lua>
-- Define the path to directory being replaced below.
-- DO NOT add a trailing slash at the end.
path = "%{nodejs_sitelib}/%{npm_name}"
st = posix.stat(path)
if st and st.type == "directory" then
status = os.rename(path, path .. ".rpmmoved")
if not status then
suffix = 0
while not status do
suffix = suffix + 1
status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
end
os.rename(path, path .. ".rpmmoved")
end
end
%changelog
2023-10-30 20:07:23 +08:00
* Mon Oct 30 2023 yaoxin <yao_xin001@hoperun.com> - 2.18.0-1
- Upgrade to 2.18.0
2022-06-30 19:48:46 +08:00
* Wed Jul 06 2022 xigaoxinyan <xigaoxinyan@h-partners.com> - 2.16.0-1
- Upgrade to 2.16.0
2020-08-21 16:53:17 +08:00
* Mon Aug 17 2020 wutao <wutao61@huawei.com> - 2.13.2-1
- Package init