]>
Commit | Line | Data |
---|---|---|
210abff9 | 1 | Summary: Asynchronous JavaScript Engine |
2 | Name: nodejs | |
231df933 | 3 | Version: 0.8.14 |
7c7c1bb0 | 4 | Release: 1 |
e85103e0 ER |
5 | License: BSD and MIT and ASL 2.0 and GPLv3 |
6 | Group: Development/Languages | |
c3b531ba | 7 | URL: http://www.nodejs.org/ |
cb51f00f | 8 | Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz |
231df933 ŁC |
9 | # Source0-md5: 284fd2c7578064c339d9cf6a3a475ac7 |
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 | |
1385a038 | 15 | Patch5: uv-fpic.patch |
a3293030 | 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 |
a6070ceb ER |
21 | BuildRequires: python >= 1:2.5.2 |
22 | BuildRequires: python-jsmin | |
12a49d35 | 23 | BuildRequires: rpm >= 4.4.9-56 |
d44c8857 | 24 | BuildRequires: rpmbuild(macros) >= 1.219 |
a6070ceb | 25 | BuildRequires: v8-devel >= 3.6 |
210abff9 | 26 | ExclusiveArch: %{ix86} %{x8664} arm |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
28 | ||
29 | %description | |
c3b531ba ER |
30 | Node.js is a platform built on Chrome's JavaScript runtime for easily |
31 | building fast, scalable network applications. Node.js uses an | |
32 | event-driven, non-blocking I/O model that makes it lightweight and | |
33 | efficient, perfect for data-intensive real-time applications that run | |
34 | across distributed devices. | |
210abff9 | 35 | |
210abff9 | 36 | %package devel |
12a49d35 | 37 | Summary: Development headers for nodejs |
210abff9 | 38 | Group: Development/Libraries |
a8f57a3f | 39 | Requires: %{name} = %{version}-%{release} |
d44c8857 ER |
40 | Requires: %{name}-waf = %{version}-%{release} |
41 | Requires: gcc | |
42 | Requires: libstdc++-devel | |
fae304aa | 43 | Requires: v8-devel |
210abff9 | 44 | |
45 | %description devel | |
12a49d35 | 46 | Development headers for nodejs. |
210abff9 | 47 | |
a6070ceb ER |
48 | %package doc |
49 | Summary: Evented I/O for V8 JavaScript - documentation | |
50 | Group: Documentation | |
51 | ||
52 | %description doc | |
53 | Node.js is a server-side JavaScript environment that uses an | |
54 | asynchronous event-driven model. Node's goal is to provide an easy way | |
55 | to build scalable network programs. | |
56 | ||
57 | This package contains the documentation for nodejs. | |
58 | ||
59 | %package waf | |
60 | Summary: Evented I/O for V8 JavaScript - customized WAF build system | |
61 | Group: Libraries | |
62 | Requires: %{name} = %{version}-%{release} | |
63 | ||
64 | %description waf | |
65 | Node.js is a server-side JavaScript environment that uses an | |
66 | asynchronous event-driven model. Node's goal is to provide an easy way | |
67 | to build scalable network programs. | |
68 | ||
69 | This package contains the customized version of the WAF build system | |
70 | used by Node.js and many of its modules. | |
71 | ||
210abff9 | 72 | %prep |
73 | %setup -q -n node-v%{version} | |
231df933 | 74 | #%patch1 -p1 |
a6070ceb ER |
75 | %if %{_lib} == "lib64" |
76 | %patch3 -p1 | |
77 | %else | |
78 | %patch2 -p1 | |
79 | %endif | |
1385a038 | 80 | %patch5 -p1 |
c4aa3bb0 | 81 | |
bc5a5fec ER |
82 | # fix #!/usr/bin/env python -> #!/usr/bin/python: |
83 | grep -rl 'bin/env python' tools | xargs %{__sed} -i -e '1s,^#!.*python,#!%{__python},' | |
84 | ||
210abff9 | 85 | %build |
a6070ceb | 86 | CFLAGS="%{rpmcflags} -fPIC" |
1385a038 | 87 | CPPFLAGS="%{rpmcppflags} -fPIC" |
a6070ceb | 88 | CXXFLAGS="%{rpmcxxflags} -fPIC" |
210abff9 | 89 | LDFLAGS="%{rpmcflags}" |
90 | %if "%{pld_release}" == "ac" | |
8791ea86 ER |
91 | CC="%{__cc}4" |
92 | CXX="%{__cxx}4" | |
210abff9 | 93 | %else |
8791ea86 ER |
94 | CC="%{__cc}" |
95 | CXX="%{__cxx}" | |
210abff9 | 96 | %endif |
1385a038 | 97 | export CFLAGS LDFLAGS CXXFLAGS CC CXX LINKFLAGS_UV |
210abff9 | 98 | |
cb51f00f ER |
99 | # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc' |
100 | CC=${CC#ccache } | |
a6070ceb | 101 | ./configure \ |
a6070ceb ER |
102 | --shared-v8 \ |
103 | --shared-zlib \ | |
7223b5ac | 104 | --without-npm \ |
210abff9 | 105 | --prefix=%{_prefix} |
106 | ||
bc5a5fec | 107 | # build library |
231df933 | 108 | %{__make} |
210abff9 | 109 | |
110 | %install | |
111 | rm -rf $RPM_BUILD_ROOT | |
a6070ceb ER |
112 | %{__make} install \ |
113 | DESTDIR=$RPM_BUILD_ROOT | |
114 | ||
c7898157 ER |
115 | echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1 |
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 |
231df933 | 128 | %{__python} tools/install.py install $RPM_BUILD_ROOT |
7372d27d | 129 | |
231df933 | 130 | #chmod a+x $RPM_BUILD_ROOT%{_libdir}/*.so* |
87c4fdf2 | 131 | |
a6070ceb ER |
132 | # create pkgconfig |
133 | install -d $RPM_BUILD_ROOT%{_pkgconfigdir} | |
134 | cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc | |
135 | version=%{version} | |
c3b531ba | 136 | prefix=%{_prefix} |
87c4fdf2 | 137 | libdir=${prefix}/%{_lib} |
a6070ceb ER |
138 | includedir=${prefix}/include/node |
139 | ||
140 | Name: nodejs | |
141 | Description: Evented I/O for V8 JavaScript. | |
142 | Version: ${version} | |
143 | Cflags: -I${includedir} | |
144 | EOF | |
a752c1c0 | 145 | |
bc5a5fec ER |
146 | %py_ocomp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin |
147 | %py_comp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin | |
148 | # TODO: check it first | |
149 | #%%py_postclean %{_libdir}/node/wafadmin | |
150 | ||
a6070ceb | 151 | # install documentation |
6f7eebb5 ER |
152 | install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version} |
153 | cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version} | |
154 | rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown | |
155 | rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json | |
a6070ceb | 156 | |
210abff9 | 157 | %clean |
158 | rm -rf $RPM_BUILD_ROOT | |
159 | ||
7372d27d | 160 | %post -p /sbin/ldconfig |
161 | %postun -p /sbin/ldconfig | |
162 | ||
210abff9 | 163 | %files |
164 | %defattr(644,root,root,755) | |
a6070ceb | 165 | %doc README.md AUTHORS ChangeLog LICENSE |
210abff9 | 166 | %attr(755,root,root) %{_bindir}/node |
c3b531ba | 167 | %attr(755,root,root) %{_bindir}/nodejs |
8791ea86 | 168 | %dir %{_libdir}/node |
e85103e0 | 169 | %dir %{_prefix}/lib/node_modules |
210abff9 | 170 | %{_mandir}/man1/node.1* |
c7898157 | 171 | %{_mandir}/man1/nodejs.1 |
210abff9 | 172 | |
210abff9 | 173 | %files devel |
174 | %defattr(644,root,root,755) | |
58494f0c | 175 | %{_includedir}/node |
a6070ceb ER |
176 | %{_pkgconfigdir}/nodejs.pc |
177 | ||
178 | %files doc | |
179 | %defattr(644,root,root,755) | |
180 | %doc %{_docdir}/%{name}-doc-%{version} | |
181 | ||
182 | %files waf | |
183 | %defattr(644,root,root,755) | |
c6be74cc | 184 | %attr(755,root,root) %{_bindir}/node-waf |
afb1c7e5 PZ |
185 | %dir %{_libdir}/node/wafadmin |
186 | %dir %{_libdir}/node/wafadmin/Tools | |
bc5a5fec | 187 | %{_libdir}/node/wafadmin/*.py[co] |
afb1c7e5 PZ |
188 | %{_libdir}/node/wafadmin/*.py |
189 | %{_libdir}/node/wafadmin/Tools/*.py | |
bc5a5fec | 190 | %{_libdir}/node/wafadmin/Tools/*.py[co] |