]>
Commit | Line | Data |
---|---|---|
210abff9 | 1 | Summary: Asynchronous JavaScript Engine |
2 | Name: nodejs | |
be06d6d0 | 3 | Version: 0.8.15 |
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 |
be06d6d0 AS |
9 | # Source0-md5: 6cb31180b07475db103e694f65e8bb9b |
10 | Patch1: %{name}-shared.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 |
12a49d35 | 16 | BuildRequires: gcc >= 5:4.0 |
210abff9 | 17 | BuildRequires: libstdc++-devel |
a6070ceb ER |
18 | BuildRequires: python >= 1:2.5.2 |
19 | BuildRequires: python-jsmin | |
12a49d35 | 20 | BuildRequires: rpm >= 4.4.9-56 |
d44c8857 | 21 | BuildRequires: rpmbuild(macros) >= 1.219 |
be06d6d0 | 22 | BuildRequires: v8-devel >= 3.11.10.25 |
210abff9 | 23 | ExclusiveArch: %{ix86} %{x8664} arm |
24 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
25 | ||
26 | %description | |
c3b531ba ER |
27 | Node.js is a platform built on Chrome's JavaScript runtime for easily |
28 | building fast, scalable network applications. Node.js uses an | |
29 | event-driven, non-blocking I/O model that makes it lightweight and | |
30 | efficient, perfect for data-intensive real-time applications that run | |
31 | across distributed devices. | |
210abff9 | 32 | |
210abff9 | 33 | %package devel |
12a49d35 | 34 | Summary: Development headers for nodejs |
210abff9 | 35 | Group: Development/Libraries |
a8f57a3f | 36 | Requires: %{name} = %{version}-%{release} |
d44c8857 ER |
37 | Requires: %{name}-waf = %{version}-%{release} |
38 | Requires: gcc | |
39 | Requires: libstdc++-devel | |
fae304aa | 40 | Requires: v8-devel |
210abff9 | 41 | |
42 | %description devel | |
12a49d35 | 43 | Development headers for nodejs. |
210abff9 | 44 | |
a6070ceb ER |
45 | %package doc |
46 | Summary: Evented I/O for V8 JavaScript - documentation | |
47 | Group: Documentation | |
48 | ||
49 | %description doc | |
50 | Node.js is a server-side JavaScript environment that uses an | |
51 | asynchronous event-driven model. Node's goal is to provide an easy way | |
52 | to build scalable network programs. | |
53 | ||
54 | This package contains the documentation for nodejs. | |
55 | ||
56 | %package waf | |
57 | Summary: Evented I/O for V8 JavaScript - customized WAF build system | |
58 | Group: Libraries | |
59 | Requires: %{name} = %{version}-%{release} | |
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} | |
a600c300 | 71 | %patch1 -p1 |
a6070ceb ER |
72 | %if %{_lib} == "lib64" |
73 | %patch3 -p1 | |
74 | %else | |
75 | %patch2 -p1 | |
76 | %endif | |
1385a038 | 77 | %patch5 -p1 |
c4aa3bb0 | 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 |
210abff9 | 83 | |
cb51f00f ER |
84 | # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc' |
85 | CC=${CC#ccache } | |
a600c300 ŁC |
86 | |
87 | # NOT autoconf so dont use macro | |
88 | export PYTHONPATH=tools | |
a6070ceb | 89 | ./configure \ |
a6070ceb ER |
90 | --shared-v8 \ |
91 | --shared-zlib \ | |
be06d6d0 | 92 | --shared-openssl \ |
7223b5ac | 93 | --without-npm \ |
210abff9 | 94 | --prefix=%{_prefix} |
95 | ||
be06d6d0 AS |
96 | %make -C out \ |
97 | BUILDTYPE=Release \ | |
98 | V=1 \ | |
99 | CFLAGS.host="%{rpmcflags} -fPIC" \ | |
100 | CXXFLAGS.host="%{rpmcppflags} -fPIC" \ | |
101 | LDFLAGS.host="%{rpmcflags}" \ | |
102 | CFLAGS.target="%{rpmcflags} -fPIC" \ | |
103 | CXXFLAGS.target="%{rpmcppflags} -fPIC" \ | |
104 | LDFLAGS.target="%{rpmcflags}" \ | |
105 | %if "%{pld_release}" == "ac" | |
106 | CC.host="%{__cc}4" \ | |
107 | CXX.host="%{__cxx}4" \ | |
108 | CC.target="%{__cc}4" \ | |
109 | CXX.target="%{__cxx}4" \ | |
110 | %else | |
111 | CC.host="%{__cc}" \ | |
112 | CXX.host="%{__cxx}" \ | |
113 | CC.target="%{__cc}" \ | |
114 | CXX.target="%{__cxx}" | |
115 | %endif | |
210abff9 | 116 | |
117 | %install | |
118 | rm -rf $RPM_BUILD_ROOT | |
be06d6d0 AS |
119 | install -d $RPM_BUILD_ROOT/%{_prefix}/lib/node/wafadmin |
120 | %{__make} justinstall \ | |
121 | DESTDIR=$RPM_BUILD_ROOT \ | |
122 | LIBDIR=%{_lib} | |
123 | ||
124 | ln -s libnode.so.8.0.0 $RPM_BUILD_ROOT%{_libdir}/libnode.so.8 | |
125 | ln -s libnode.so.8.0.0 $RPM_BUILD_ROOT%{_libdir}/libnode.so | |
a6070ceb | 126 | |
c7898157 ER |
127 | echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1 |
128 | ||
e85103e0 | 129 | # for compat of fedora derivered scripts (shebangs) |
c3b531ba ER |
130 | ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs |
131 | ||
e85103e0 ER |
132 | # globally installed node modules (noarch) |
133 | install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules | |
134 | ||
135 | # default searchpaths | |
136 | install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node | |
137 | ||
a6070ceb ER |
138 | # create pkgconfig |
139 | install -d $RPM_BUILD_ROOT%{_pkgconfigdir} | |
140 | cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc | |
141 | version=%{version} | |
c3b531ba | 142 | prefix=%{_prefix} |
87c4fdf2 | 143 | libdir=${prefix}/%{_lib} |
a6070ceb ER |
144 | includedir=${prefix}/include/node |
145 | ||
146 | Name: nodejs | |
147 | Description: Evented I/O for V8 JavaScript. | |
148 | Version: ${version} | |
149 | Cflags: -I${includedir} | |
150 | EOF | |
a752c1c0 | 151 | |
bc5a5fec ER |
152 | %py_ocomp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin |
153 | %py_comp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin | |
154 | # TODO: check it first | |
155 | #%%py_postclean %{_libdir}/node/wafadmin | |
156 | ||
a6070ceb | 157 | # install documentation |
6f7eebb5 ER |
158 | install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version} |
159 | cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version} | |
160 | rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown | |
161 | rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json | |
a6070ceb | 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 |
a600c300 | 174 | %attr(755,root,root) %{_libdir}/libnode.so.*.*.* |
be06d6d0 | 175 | %ghost %{_libdir}/libnode.so.8 |
a600c300 | 176 | %if "%{_lib}" != "lib" |
8791ea86 | 177 | %dir %{_libdir}/node |
a600c300 ŁC |
178 | %endif |
179 | %dir %{_prefix}/lib/node | |
e85103e0 | 180 | %dir %{_prefix}/lib/node_modules |
210abff9 | 181 | %{_mandir}/man1/node.1* |
c7898157 | 182 | %{_mandir}/man1/nodejs.1 |
210abff9 | 183 | |
210abff9 | 184 | %files devel |
185 | %defattr(644,root,root,755) | |
a600c300 | 186 | %{_libdir}/libnode.so |
58494f0c | 187 | %{_includedir}/node |
a6070ceb ER |
188 | %{_pkgconfigdir}/nodejs.pc |
189 | ||
190 | %files doc | |
191 | %defattr(644,root,root,755) | |
192 | %doc %{_docdir}/%{name}-doc-%{version} | |
193 | ||
194 | %files waf | |
195 | %defattr(644,root,root,755) | |
c6be74cc | 196 | %attr(755,root,root) %{_bindir}/node-waf |
afb1c7e5 PZ |
197 | %dir %{_libdir}/node/wafadmin |
198 | %dir %{_libdir}/node/wafadmin/Tools | |
bc5a5fec | 199 | %{_libdir}/node/wafadmin/*.py[co] |
afb1c7e5 PZ |
200 | %{_libdir}/node/wafadmin/*.py |
201 | %{_libdir}/node/wafadmin/Tools/*.py | |
bc5a5fec | 202 | %{_libdir}/node/wafadmin/Tools/*.py[co] |