]>
Commit | Line | Data |
---|---|---|
210abff9 | 1 | |
210abff9 | 2 | Summary: Asynchronous JavaScript Engine |
3 | Name: nodejs | |
5e9fa89b | 4 | Version: 0.4.1 |
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 | |
5e9fa89b | 10 | # Source0-md5: 9566bdbd05c18cc2bbe1fa0fba60dd0a |
a3293030 | 11 | Patch0: %{name}-ev-multiplicity.patch |
a8f57a3f | 12 | Patch1: %{name}-sharedlib.patch |
13 | Patch2: %{name}-soname.patch | |
14 | Patch3: %{name}-libdir.patch | |
a3293030 | 15 | BuildRequires: c-ares-devel |
16 | BuildRequires: c-ares-devel >= 1.7.4 | |
12a49d35 | 17 | BuildRequires: gcc >= 5:4.0 |
210abff9 | 18 | BuildRequires: libeio-devel |
a3293030 | 19 | BuildRequires: libev-devel >= 4.0.0 |
210abff9 | 20 | BuildRequires: libstdc++-devel |
21 | BuildRequires: python | |
12a49d35 | 22 | BuildRequires: rpm >= 4.4.9-56 |
2bc97491 | 23 | BuildRequires: v8-devel >= 3.1.5 |
a752c1c0 | 24 | BuildRequires: waf |
210abff9 | 25 | ExclusiveArch: %{ix86} %{x8664} arm |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
27 | ||
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 | %patch1 -p1 |
51 | %patch2 -p1 | |
52 | %patch3 -p0 | |
210abff9 | 53 | |
54 | %build | |
55 | # build library | |
210abff9 | 56 | CFLAGS="%{rpmcflags}" |
57 | CXXFLAGS="%{rpmcxxflags}" | |
58 | LDFLAGS="%{rpmcflags}" | |
59 | %if "%{pld_release}" == "ac" | |
60 | CC=%{__cc}4 | |
61 | CXX=%{__cxx}4 | |
62 | %else | |
63 | CC=%{__cc} | |
64 | CXX=%{__cxx} | |
65 | %endif | |
58494f0c | 66 | export CFLAGS LDFLAGS CXXFLAGS CC CXX |
210abff9 | 67 | |
58494f0c ER |
68 | export PYTHONPATH=tools |
69 | %waf configure \ | |
b52d635c | 70 | --shared-v8 \ |
71 | --shared-cares \ | |
72 | --shared-libev \ | |
a8f57a3f | 73 | --libdir=%{_libdir} \ |
210abff9 | 74 | --prefix=%{_prefix} |
75 | ||
a8f57a3f | 76 | %waf build \ |
77 | --product-type=cshlib | |
78 | ||
79 | $CC -o node -Isrc src/node_main.cc -lnode -Lbuild/default | |
210abff9 | 80 | |
81 | %install | |
82 | rm -rf $RPM_BUILD_ROOT | |
6505a74e | 83 | install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir},%{_libdir}/node/libraries,%{_libdir}/waf/wafadmin/Tools} |
a752c1c0 | 84 | |
58494f0c ER |
85 | export PYTHONPATH=tools |
86 | %waf install \ | |
a8f57a3f | 87 | --product-type=cshlib \ |
210abff9 | 88 | --destdir=$RPM_BUILD_ROOT |
89 | ||
a8f57a3f | 90 | install node $RPM_BUILD_ROOT%{_bindir}/node |
91 | ||
e550379f | 92 | cp -a lib/*.js $RPM_BUILD_ROOT%{_libdir}/node/libraries |
58494f0c | 93 | cp tools/wafadmin/Tools/node_addon.py $RPM_BUILD_ROOT%{_libdir}/waf/wafadmin/Tools |
6505a74e | 94 | |
a752c1c0 | 95 | rm $RPM_BUILD_ROOT%{_bindir}/node-waf |
58494f0c ER |
96 | # ? really required? |
97 | ln -s waf $RPM_BUILD_ROOT%{_bindir}/node-waf | |
a752c1c0 | 98 | |
210abff9 | 99 | %clean |
100 | rm -rf $RPM_BUILD_ROOT | |
101 | ||
a8f57a3f | 102 | %post -p /sbin/ldconfig |
103 | %postun -p /sbin/ldconfig | |
104 | ||
210abff9 | 105 | %files |
106 | %defattr(644,root,root,755) | |
107 | %doc AUTHORS ChangeLog LICENSE | |
108 | %attr(755,root,root) %{_bindir}/node | |
210abff9 | 109 | %dir %{_libdir}/node |
a8f57a3f | 110 | %attr(755,root,root) %{_libdir}/libnode.so.*.*.* |
210abff9 | 111 | %dir %{_libdir}/node/libraries |
112 | %{_libdir}/node/libraries/*.js | |
113 | %{_mandir}/man1/node.1* | |
114 | ||
210abff9 | 115 | %files devel |
116 | %defattr(644,root,root,755) | |
58494f0c | 117 | %{_includedir}/node |
c6be74cc | 118 | %attr(755,root,root) %{_bindir}/node-waf |
a8f57a3f | 119 | %{_libdir}/libnode.so |
6505a74e | 120 | %{_libdir}/waf/wafadmin/Tools/node_addon.py |
a8f57a3f | 121 | %{_libdir}/pkgconfig/nodejs.pc |