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