]> git.pld-linux.org Git - packages/nodejs.git/blame - nodejs.spec
- package systemtap probes
[packages/nodejs.git] / nodejs.spec
CommitLineData
cc3de6db
ER
1# TODO
2# - unpackaged files
3# /usr/share/doc/node/gdbinit
cc3de6db 4
29d6d704 5# Conditional build:
4a5eff4b 6%bcond_without system_uv # system uv
8c0b403f 7%bcond_with shared # build libnode.so shared library
29d6d704 8
8611106e
ER
9# NOTES:
10# - https://nodejs.org/en/download/releases/
11
e9b6043f
ER
12# NODE_MODULE_VERSION refers to the ABI (application binary interface) version
13# number of Node.js, used to determine which versions of Node.js compiled C++
14# add-on binaries can be loaded in to without needing to be re-compiled. It
15# used to be stored as hex value in earlier versions, but is now represented as
16# an integer.
b65ad44c 17%define node_module_version 48
210abff9 18Summary: Asynchronous JavaScript Engine
9a1229ff 19Summary(pl.UTF-8): Asynchroniczny silnik JavaScriptu
210abff9 20Name: nodejs
b65ad44c
ER
21# 6.9 is LTS, Active LTS: 2018-04-18, EOL: 2019-04-18
22# https://github.com/nodejs/LTS
db609ce2 23Version: 6.9.4
8a005758 24Release: 1
d5764a43 25License: BSD and MIT and Apache v2.0 and GPL v3
e85103e0 26Group: Development/Languages
8611106e 27Source0: https://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
db609ce2 28# Source0-md5: 3795199b5950b25179248847b1a5fc86
4174c079 29Patch1: %{name}-shared.patch
a6070ceb
ER
30# force node to use /usr/lib/node as the systemwide module directory
31Patch2: %{name}-libpath.patch
32# use /usr/lib64/node as an arch-specific module dir when appropriate
33Patch3: %{name}-lib64path.patch
58e86022 34Patch4: %{name}-use-system-certs.patch
1385a038 35Patch5: uv-fpic.patch
8611106e 36URL: https://nodejs.org/
8c0b403f 37BuildRequires: gcc >= 6:4.8
318ea6db 38BuildRequires: http-parser-devel >= 2.7.0
8c0b403f 39BuildRequires: libstdc++-devel >= 6:4.8
4a5eff4b 40%{?with_system_uv:BuildRequires: libuv-devel >= 1.6.0}
94f7bd52 41BuildRequires: openssl-devel >= 1.0.1
cd4c73aa 42BuildRequires: pkgconfig
91adacca 43BuildRequires: python >= 1:2.7
a6070ceb 44BuildRequires: python-jsmin
8c0b403f 45BuildRequires: python-modules >= 1:2.7
12a49d35 46BuildRequires: rpm >= 4.4.9-56
d44c8857 47BuildRequires: rpmbuild(macros) >= 1.219
536f9f5a 48BuildRequires: sed >= 4.0
cd4c73aa 49BuildRequires: zlib-devel
58e86022 50Requires: ca-certificates
8d8e2928 51Provides: nodejs(engine) = %{version}
56d9fb33 52Provides: nodejs(module-version) = %{node_module_version}
5ef76b51 53Obsoletes: nodejs-waf
210abff9 54ExclusiveArch: %{ix86} %{x8664} arm
55BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
56
dc60a63b 57%define sover %(echo %{version} | cut -d. -f2)
05e85ef1
ER
58# add macro, so adapter won't replace it back literal
59%define doc_ver %{version}
dc60a63b 60
210abff9 61%description
c3b531ba
ER
62Node.js is a platform built on Chrome's JavaScript runtime for easily
63building fast, scalable network applications. Node.js uses an
64event-driven, non-blocking I/O model that makes it lightweight and
65efficient, perfect for data-intensive real-time applications that run
66across distributed devices.
210abff9 67
9a1229ff
JB
68%description -l pl.UTF-8
69Node.js to platforma zbudowana w opacriu o silnik JavaScriptu
70przeglądarki Chrome, służąca do tworzenia szybkich, skalowalnych
71aplikacji sieciowych. Node.js wykorzystuje nieblokujący model
72wejścia/wyjścia sterowany zdarzeniami, dzięki czemu jest lekki i
73wydajny, dobrze nadający się do aplikacji przetwarzających duże
74ilości danych w czasie rzeczywistym, uruchamianych na rozproszonych
75urządzeniach.
76
210abff9 77%package devel
12a49d35 78Summary: Development headers for nodejs
9a1229ff 79Summary(pl.UTF-8): Pliki nagłówkowe nodejs
210abff9 80Group: Development/Libraries
a8f57a3f 81Requires: %{name} = %{version}-%{release}
d44c8857 82Requires: gcc
94f7bd52 83Requires: http-parser-devel >= 2.5.0
d44c8857 84Requires: libstdc++-devel
94f7bd52 85%{?with_system_uv:Requires: libuv-devel >= 1.6.0}
96f19ba5 86Requires: openssl-devel
96f19ba5 87Requires: zlib-devel
210abff9 88
89%description devel
12a49d35 90Development headers for nodejs.
210abff9 91
9a1229ff
JB
92%description devel -l pl.UTF-8
93Pliki nagłówkowe nodejs.
94
a6070ceb 95%package doc
9a1229ff
JB
96Summary: Documentation for Node.js engine
97Summary(pl.UTF-8): Dokumentacja silnika Node.js
a6070ceb 98Group: Documentation
05e85ef1 99URL: https://nodejs.org/dist/v%{doc_ver}/docs/api
b6b2dd9b
ER
100%if "%{_rpmversion}" >= "5"
101BuildArch: noarch
102%endif
a6070ceb
ER
103
104%description doc
105Node.js is a server-side JavaScript environment that uses an
106asynchronous event-driven model. Node's goal is to provide an easy way
107to build scalable network programs.
108
9a1229ff
JB
109This package contains the documentation for Node.js.
110
111%description doc -l pl.UTF-8
112Node.js to serwerowe środowisko JavaScriptu wykorzystujące
113asynchroniczny model sterowany zdarzeniami. Celem Node jest
114zapewnienie łatwego sposobu tworzenia skalowalnych programów
115sieciowych.
116
117Ten pakiet zawiera dokumentację Node.js.
a6070ceb 118
8c0b403f
JB
119%package -n systemtap-nodejs
120Summary: systemtap/dtrace probes for Node.js
121Summary(pl.UTF-8): Sondy systemtap/dtrace dla Node.js
122Group: Development/Tools
123Requires: %{name} = %{version}-%{release}
124Requires: systemtap-client
125
126%description -n systemtap-nodejs
127systemtap/dtrace probes for Node.js.
128
129%description -n systemtap-nodejs -l pl.UTF-8
130Sondy systemtap/dtrace dla Node.js.
131
210abff9 132%prep
133%setup -q -n node-v%{version}
9ea1462f 134%{?with_shared:%patch1 -p1}
3de234b3 135#%patch1 -p1
a6070ceb
ER
136%if %{_lib} == "lib64"
137%patch3 -p1
138%else
139%patch2 -p1
140%endif
58e86022 141%patch4 -p1
9a1229ff 142%{__rm} src/node_root_certs.h
3de234b3 143#%{?with_system_uv:%patch5 -p1}
c4aa3bb0 144
536f9f5a
ER
145grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
146
9a1229ff
JB
147%{__rm} -r deps/npm
148%{__rm} -r deps/http_parser
149%{__rm} -r deps/openssl
150%{?with_system_uv:%{__rm} -r deps/uv}
151%{__rm} -r deps/zlib
e3e8568d 152
210abff9 153%build
c8ef6556 154ver=$(awk '/#define NODE_MODULE_VERSION/{print $3}' src/node_version.h)
145d5ed0 155test "$ver" = "%{node_module_version}"
56d9fb33 156
a11025a6
ER
157# CC used only to detect if CC is clang, not used for compiling
158CC="%{__cc}" \
159CXX="%{__cxx}" \
dc60a63b 160GYP_DEFINES="soname_version=%{sover}" \
a6070ceb 161./configure \
3de234b3 162 %{?0:--shared-cares} \
8c0b403f 163 --shared-openssl \
e427e9b0 164 --shared-http-parser \
8c0b403f
JB
165 %{?with_system_uv:--shared-libuv} \
166 --shared-zlib \
7223b5ac 167 --without-npm \
c1c359b8 168 --without-dtrace \
210abff9 169 --prefix=%{_prefix}
170
a11025a6
ER
171# add LFS defines from libuv (RHBZ#892601)
172# CXXFLAGS must be exported, as it is needed for make, not gyp
173CXXFLAGS="%{rpmcxxflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC" \
174LDFLAGS="%{rpmldflags}" \
9a1229ff
JB
175%{__make} -C out \
176 BUILDTYPE=Release \
177 V=1
210abff9 178
179%install
180rm -rf $RPM_BUILD_ROOT
9a1229ff 181
9618d15b 182%{__python} tools/install.py install "$RPM_BUILD_ROOT" "%{_prefix}"
4174c079 183
9ea1462f 184%if %{with shared}
f9cee3b6 185lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
4174c079
ER
186ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
187ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
9ea1462f 188%endif
a6070ceb 189
c7898157
ER
190echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
191
1ed21df5 192install -d $RPM_BUILD_ROOT%{_includedir}/node
4174c079 193cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
d5764a43
ER
194
195# install for node-gyp
196install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
197cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
198ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
1ed21df5 199
e85103e0 200# for compat of fedora derivered scripts (shebangs)
c3b531ba
ER
201ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
202
e85103e0
ER
203# globally installed node modules (noarch)
204install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
205
206# default searchpaths
207install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
208
a6070ceb
ER
209# create pkgconfig
210install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
211cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
212version=%{version}
c3b531ba 213prefix=%{_prefix}
87c4fdf2 214libdir=${prefix}/%{_lib}
a6070ceb
ER
215includedir=${prefix}/include/node
216
217Name: nodejs
218Description: Evented I/O for V8 JavaScript.
219Version: ${version}
220Cflags: -I${includedir}
221EOF
a752c1c0 222
a6070ceb 223# install documentation
6f7eebb5
ER
224install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
225cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
9a1229ff
JB
226%{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.md
227%{__rm} $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
a6070ceb 228
210abff9 229%clean
230rm -rf $RPM_BUILD_ROOT
231
9ea1462f 232%if %{with shared}
4174c079 233%post -p /sbin/ldconfig
7372d27d 234%postun -p /sbin/ldconfig
9ea1462f 235%endif
7372d27d 236
210abff9 237%files
238%defattr(644,root,root,755)
9618d15b 239%doc README.md AUTHORS CHANGELOG.md ROADMAP.md LICENSE
210abff9 240%attr(755,root,root) %{_bindir}/node
c3b531ba 241%attr(755,root,root) %{_bindir}/nodejs
9ea1462f 242%if %{with shared}
a600c300 243%attr(755,root,root) %{_libdir}/libnode.so.*.*.*
9a1229ff 244%attr(755,root,root) %ghost %{_libdir}/libnode.so.10
9ea1462f 245%endif
a600c300 246%if "%{_lib}" != "lib"
8791ea86 247%dir %{_libdir}/node
a600c300
ŁC
248%endif
249%dir %{_prefix}/lib/node
e85103e0 250%dir %{_prefix}/lib/node_modules
210abff9 251%{_mandir}/man1/node.1*
9a1229ff 252%{_mandir}/man1/nodejs.1*
210abff9 253
210abff9 254%files devel
255%defattr(644,root,root,755)
9ea1462f 256%if %{with shared}
9a1229ff 257%attr(755,root,root) %{_libdir}/libnode.so
9ea1462f 258%endif
58494f0c 259%{_includedir}/node
a6070ceb 260%{_pkgconfigdir}/nodejs.pc
d5764a43 261%{_usrsrc}/%{name}
a6070ceb
ER
262
263%files doc
264%defattr(644,root,root,755)
265%doc %{_docdir}/%{name}-doc-%{version}
8c0b403f
JB
266
267%files -n systemtap-nodejs
268%defattr(644,root,root,755)
269%{_datadir}/systemtap/tapset/node.stp
This page took 0.128385 seconds and 4 git commands to generate.