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