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