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