]> git.pld-linux.org Git - packages/nodejs.git/blob - nodejs.spec
up to 0.10.5 (2013.04.23)
[packages/nodejs.git] / nodejs.spec
1 Summary:        Asynchronous JavaScript Engine
2 Name:           nodejs
3 Version:        0.10.5
4 Release:        1
5 License:        BSD and MIT and Apache v2.0 and GPL v3
6 Group:          Development/Languages
7 Source0:        http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
8 # Source0-md5:  f6b1c363f75185d57c8486cd63c42e14
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:  c-ares-devel
17 BuildRequires:  gcc >= 5:4.0
18 BuildRequires:  http-parser-devel >= 2.0
19 BuildRequires:  libstdc++-devel
20 BuildRequires:  libuv-devel >= %{version}
21 BuildRequires:  openssl-devel
22 BuildRequires:  pkgconfig
23 BuildRequires:  python >= 1:2.5.2
24 BuildRequires:  python-jsmin
25 BuildRequires:  rpm >= 4.4.9-56
26 BuildRequires:  rpmbuild(macros) >= 1.219
27 BuildRequires:  sed >= 4.0
28 BuildRequires:  v8-devel >= 3.15.11.10
29 BuildRequires:  zlib-devel
30 BuildConflicts: eio
31 Obsoletes:      nodejs-waf
32 ExclusiveArch:  %{ix86} %{x8664} arm
33 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35 %define         sover   %(echo %{version} | cut -d. -f2)
36
37 %description
38 Node.js is a platform built on Chrome's JavaScript runtime for easily
39 building fast, scalable network applications. Node.js uses an
40 event-driven, non-blocking I/O model that makes it lightweight and
41 efficient, perfect for data-intensive real-time applications that run
42 across distributed devices.
43
44 %package devel
45 Summary:        Development headers for nodejs
46 Group:          Development/Libraries
47 Requires:       %{name} = %{version}-%{release}
48 Requires:       c-ares-devel
49 Requires:       gcc
50 Requires:       http-parser-devel
51 Requires:       libstdc++-devel
52 Requires:       libuv-devel
53 Requires:       openssl-devel
54 Requires:       v8-devel
55 Requires:       zlib-devel
56
57 %description devel
58 Development headers for nodejs.
59
60 %package doc
61 Summary:        Evented I/O for V8 JavaScript - documentation
62 Group:          Documentation
63
64 %description doc
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 documentation for nodejs.
70
71 %prep
72 %setup -q -n node-v%{version}
73 %patch1 -p1
74 %if %{_lib} == "lib64"
75 %patch3 -p1
76 %else
77 %patch2 -p1
78 %endif
79 %patch5 -p1
80
81 grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
82
83 %build
84 # CC used only to detect if CC is clang, not used for compiling
85 CC="%{__cc}" \
86 CXX="%{__cxx}" \
87 GYP_DEFINES="soname_version=%{sover}" \
88 ./configure \
89         --shared-v8 \
90         --shared-zlib \
91         --shared-openssl \
92         --shared-cares \
93         --shared-libuv \
94         --shared-http-parser \
95         --without-npm \
96         --without-dtrace \
97         --prefix=%{_prefix}
98
99 # add LFS defines from libuv (RHBZ#892601)
100 # CXXFLAGS must be exported, as it is needed for make, not gyp
101 CXXFLAGS="%{rpmcxxflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC" \
102 LDFLAGS="%{rpmldflags}" \
103 %{__make} -C out V=1 BUILDTYPE=Release
104
105 %install
106 rm -rf $RPM_BUILD_ROOT
107 %{__make} justinstall \
108         DESTDIR=$RPM_BUILD_ROOT \
109         LIBDIR=%{_lib}
110
111 # no dtrace on linux
112 %{__rm} -r $RPM_BUILD_ROOT%{_prefix}/lib/dtrace/node.d
113
114 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
115 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
116 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
117
118 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
119
120 install -d $RPM_BUILD_ROOT%{_includedir}/node
121 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
122
123 # install for node-gyp
124 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
125 cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
126 ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
127
128 # for compat of fedora derivered scripts (shebangs)
129 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
130
131 # globally installed node modules (noarch)
132 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
133
134 # default searchpaths
135 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
136
137 # create pkgconfig
138 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
139 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
140 version=%{version}
141 prefix=%{_prefix}
142 libdir=${prefix}/%{_lib}
143 includedir=${prefix}/include/node
144
145 Name: nodejs
146 Description: Evented I/O for V8 JavaScript.
147 Version: ${version}
148 Cflags: -I${includedir}
149 EOF
150
151 # install documentation
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
156
157 %clean
158 rm -rf $RPM_BUILD_ROOT
159
160 %post   -p /sbin/ldconfig
161 %postun -p /sbin/ldconfig
162
163 %files
164 %defattr(644,root,root,755)
165 %doc README.md AUTHORS ChangeLog LICENSE
166 %attr(755,root,root) %{_bindir}/node
167 %attr(755,root,root) %{_bindir}/nodejs
168 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
169 %ghost %{_libdir}/libnode.so.10
170 %if "%{_lib}" != "lib"
171 %dir %{_libdir}/node
172 %endif
173 %dir %{_prefix}/lib/node
174 %dir %{_prefix}/lib/node_modules
175 %{_mandir}/man1/node.1*
176 %{_mandir}/man1/nodejs.1
177
178 %files devel
179 %defattr(644,root,root,755)
180 %{_libdir}/libnode.so
181 %{_includedir}/node
182 %{_pkgconfigdir}/nodejs.pc
183 %{_usrsrc}/%{name}
184
185 %files doc
186 %defattr(644,root,root,755)
187 %doc %{_docdir}/%{name}-doc-%{version}
This page took 0.061507 seconds and 4 git commands to generate.