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