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