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