]>
Commit | Line | Data |
---|---|---|
210abff9 | 1 | |
210abff9 | 2 | Summary: Asynchronous JavaScript Engine |
3 | Name: nodejs | |
e47cb1b9 | 4 | Version: 0.4.2 |
210abff9 | 5 | Release: 0 |
6 | License: BSD | |
7 | Group: Libraries | |
8 | URL: http://nodejs.org/ | |
9 | Source0: http://nodejs.org/dist/node-v%{version}.tar.gz | |
e47cb1b9 | 10 | # Source0-md5: de4754e23bb382172bc3bbbc288fb884 |
a3293030 | 11 | Patch0: %{name}-ev-multiplicity.patch |
a8f57a3f | 12 | Patch2: %{name}-soname.patch |
a3293030 | 13 | BuildRequires: c-ares-devel |
14 | BuildRequires: c-ares-devel >= 1.7.4 | |
12a49d35 | 15 | BuildRequires: gcc >= 5:4.0 |
210abff9 | 16 | BuildRequires: libeio-devel |
a3293030 | 17 | BuildRequires: libev-devel >= 4.0.0 |
210abff9 | 18 | BuildRequires: libstdc++-devel |
19 | BuildRequires: python | |
12a49d35 | 20 | BuildRequires: rpm >= 4.4.9-56 |
2bc97491 | 21 | BuildRequires: v8-devel >= 3.1.5 |
a752c1c0 | 22 | BuildRequires: waf |
210abff9 | 23 | ExclusiveArch: %{ix86} %{x8664} arm |
24 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
25 | ||
e47cb1b9 | 26 | %define _plainlibdir %{_prefix}/lib |
27 | ||
210abff9 | 28 | %description |
29 | Node's goal is to provide an easy way to build scalable network | |
30 | programs. In the above example, the two second delay does not prevent | |
31 | the server from handling new requests. Node tells the operating system | |
32 | (through epoll, kqueue, /dev/poll, or select) that it should be | |
33 | notified when the 2 seconds are up or if a new connection is made -- | |
34 | then it goes to sleep. If someone new connects, then it executes the | |
35 | callback, if the timeout expires, it executes the inner callback. Each | |
36 | connection is only a small heap allocation. | |
37 | ||
210abff9 | 38 | %package devel |
12a49d35 | 39 | Summary: Development headers for nodejs |
210abff9 | 40 | Group: Development/Libraries |
a752c1c0 | 41 | Requires: waf |
a8f57a3f | 42 | Requires: %{name} = %{version}-%{release} |
210abff9 | 43 | |
44 | %description devel | |
12a49d35 | 45 | Development headers for nodejs. |
210abff9 | 46 | |
47 | %prep | |
48 | %setup -q -n node-v%{version} | |
a3293030 | 49 | %patch0 -p1 |
a8f57a3f | 50 | %patch2 -p1 |
210abff9 | 51 | |
52 | %build | |
53 | # build library | |
210abff9 | 54 | CFLAGS="%{rpmcflags}" |
55 | CXXFLAGS="%{rpmcxxflags}" | |
56 | LDFLAGS="%{rpmcflags}" | |
57 | %if "%{pld_release}" == "ac" | |
58 | CC=%{__cc}4 | |
59 | CXX=%{__cxx}4 | |
60 | %else | |
61 | CC=%{__cc} | |
62 | CXX=%{__cxx} | |
63 | %endif | |
58494f0c | 64 | export CFLAGS LDFLAGS CXXFLAGS CC CXX |
210abff9 | 65 | |
58494f0c ER |
66 | export PYTHONPATH=tools |
67 | %waf configure \ | |
b52d635c | 68 | --shared-v8 \ |
69 | --shared-cares \ | |
70 | --shared-libev \ | |
a8f57a3f | 71 | --libdir=%{_libdir} \ |
210abff9 | 72 | --prefix=%{_prefix} |
73 | ||
a8f57a3f | 74 | %waf build \ |
75 | --product-type=cshlib | |
76 | ||
77 | $CC -o node -Isrc src/node_main.cc -lnode -Lbuild/default | |
210abff9 | 78 | |
79 | %install | |
80 | rm -rf $RPM_BUILD_ROOT | |
e47cb1b9 | 81 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir},%{_libdir}/node/libraries,%{_plainlibdir}/waf/wafadmin/Tools} |
a752c1c0 | 82 | |
58494f0c ER |
83 | export PYTHONPATH=tools |
84 | %waf install \ | |
a8f57a3f | 85 | --product-type=cshlib \ |
210abff9 | 86 | --destdir=$RPM_BUILD_ROOT |
87 | ||
a8f57a3f | 88 | install node $RPM_BUILD_ROOT%{_bindir}/node |
89 | ||
e550379f | 90 | cp -a lib/*.js $RPM_BUILD_ROOT%{_libdir}/node/libraries |
e47cb1b9 | 91 | cp tools/wafadmin/Tools/node_addon.py $RPM_BUILD_ROOT%{_plainlibdir}/waf/wafadmin/Tools |
6505a74e | 92 | |
a752c1c0 | 93 | rm $RPM_BUILD_ROOT%{_bindir}/node-waf |
58494f0c ER |
94 | # ? really required? |
95 | ln -s waf $RPM_BUILD_ROOT%{_bindir}/node-waf | |
a752c1c0 | 96 | |
210abff9 | 97 | %clean |
98 | rm -rf $RPM_BUILD_ROOT | |
99 | ||
a8f57a3f | 100 | %post -p /sbin/ldconfig |
101 | %postun -p /sbin/ldconfig | |
102 | ||
210abff9 | 103 | %files |
104 | %defattr(644,root,root,755) | |
105 | %doc AUTHORS ChangeLog LICENSE | |
106 | %attr(755,root,root) %{_bindir}/node | |
210abff9 | 107 | %dir %{_libdir}/node |
a8f57a3f | 108 | %attr(755,root,root) %{_libdir}/libnode.so.*.*.* |
210abff9 | 109 | %dir %{_libdir}/node/libraries |
110 | %{_libdir}/node/libraries/*.js | |
111 | %{_mandir}/man1/node.1* | |
112 | ||
210abff9 | 113 | %files devel |
114 | %defattr(644,root,root,755) | |
58494f0c | 115 | %{_includedir}/node |
c6be74cc | 116 | %attr(755,root,root) %{_bindir}/node-waf |
a8f57a3f | 117 | %{_libdir}/libnode.so |
e47cb1b9 | 118 | %{_plainlibdir}/waf/wafadmin/Tools/node_addon.py |
a8f57a3f | 119 | %{_libdir}/pkgconfig/nodejs.pc |