]> git.pld-linux.org Git - packages/nodejs.git/blame - nodejs.spec
- v8-devel dep to nodejs-devel, <node/node.h> includes <v8.h>
[packages/nodejs.git] / nodejs.spec
CommitLineData
210abff9 1Summary: Asynchronous JavaScript Engine
2Name: nodejs
c3b531ba 3Version: 0.6.8
7223b5ac 4Release: 3
e85103e0
ER
5License: BSD and MIT and ASL 2.0 and GPLv3
6Group: Development/Languages
c3b531ba
ER
7URL: http://www.nodejs.org/
8Source0: http://www.nodejs.org/dist/node-v%{version}.tar.gz
9# Source0-md5: 9fd7baa2d27b848c3134e6ae35bb87b2
fb6f511a 10Patch1: %{name}-soname.patch
a6070ceb
ER
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
a3293030 15BuildRequires: c-ares-devel >= 1.7.4
12a49d35 16BuildRequires: gcc >= 5:4.0
210abff9 17BuildRequires: libeio-devel
a3293030 18BuildRequires: libev-devel >= 4.0.0
210abff9 19BuildRequires: libstdc++-devel
a6070ceb
ER
20BuildRequires: python >= 1:2.5.2
21BuildRequires: python-jsmin
12a49d35 22BuildRequires: rpm >= 4.4.9-56
d44c8857 23BuildRequires: rpmbuild(macros) >= 1.219
a6070ceb 24BuildRequires: v8-devel >= 3.6
210abff9 25ExclusiveArch: %{ix86} %{x8664} arm
26BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28%description
c3b531ba
ER
29Node.js is a platform built on Chrome's JavaScript runtime for easily
30building fast, scalable network applications. Node.js uses an
31event-driven, non-blocking I/O model that makes it lightweight and
32efficient, perfect for data-intensive real-time applications that run
33across distributed devices.
210abff9 34
210abff9 35%package devel
12a49d35 36Summary: Development headers for nodejs
210abff9 37Group: Development/Libraries
a8f57a3f 38Requires: %{name} = %{version}-%{release}
d44c8857
ER
39Requires: %{name}-waf = %{version}-%{release}
40Requires: gcc
41Requires: libstdc++-devel
fae304aa 42Requires: v8-devel
210abff9 43
44%description devel
12a49d35 45Development headers for nodejs.
210abff9 46
a6070ceb
ER
47%package doc
48Summary: Evented I/O for V8 JavaScript - documentation
49Group: Documentation
50
51%description doc
52Node.js is a server-side JavaScript environment that uses an
53asynchronous event-driven model. Node's goal is to provide an easy way
54to build scalable network programs.
55
56This package contains the documentation for nodejs.
57
58%package waf
59Summary: Evented I/O for V8 JavaScript - customized WAF build system
60Group: Libraries
61Requires: %{name} = %{version}-%{release}
62
63%description waf
64Node.js is a server-side JavaScript environment that uses an
65asynchronous event-driven model. Node's goal is to provide an easy way
66to build scalable network programs.
67
68This package contains the customized version of the WAF build system
69used by Node.js and many of its modules.
70
210abff9 71%prep
72%setup -q -n node-v%{version}
fb6f511a 73%patch1 -p1
a6070ceb
ER
74%if %{_lib} == "lib64"
75%patch3 -p1
76%else
77%patch2 -p1
78%endif
210abff9 79
bc5a5fec
ER
80# fix #!/usr/bin/env python -> #!/usr/bin/python:
81grep -rl 'bin/env python' tools | xargs %{__sed} -i -e '1s,^#!.*python,#!%{__python},'
82
210abff9 83%build
a6070ceb
ER
84CFLAGS="%{rpmcflags} -fPIC"
85CXXFLAGS="%{rpmcxxflags} -fPIC"
210abff9 86LDFLAGS="%{rpmcflags}"
87%if "%{pld_release}" == "ac"
8791ea86
ER
88CC="%{__cc}4"
89CXX="%{__cxx}4"
210abff9 90%else
8791ea86
ER
91CC="%{__cc}"
92CXX="%{__cxx}"
210abff9 93%endif
58494f0c 94export CFLAGS LDFLAGS CXXFLAGS CC CXX
210abff9 95
a6070ceb 96# NOT autoconf so dont use macro
7372d27d 97export PYTHONPATH=tools
a6070ceb 98./configure \
b52d635c 99 --shared-cares \
a6070ceb
ER
100 --shared-v8 \
101 --shared-zlib \
7223b5ac 102 --without-npm \
a8f57a3f 103 --libdir=%{_libdir} \
210abff9 104 --prefix=%{_prefix}
105
bc5a5fec 106# build library
a6070ceb
ER
107%{__make} dynamiclib
108%{__make} program
7372d27d 109
a6070ceb
ER
110# relink with shared lib
111$CC -o out/Release/node src/node_main.cc -Isrc -Ideps/uv/include -lnode -Lout/Release
210abff9 112
113%install
114rm -rf $RPM_BUILD_ROOT
a6070ceb
ER
115%{__make} install \
116 DESTDIR=$RPM_BUILD_ROOT
117
e85103e0 118# for compat of fedora derivered scripts (shebangs)
c3b531ba
ER
119ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
120
e85103e0
ER
121# globally installed node modules (noarch)
122install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
123
124# default searchpaths
125install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
126
a6070ceb 127# install shared lib
7372d27d 128export PYTHONPATH=tools
8791ea86 129%{__python} tools/waf-light install \
7372d27d 130 --product-type=cshlib \
131 --destdir=$RPM_BUILD_ROOT
132
87c4fdf2
ER
133chmod a+x $RPM_BUILD_ROOT%{_libdir}/*.so*
134
a6070ceb
ER
135# create pkgconfig
136install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
137cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
138version=%{version}
c3b531ba 139prefix=%{_prefix}
87c4fdf2 140libdir=${prefix}/%{_lib}
a6070ceb
ER
141includedir=${prefix}/include/node
142
143Name: nodejs
144Description: Evented I/O for V8 JavaScript.
145Version: ${version}
146Cflags: -I${includedir}
147EOF
a752c1c0 148
bc5a5fec
ER
149%py_ocomp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
150%py_comp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
151# TODO: check it first
152#%%py_postclean %{_libdir}/node/wafadmin
153
a6070ceb
ER
154# install documentation
155install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/html
156cp -a doc/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/html
157cd $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
158install -d api
159mv html/api/*.markdown api
160mv html/api/api/* html/api
161rm -rf html/api/api
162cd -
163
210abff9 164%clean
165rm -rf $RPM_BUILD_ROOT
166
7372d27d 167%post -p /sbin/ldconfig
168%postun -p /sbin/ldconfig
169
210abff9 170%files
171%defattr(644,root,root,755)
a6070ceb 172%doc README.md AUTHORS ChangeLog LICENSE
210abff9 173%attr(755,root,root) %{_bindir}/node
c3b531ba 174%attr(755,root,root) %{_bindir}/nodejs
7372d27d 175%attr(755,root,root) %{_libdir}/libnode.so.*.*.*
e85103e0 176%ghost %{_libdir}/libnode.so.6
8791ea86 177%dir %{_libdir}/node
e85103e0
ER
178%dir %{_prefix}/lib/node
179%dir %{_prefix}/lib/node_modules
210abff9 180%{_mandir}/man1/node.1*
181
210abff9 182%files devel
183%defattr(644,root,root,755)
7372d27d 184%{_libdir}/libnode.so
58494f0c 185%{_includedir}/node
a6070ceb
ER
186%{_pkgconfigdir}/nodejs.pc
187
188%files doc
189%defattr(644,root,root,755)
190%doc %{_docdir}/%{name}-doc-%{version}
191
192%files waf
193%defattr(644,root,root,755)
c6be74cc 194%attr(755,root,root) %{_bindir}/node-waf
afb1c7e5
PZ
195%dir %{_libdir}/node/wafadmin
196%dir %{_libdir}/node/wafadmin/Tools
bc5a5fec 197%{_libdir}/node/wafadmin/*.py[co]
afb1c7e5
PZ
198%{_libdir}/node/wafadmin/*.py
199%{_libdir}/node/wafadmin/Tools/*.py
bc5a5fec 200%{_libdir}/node/wafadmin/Tools/*.py[co]
This page took 0.100726 seconds and 4 git commands to generate.