]> git.pld-linux.org Git - packages/nodejs.git/blame - nodejs.spec
up to 0.10.33, insecure ssl protocols not negotiation by default
[packages/nodejs.git] / nodejs.spec
CommitLineData
210abff9 1Summary: Asynchronous JavaScript Engine
2Name: nodejs
295463b0
ER
3Version: 0.10.33
4Release: 1
d5764a43 5License: BSD and MIT and Apache v2.0 and GPL v3
e85103e0 6Group: Development/Languages
cb51f00f 7Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
295463b0 8# Source0-md5: 626ca8a4f8fec4df49c78ed53d46f1f7
4174c079 9Patch1: %{name}-shared.patch
a6070ceb
ER
10# force node to use /usr/lib/node as the systemwide module directory
11Patch2: %{name}-libpath.patch
12# use /usr/lib64/node as an arch-specific module dir when appropriate
13Patch3: %{name}-lib64path.patch
58e86022 14Patch4: %{name}-use-system-certs.patch
1385a038 15Patch5: uv-fpic.patch
be62a70f
ER
16# The invalid UTF8 fix has been reverted since this breaks v8 API, which cannot
17# be done in a stable distribution release. This build of nodejs will behave as
18# if NODE_INVALID_UTF8 was set. For more information on the implications, see:
19# http://blog.nodejs.org/2014/06/16/openssl-and-breaking-utf-8-change/
20Patch6: %{name}-revert-utf8-v8.patch
21Patch7: %{name}-revert-utf8-node.patch
4174c079 22URL: http://www.nodejs.org/
c1c359b8 23BuildRequires: c-ares-devel
12a49d35 24BuildRequires: gcc >= 5:4.0
e427e9b0 25BuildRequires: http-parser-devel >= 2.0
210abff9 26BuildRequires: libstdc++-devel
d8825fb6 27BuildRequires: libuv-devel >= 0.10
cd4c73aa
ER
28BuildRequires: openssl-devel
29BuildRequires: pkgconfig
a6070ceb
ER
30BuildRequires: python >= 1:2.5.2
31BuildRequires: python-jsmin
12a49d35 32BuildRequires: rpm >= 4.4.9-56
d44c8857 33BuildRequires: rpmbuild(macros) >= 1.219
536f9f5a 34BuildRequires: sed >= 4.0
1ed21df5 35BuildRequires: v8-devel >= 3.15.11.10
cd4c73aa 36BuildRequires: zlib-devel
58e86022 37Requires: ca-certificates
5ef76b51 38Obsoletes: nodejs-waf
210abff9 39ExclusiveArch: %{ix86} %{x8664} arm
40BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41
dc60a63b
ER
42%define sover %(echo %{version} | cut -d. -f2)
43
210abff9 44%description
c3b531ba
ER
45Node.js is a platform built on Chrome's JavaScript runtime for easily
46building fast, scalable network applications. Node.js uses an
47event-driven, non-blocking I/O model that makes it lightweight and
48efficient, perfect for data-intensive real-time applications that run
49across distributed devices.
210abff9 50
210abff9 51%package devel
12a49d35 52Summary: Development headers for nodejs
210abff9 53Group: Development/Libraries
a8f57a3f 54Requires: %{name} = %{version}-%{release}
96f19ba5 55Requires: c-ares-devel
d44c8857 56Requires: gcc
96f19ba5 57Requires: http-parser-devel
d44c8857 58Requires: libstdc++-devel
96f19ba5
ER
59Requires: libuv-devel
60Requires: openssl-devel
fae304aa 61Requires: v8-devel
96f19ba5 62Requires: zlib-devel
210abff9 63
64%description devel
12a49d35 65Development headers for nodejs.
210abff9 66
a6070ceb
ER
67%package doc
68Summary: Evented I/O for V8 JavaScript - documentation
69Group: Documentation
70
71%description doc
72Node.js is a server-side JavaScript environment that uses an
73asynchronous event-driven model. Node's goal is to provide an easy way
74to build scalable network programs.
75
76This package contains the documentation for nodejs.
77
210abff9 78%prep
79%setup -q -n node-v%{version}
a600c300 80%patch1 -p1
a6070ceb
ER
81%if %{_lib} == "lib64"
82%patch3 -p1
83%else
84%patch2 -p1
85%endif
58e86022 86%patch4 -p1
1385a038 87%patch5 -p1
be62a70f
ER
88%patch6 -p1
89%patch7 -p1
c4aa3bb0 90
536f9f5a
ER
91grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
92
e3e8568d
ER
93rm -r deps
94
210abff9 95%build
a11025a6
ER
96# CC used only to detect if CC is clang, not used for compiling
97CC="%{__cc}" \
98CXX="%{__cxx}" \
dc60a63b 99GYP_DEFINES="soname_version=%{sover}" \
a6070ceb 100./configure \
a6070ceb
ER
101 --shared-v8 \
102 --shared-zlib \
be06d6d0 103 --shared-openssl \
c1c359b8 104 --shared-cares \
8939ac26 105 --shared-libuv \
e427e9b0 106 --shared-http-parser \
7223b5ac 107 --without-npm \
c1c359b8 108 --without-dtrace \
210abff9 109 --prefix=%{_prefix}
110
a11025a6
ER
111# add LFS defines from libuv (RHBZ#892601)
112# CXXFLAGS must be exported, as it is needed for make, not gyp
113CXXFLAGS="%{rpmcxxflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC" \
114LDFLAGS="%{rpmldflags}" \
115%{__make} -C out V=1 BUILDTYPE=Release
210abff9 116
117%install
118rm -rf $RPM_BUILD_ROOT
be06d6d0
AS
119%{__make} justinstall \
120 DESTDIR=$RPM_BUILD_ROOT \
4174c079
ER
121 LIBDIR=%{_lib}
122
f9cee3b6 123lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
4174c079
ER
124ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
125ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
a6070ceb 126
c7898157
ER
127echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
128
1ed21df5 129install -d $RPM_BUILD_ROOT%{_includedir}/node
4174c079 130cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
d5764a43
ER
131
132# install for node-gyp
133install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
134cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
135ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
1ed21df5 136
e85103e0 137# for compat of fedora derivered scripts (shebangs)
c3b531ba
ER
138ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
139
e85103e0
ER
140# globally installed node modules (noarch)
141install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
142
143# default searchpaths
144install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
145
a6070ceb
ER
146# create pkgconfig
147install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
148cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
149version=%{version}
c3b531ba 150prefix=%{_prefix}
87c4fdf2 151libdir=${prefix}/%{_lib}
a6070ceb
ER
152includedir=${prefix}/include/node
153
154Name: nodejs
155Description: Evented I/O for V8 JavaScript.
156Version: ${version}
157Cflags: -I${includedir}
158EOF
a752c1c0 159
a6070ceb 160# install documentation
6f7eebb5
ER
161install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
162cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
163rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
164rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
a6070ceb 165
210abff9 166%clean
167rm -rf $RPM_BUILD_ROOT
168
4174c079 169%post -p /sbin/ldconfig
7372d27d 170%postun -p /sbin/ldconfig
171
210abff9 172%files
173%defattr(644,root,root,755)
a6070ceb 174%doc README.md AUTHORS ChangeLog LICENSE
210abff9 175%attr(755,root,root) %{_bindir}/node
c3b531ba 176%attr(755,root,root) %{_bindir}/nodejs
a600c300 177%attr(755,root,root) %{_libdir}/libnode.so.*.*.*
2492de83 178%ghost %{_libdir}/libnode.so.10
a600c300 179%if "%{_lib}" != "lib"
8791ea86 180%dir %{_libdir}/node
a600c300
ŁC
181%endif
182%dir %{_prefix}/lib/node
e85103e0 183%dir %{_prefix}/lib/node_modules
210abff9 184%{_mandir}/man1/node.1*
c7898157 185%{_mandir}/man1/nodejs.1
210abff9 186
210abff9 187%files devel
188%defattr(644,root,root,755)
a600c300 189%{_libdir}/libnode.so
58494f0c 190%{_includedir}/node
a6070ceb 191%{_pkgconfigdir}/nodejs.pc
d5764a43 192%{_usrsrc}/%{name}
a6070ceb
ER
193
194%files doc
195%defattr(644,root,root,755)
196%doc %{_docdir}/%{name}-doc-%{version}
This page took 0.050278 seconds and 4 git commands to generate.