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