]>
Commit | Line | Data |
---|---|---|
1 | Summary: Asynchronous JavaScript Engine | |
2 | Name: nodejs | |
3 | Version: 0.10.3 | |
4 | Release: 1 | |
5 | License: BSD and MIT and ASL 2.0 and GPLv3 | |
6 | Group: Development/Languages | |
7 | Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz | |
8 | # Source0-md5: 4daca92618515708a4631e98a8e8c779 | |
9 | Patch1: %{name}-shared.patch | |
10 | # force node to use /usr/lib/node as the systemwide module directory | |
11 | Patch2: %{name}-libpath.patch | |
12 | # use /usr/lib64/node as an arch-specific module dir when appropriate | |
13 | Patch3: %{name}-lib64path.patch | |
14 | Patch5: uv-fpic.patch | |
15 | URL: http://www.nodejs.org/ | |
16 | BuildRequires: gcc >= 5:4.0 | |
17 | BuildRequires: libstdc++-devel | |
18 | BuildRequires: python >= 1:2.5.2 | |
19 | BuildRequires: python-jsmin | |
20 | BuildRequires: rpm >= 4.4.9-56 | |
21 | BuildRequires: rpmbuild(macros) >= 1.219 | |
22 | BuildRequires: v8-devel >= 3.15.11.10 | |
23 | BuildConflicts: eio | |
24 | Obsoletes: nodejs-waf | |
25 | ExclusiveArch: %{ix86} %{x8664} arm | |
26 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
27 | ||
28 | %description | |
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. | |
34 | ||
35 | %package devel | |
36 | Summary: Development headers for nodejs | |
37 | Group: Development/Libraries | |
38 | Requires: %{name} = %{version}-%{release} | |
39 | Requires: gcc | |
40 | Requires: libstdc++-devel | |
41 | Requires: v8-devel | |
42 | ||
43 | %description devel | |
44 | Development headers for nodejs. | |
45 | ||
46 | %package doc | |
47 | Summary: Evented I/O for V8 JavaScript - documentation | |
48 | Group: Documentation | |
49 | ||
50 | %description doc | |
51 | Node.js is a server-side JavaScript environment that uses an | |
52 | asynchronous event-driven model. Node's goal is to provide an easy way | |
53 | to build scalable network programs. | |
54 | ||
55 | This package contains the documentation for nodejs. | |
56 | ||
57 | %prep | |
58 | %setup -q -n node-v%{version} | |
59 | %patch1 -p1 | |
60 | %if %{_lib} == "lib64" | |
61 | %patch3 -p1 | |
62 | %else | |
63 | %patch2 -p1 | |
64 | %endif | |
65 | %patch5 -p1 | |
66 | ||
67 | %build | |
68 | # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc' | |
69 | CC=${CC#ccache } | |
70 | ||
71 | # NOT autoconf so dont use macro | |
72 | export PYTHONPATH=tools | |
73 | ./configure \ | |
74 | --shared-v8 \ | |
75 | --shared-zlib \ | |
76 | --shared-openssl \ | |
77 | --without-npm \ | |
78 | --prefix=%{_prefix} | |
79 | ||
80 | %{__make} -C out \ | |
81 | BUILDTYPE=Release \ | |
82 | V=1 \ | |
83 | CFLAGS.host="%{rpmcflags} -fPIC" \ | |
84 | CXXFLAGS.host="%{rpmcppflags} -fPIC" \ | |
85 | LDFLAGS.host="%{rpmcflags}" \ | |
86 | CFLAGS.target="%{rpmcflags} -fPIC" \ | |
87 | CXXFLAGS.target="%{rpmcppflags} -fPIC" \ | |
88 | LDFLAGS.target="%{rpmcflags}" \ | |
89 | CC.host="%{__cc}" \ | |
90 | CXX.host="%{__cxx}" \ | |
91 | CC.target="%{__cc}" \ | |
92 | CXX.target="%{__cxx}" | |
93 | ||
94 | %install | |
95 | rm -rf $RPM_BUILD_ROOT | |
96 | %{__make} justinstall \ | |
97 | DESTDIR=$RPM_BUILD_ROOT \ | |
98 | LIBDIR=%{_lib} | |
99 | ||
100 | # no dtrace on linux | |
101 | %{__rm} -r $RPM_BUILD_ROOT%{_prefix}/lib/dtrace/node.d | |
102 | ||
103 | lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*) | |
104 | ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10 | |
105 | ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so | |
106 | ||
107 | echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1 | |
108 | ||
109 | install -d $RPM_BUILD_ROOT%{_includedir}/node | |
110 | cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node | |
111 | ||
112 | # for compat of fedora derivered scripts (shebangs) | |
113 | ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs | |
114 | ||
115 | # globally installed node modules (noarch) | |
116 | install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules | |
117 | ||
118 | # default searchpaths | |
119 | install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node | |
120 | ||
121 | # create pkgconfig | |
122 | install -d $RPM_BUILD_ROOT%{_pkgconfigdir} | |
123 | cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc | |
124 | version=%{version} | |
125 | prefix=%{_prefix} | |
126 | libdir=${prefix}/%{_lib} | |
127 | includedir=${prefix}/include/node | |
128 | ||
129 | Name: nodejs | |
130 | Description: Evented I/O for V8 JavaScript. | |
131 | Version: ${version} | |
132 | Cflags: -I${includedir} | |
133 | EOF | |
134 | ||
135 | # install documentation | |
136 | install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version} | |
137 | cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version} | |
138 | rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown | |
139 | rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json | |
140 | ||
141 | %clean | |
142 | rm -rf $RPM_BUILD_ROOT | |
143 | ||
144 | %post -p /sbin/ldconfig | |
145 | %postun -p /sbin/ldconfig | |
146 | ||
147 | %files | |
148 | %defattr(644,root,root,755) | |
149 | %doc README.md AUTHORS ChangeLog LICENSE | |
150 | %attr(755,root,root) %{_bindir}/node | |
151 | %attr(755,root,root) %{_bindir}/nodejs | |
152 | %attr(755,root,root) %{_libdir}/libnode.so.*.*.* | |
153 | %ghost %{_libdir}/libnode.so.10 | |
154 | %if "%{_lib}" != "lib" | |
155 | %dir %{_libdir}/node | |
156 | %endif | |
157 | %dir %{_prefix}/lib/node | |
158 | %dir %{_prefix}/lib/node_modules | |
159 | %{_mandir}/man1/node.1* | |
160 | %{_mandir}/man1/nodejs.1 | |
161 | ||
162 | %files devel | |
163 | %defattr(644,root,root,755) | |
164 | %{_libdir}/libnode.so | |
165 | %{_includedir}/node | |
166 | %{_pkgconfigdir}/nodejs.pc | |
167 | ||
168 | %files doc | |
169 | %defattr(644,root,root,755) | |
170 | %doc %{_docdir}/%{name}-doc-%{version} |