]> git.pld-linux.org Git - packages/nodejs.git/blame_incremental - nodejs.spec
- up to 0.8.14 (no Soname patch needed)
[packages/nodejs.git] / nodejs.spec
... / ...
CommitLineData
1Summary: Asynchronous JavaScript Engine
2Name: nodejs
3Version: 0.8.14
4Release: 1
5License: BSD and MIT and ASL 2.0 and GPLv3
6Group: Development/Languages
7URL: http://www.nodejs.org/
8Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
9# Source0-md5: 284fd2c7578064c339d9cf6a3a475ac7
10#Patch1: %{name}-soname.patch
11# force node to use /usr/lib/node as the systemwide module directory
12Patch2: %{name}-libpath.patch
13# use /usr/lib64/node as an arch-specific module dir when appropriate
14Patch3: %{name}-lib64path.patch
15Patch5: uv-fpic.patch
16BuildRequires: c-ares-devel >= 1.7.4
17BuildRequires: gcc >= 5:4.0
18BuildRequires: libeio-devel
19BuildRequires: libev-devel >= 4.0.0
20BuildRequires: libstdc++-devel
21BuildRequires: python >= 1:2.5.2
22BuildRequires: python-jsmin
23BuildRequires: rpm >= 4.4.9-56
24BuildRequires: rpmbuild(macros) >= 1.219
25BuildRequires: v8-devel >= 3.6
26ExclusiveArch: %{ix86} %{x8664} arm
27BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29%description
30Node.js is a platform built on Chrome's JavaScript runtime for easily
31building fast, scalable network applications. Node.js uses an
32event-driven, non-blocking I/O model that makes it lightweight and
33efficient, perfect for data-intensive real-time applications that run
34across distributed devices.
35
36%package devel
37Summary: Development headers for nodejs
38Group: Development/Libraries
39Requires: %{name} = %{version}-%{release}
40Requires: %{name}-waf = %{version}-%{release}
41Requires: gcc
42Requires: libstdc++-devel
43Requires: v8-devel
44
45%description devel
46Development headers for nodejs.
47
48%package doc
49Summary: Evented I/O for V8 JavaScript - documentation
50Group: Documentation
51
52%description doc
53Node.js is a server-side JavaScript environment that uses an
54asynchronous event-driven model. Node's goal is to provide an easy way
55to build scalable network programs.
56
57This package contains the documentation for nodejs.
58
59%package waf
60Summary: Evented I/O for V8 JavaScript - customized WAF build system
61Group: Libraries
62Requires: %{name} = %{version}-%{release}
63
64%description waf
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 customized version of the WAF build system
70used by Node.js and many of its modules.
71
72%prep
73%setup -q -n node-v%{version}
74#%patch1 -p1
75%if %{_lib} == "lib64"
76%patch3 -p1
77%else
78%patch2 -p1
79%endif
80%patch5 -p1
81
82# fix #!/usr/bin/env python -> #!/usr/bin/python:
83grep -rl 'bin/env python' tools | xargs %{__sed} -i -e '1s,^#!.*python,#!%{__python},'
84
85%build
86CFLAGS="%{rpmcflags} -fPIC"
87CPPFLAGS="%{rpmcppflags} -fPIC"
88CXXFLAGS="%{rpmcxxflags} -fPIC"
89LDFLAGS="%{rpmcflags}"
90%if "%{pld_release}" == "ac"
91CC="%{__cc}4"
92CXX="%{__cxx}4"
93%else
94CC="%{__cc}"
95CXX="%{__cxx}"
96%endif
97export CFLAGS LDFLAGS CXXFLAGS CC CXX LINKFLAGS_UV
98
99# Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
100CC=${CC#ccache }
101./configure \
102 --shared-v8 \
103 --shared-zlib \
104 --without-npm \
105 --prefix=%{_prefix}
106
107# build library
108%{__make}
109
110%install
111rm -rf $RPM_BUILD_ROOT
112%{__make} install \
113 DESTDIR=$RPM_BUILD_ROOT
114
115echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
116
117# for compat of fedora derivered scripts (shebangs)
118ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
119
120# globally installed node modules (noarch)
121install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
122
123# default searchpaths
124install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
125
126# install shared lib
127export PYTHONPATH=tools
128%{__python} tools/install.py install $RPM_BUILD_ROOT
129
130#chmod a+x $RPM_BUILD_ROOT%{_libdir}/*.so*
131
132# create pkgconfig
133install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
134cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
135version=%{version}
136prefix=%{_prefix}
137libdir=${prefix}/%{_lib}
138includedir=${prefix}/include/node
139
140Name: nodejs
141Description: Evented I/O for V8 JavaScript.
142Version: ${version}
143Cflags: -I${includedir}
144EOF
145
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
151# install documentation
152install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
153cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
154rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
155rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
156
157%clean
158rm -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%dir %{_libdir}/node
169%dir %{_prefix}/lib/node_modules
170%{_mandir}/man1/node.1*
171%{_mandir}/man1/nodejs.1
172
173%files devel
174%defattr(644,root,root,755)
175%{_includedir}/node
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)
184%attr(755,root,root) %{_bindir}/node-waf
185%dir %{_libdir}/node/wafadmin
186%dir %{_libdir}/node/wafadmin/Tools
187%{_libdir}/node/wafadmin/*.py[co]
188%{_libdir}/node/wafadmin/*.py
189%{_libdir}/node/wafadmin/Tools/*.py
190%{_libdir}/node/wafadmin/Tools/*.py[co]
This page took 0.052014 seconds and 4 git commands to generate.