]> git.pld-linux.org Git - packages/nodejs.git/blame_incremental - nodejs.spec
make soname_version configurable. at least in gyp side
[packages/nodejs.git] / nodejs.spec
... / ...
CommitLineData
1Summary: Asynchronous JavaScript Engine
2Name: nodejs
3Version: 0.10.3
4Release: 4
5License: BSD and MIT and Apache v2.0 and GPL v3
6Group: Development/Languages
7Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
8# Source0-md5: 4daca92618515708a4631e98a8e8c779
9Patch1: %{name}-shared.patch
10# force node to use /usr/lib/node as the systemwide module directory
11Patch2: %{name}-libpath.patch
12# use /usr/lib64/node as an arch-specific module dir when appropriate
13Patch3: %{name}-lib64path.patch
14Patch5: uv-fpic.patch
15URL: http://www.nodejs.org/
16BuildRequires: c-ares-devel
17BuildRequires: gcc >= 5:4.0
18BuildRequires: http-parser-devel >= 2.0
19BuildRequires: libstdc++-devel
20BuildRequires: libuv-devel >= %{version}
21BuildRequires: openssl-devel
22BuildRequires: pkgconfig
23BuildRequires: python >= 1:2.5.2
24BuildRequires: python-jsmin
25BuildRequires: rpm >= 4.4.9-56
26BuildRequires: rpmbuild(macros) >= 1.219
27BuildRequires: sed >= 4.0
28BuildRequires: v8-devel >= 3.15.11.10
29BuildRequires: zlib-devel
30BuildConflicts: eio
31Obsoletes: nodejs-waf
32ExclusiveArch: %{ix86} %{x8664} arm
33BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35%define sover %(echo %{version} | cut -d. -f2)
36
37%description
38Node.js is a platform built on Chrome's JavaScript runtime for easily
39building fast, scalable network applications. Node.js uses an
40event-driven, non-blocking I/O model that makes it lightweight and
41efficient, perfect for data-intensive real-time applications that run
42across distributed devices.
43
44%package devel
45Summary: Development headers for nodejs
46Group: Development/Libraries
47Requires: %{name} = %{version}-%{release}
48Requires: c-ares-devel
49Requires: gcc
50Requires: http-parser-devel
51Requires: libstdc++-devel
52Requires: libuv-devel
53Requires: openssl-devel
54Requires: v8-devel
55Requires: zlib-devel
56
57%description devel
58Development headers for nodejs.
59
60%package doc
61Summary: Evented I/O for V8 JavaScript - documentation
62Group: Documentation
63
64%description doc
65Node.js is a server-side JavaScript environment that uses an
66asynchronous event-driven model. Node's goal is to provide an easy way
67to build scalable network programs.
68
69This 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
81grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
82
83%build
84# add defines from libuv (RHBZ#892601)
85export CFLAGS="%{rpmcflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
86export CXXFLAGS="%{rpmcppflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
87
88# NOT autoconf so don't use macro
89PYTHONPATH=tools \
90GYP_DEFINES="soname_version=%{sover}" \
91./configure \
92 --shared-v8 \
93 --shared-zlib \
94 --shared-openssl \
95 --shared-cares \
96 --shared-libuv \
97 --shared-http-parser \
98 --without-npm \
99 --without-dtrace \
100 --prefix=%{_prefix}
101
102%{__make} -C out \
103 BUILDTYPE=Release \
104 V=1 \
105 CFLAGS.host="%{rpmcflags} -fPIC" \
106 CXXFLAGS.host="%{rpmcppflags} -fPIC" \
107 LDFLAGS.host="%{rpmcflags}" \
108 CFLAGS.target="%{rpmcflags} -fPIC" \
109 CXXFLAGS.target="%{rpmcppflags} -fPIC" \
110 LDFLAGS.target="%{rpmcflags}" \
111 CC.host="%{__cc}" \
112 CXX.host="%{__cxx}" \
113 CC.target="%{__cc}" \
114 CXX.target="%{__cxx}"
115
116%install
117rm -rf $RPM_BUILD_ROOT
118%{__make} justinstall \
119 DESTDIR=$RPM_BUILD_ROOT \
120 LIBDIR=%{_lib}
121
122# no dtrace on linux
123%{__rm} -r $RPM_BUILD_ROOT%{_prefix}/lib/dtrace/node.d
124
125lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
126ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
127ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
128
129echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
130
131install -d $RPM_BUILD_ROOT%{_includedir}/node
132cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
133
134# install for node-gyp
135install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
136cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
137ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
138
139# for compat of fedora derivered scripts (shebangs)
140ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
141
142# globally installed node modules (noarch)
143install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
144
145# default searchpaths
146install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
147
148# create pkgconfig
149install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
150cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
151version=%{version}
152prefix=%{_prefix}
153libdir=${prefix}/%{_lib}
154includedir=${prefix}/include/node
155
156Name: nodejs
157Description: Evented I/O for V8 JavaScript.
158Version: ${version}
159Cflags: -I${includedir}
160EOF
161
162# install documentation
163install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
164cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
165rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
166rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
167
168%clean
169rm -rf $RPM_BUILD_ROOT
170
171%post -p /sbin/ldconfig
172%postun -p /sbin/ldconfig
173
174%files
175%defattr(644,root,root,755)
176%doc README.md AUTHORS ChangeLog LICENSE
177%attr(755,root,root) %{_bindir}/node
178%attr(755,root,root) %{_bindir}/nodejs
179%attr(755,root,root) %{_libdir}/libnode.so.*.*.*
180%ghost %{_libdir}/libnode.so.10
181%if "%{_lib}" != "lib"
182%dir %{_libdir}/node
183%endif
184%dir %{_prefix}/lib/node
185%dir %{_prefix}/lib/node_modules
186%{_mandir}/man1/node.1*
187%{_mandir}/man1/nodejs.1
188
189%files devel
190%defattr(644,root,root,755)
191%{_libdir}/libnode.so
192%{_includedir}/node
193%{_pkgconfigdir}/nodejs.pc
194%{_usrsrc}/%{name}
195
196%files doc
197%defattr(644,root,root,755)
198%doc %{_docdir}/%{name}-doc-%{version}
This page took 0.075082 seconds and 4 git commands to generate.