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