]>
Commit | Line | Data |
---|---|---|
210abff9 | 1 | Summary: Asynchronous JavaScript Engine |
2 | Name: nodejs | |
7c7c1bb0 ER |
3 | Version: 0.6.19 |
4 | Release: 1 | |
e85103e0 ER |
5 | License: BSD and MIT and ASL 2.0 and GPLv3 |
6 | Group: Development/Languages | |
c3b531ba | 7 | URL: http://www.nodejs.org/ |
cb51f00f | 8 | Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz |
7c7c1bb0 | 9 | # Source0-md5: f5669a9717422b811c6bad1cc961b1e5 |
fb6f511a | 10 | Patch1: %{name}-soname.patch |
a6070ceb ER |
11 | # force node to use /usr/lib/node as the systemwide module directory |
12 | Patch2: %{name}-libpath.patch | |
13 | # use /usr/lib64/node as an arch-specific module dir when appropriate | |
14 | Patch3: %{name}-lib64path.patch | |
c4aa3bb0 | 15 | # Fix linking of zlib |
16 | Patch4: %{name}-shared-zlib.patch | |
a3293030 | 17 | BuildRequires: c-ares-devel >= 1.7.4 |
12a49d35 | 18 | BuildRequires: gcc >= 5:4.0 |
210abff9 | 19 | BuildRequires: libeio-devel |
a3293030 | 20 | BuildRequires: libev-devel >= 4.0.0 |
210abff9 | 21 | BuildRequires: libstdc++-devel |
a6070ceb ER |
22 | BuildRequires: python >= 1:2.5.2 |
23 | BuildRequires: python-jsmin | |
12a49d35 | 24 | BuildRequires: rpm >= 4.4.9-56 |
d44c8857 | 25 | BuildRequires: rpmbuild(macros) >= 1.219 |
a6070ceb | 26 | BuildRequires: v8-devel >= 3.6 |
210abff9 | 27 | ExclusiveArch: %{ix86} %{x8664} arm |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
29 | ||
30 | %description | |
c3b531ba ER |
31 | Node.js is a platform built on Chrome's JavaScript runtime for easily |
32 | building fast, scalable network applications. Node.js uses an | |
33 | event-driven, non-blocking I/O model that makes it lightweight and | |
34 | efficient, perfect for data-intensive real-time applications that run | |
35 | across distributed devices. | |
210abff9 | 36 | |
210abff9 | 37 | %package devel |
12a49d35 | 38 | Summary: Development headers for nodejs |
210abff9 | 39 | Group: Development/Libraries |
a8f57a3f | 40 | Requires: %{name} = %{version}-%{release} |
d44c8857 ER |
41 | Requires: %{name}-waf = %{version}-%{release} |
42 | Requires: gcc | |
43 | Requires: libstdc++-devel | |
fae304aa | 44 | Requires: v8-devel |
210abff9 | 45 | |
46 | %description devel | |
12a49d35 | 47 | Development headers for nodejs. |
210abff9 | 48 | |
a6070ceb ER |
49 | %package doc |
50 | Summary: Evented I/O for V8 JavaScript - documentation | |
51 | Group: Documentation | |
52 | ||
53 | %description doc | |
54 | Node.js is a server-side JavaScript environment that uses an | |
55 | asynchronous event-driven model. Node's goal is to provide an easy way | |
56 | to build scalable network programs. | |
57 | ||
58 | This package contains the documentation for nodejs. | |
59 | ||
60 | %package waf | |
61 | Summary: Evented I/O for V8 JavaScript - customized WAF build system | |
62 | Group: Libraries | |
63 | Requires: %{name} = %{version}-%{release} | |
64 | ||
65 | %description waf | |
66 | Node.js is a server-side JavaScript environment that uses an | |
67 | asynchronous event-driven model. Node's goal is to provide an easy way | |
68 | to build scalable network programs. | |
69 | ||
70 | This package contains the customized version of the WAF build system | |
71 | used by Node.js and many of its modules. | |
72 | ||
210abff9 | 73 | %prep |
74 | %setup -q -n node-v%{version} | |
fb6f511a | 75 | %patch1 -p1 |
a6070ceb ER |
76 | %if %{_lib} == "lib64" |
77 | %patch3 -p1 | |
78 | %else | |
79 | %patch2 -p1 | |
80 | %endif | |
210abff9 | 81 | |
c4aa3bb0 | 82 | %patch4 -p1 |
83 | ||
bc5a5fec ER |
84 | # fix #!/usr/bin/env python -> #!/usr/bin/python: |
85 | grep -rl 'bin/env python' tools | xargs %{__sed} -i -e '1s,^#!.*python,#!%{__python},' | |
86 | ||
210abff9 | 87 | %build |
a6070ceb ER |
88 | CFLAGS="%{rpmcflags} -fPIC" |
89 | CXXFLAGS="%{rpmcxxflags} -fPIC" | |
210abff9 | 90 | LDFLAGS="%{rpmcflags}" |
91 | %if "%{pld_release}" == "ac" | |
8791ea86 ER |
92 | CC="%{__cc}4" |
93 | CXX="%{__cxx}4" | |
210abff9 | 94 | %else |
8791ea86 ER |
95 | CC="%{__cc}" |
96 | CXX="%{__cxx}" | |
210abff9 | 97 | %endif |
58494f0c | 98 | export CFLAGS LDFLAGS CXXFLAGS CC CXX |
210abff9 | 99 | |
cb51f00f ER |
100 | # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc' |
101 | CC=${CC#ccache } | |
102 | ||
a6070ceb | 103 | # NOT autoconf so dont use macro |
7372d27d | 104 | export PYTHONPATH=tools |
a6070ceb | 105 | ./configure \ |
b52d635c | 106 | --shared-cares \ |
a6070ceb ER |
107 | --shared-v8 \ |
108 | --shared-zlib \ | |
7223b5ac | 109 | --without-npm \ |
a8f57a3f | 110 | --libdir=%{_libdir} \ |
210abff9 | 111 | --prefix=%{_prefix} |
112 | ||
bc5a5fec | 113 | # build library |
a6070ceb ER |
114 | %{__make} dynamiclib |
115 | %{__make} program | |
7372d27d | 116 | |
a6070ceb ER |
117 | # relink with shared lib |
118 | $CC -o out/Release/node src/node_main.cc -Isrc -Ideps/uv/include -lnode -Lout/Release | |
210abff9 | 119 | |
120 | %install | |
121 | rm -rf $RPM_BUILD_ROOT | |
a6070ceb ER |
122 | %{__make} install \ |
123 | DESTDIR=$RPM_BUILD_ROOT | |
124 | ||
e85103e0 | 125 | # for compat of fedora derivered scripts (shebangs) |
c3b531ba ER |
126 | ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs |
127 | ||
e85103e0 ER |
128 | # globally installed node modules (noarch) |
129 | install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules | |
130 | ||
131 | # default searchpaths | |
132 | install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node | |
133 | ||
a6070ceb | 134 | # install shared lib |
7372d27d | 135 | export PYTHONPATH=tools |
8791ea86 | 136 | %{__python} tools/waf-light install \ |
7372d27d | 137 | --product-type=cshlib \ |
138 | --destdir=$RPM_BUILD_ROOT | |
139 | ||
87c4fdf2 ER |
140 | chmod a+x $RPM_BUILD_ROOT%{_libdir}/*.so* |
141 | ||
a6070ceb ER |
142 | # create pkgconfig |
143 | install -d $RPM_BUILD_ROOT%{_pkgconfigdir} | |
144 | cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc | |
145 | version=%{version} | |
c3b531ba | 146 | prefix=%{_prefix} |
87c4fdf2 | 147 | libdir=${prefix}/%{_lib} |
a6070ceb ER |
148 | includedir=${prefix}/include/node |
149 | ||
150 | Name: nodejs | |
151 | Description: Evented I/O for V8 JavaScript. | |
152 | Version: ${version} | |
153 | Cflags: -I${includedir} | |
154 | EOF | |
a752c1c0 | 155 | |
bc5a5fec ER |
156 | %py_ocomp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin |
157 | %py_comp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin | |
158 | # TODO: check it first | |
159 | #%%py_postclean %{_libdir}/node/wafadmin | |
160 | ||
a6070ceb | 161 | # install documentation |
6f7eebb5 ER |
162 | install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version} |
163 | cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version} | |
164 | rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown | |
165 | rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json | |
a6070ceb | 166 | |
210abff9 | 167 | %clean |
168 | rm -rf $RPM_BUILD_ROOT | |
169 | ||
7372d27d | 170 | %post -p /sbin/ldconfig |
171 | %postun -p /sbin/ldconfig | |
172 | ||
210abff9 | 173 | %files |
174 | %defattr(644,root,root,755) | |
a6070ceb | 175 | %doc README.md AUTHORS ChangeLog LICENSE |
210abff9 | 176 | %attr(755,root,root) %{_bindir}/node |
c3b531ba | 177 | %attr(755,root,root) %{_bindir}/nodejs |
7372d27d | 178 | %attr(755,root,root) %{_libdir}/libnode.so.*.*.* |
e85103e0 | 179 | %ghost %{_libdir}/libnode.so.6 |
8791ea86 | 180 | %dir %{_libdir}/node |
e85103e0 ER |
181 | %dir %{_prefix}/lib/node |
182 | %dir %{_prefix}/lib/node_modules | |
210abff9 | 183 | %{_mandir}/man1/node.1* |
184 | ||
210abff9 | 185 | %files devel |
186 | %defattr(644,root,root,755) | |
7372d27d | 187 | %{_libdir}/libnode.so |
58494f0c | 188 | %{_includedir}/node |
a6070ceb ER |
189 | %{_pkgconfigdir}/nodejs.pc |
190 | ||
191 | %files doc | |
192 | %defattr(644,root,root,755) | |
193 | %doc %{_docdir}/%{name}-doc-%{version} | |
194 | ||
195 | %files waf | |
196 | %defattr(644,root,root,755) | |
c6be74cc | 197 | %attr(755,root,root) %{_bindir}/node-waf |
afb1c7e5 PZ |
198 | %dir %{_libdir}/node/wafadmin |
199 | %dir %{_libdir}/node/wafadmin/Tools | |
bc5a5fec | 200 | %{_libdir}/node/wafadmin/*.py[co] |
afb1c7e5 PZ |
201 | %{_libdir}/node/wafadmin/*.py |
202 | %{_libdir}/node/wafadmin/Tools/*.py | |
bc5a5fec | 203 | %{_libdir}/node/wafadmin/Tools/*.py[co] |