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