]> git.pld-linux.org Git - packages/nodejs.git/blame - nodejs.spec
- up to 0.6.15
[packages/nodejs.git] / nodejs.spec
CommitLineData
210abff9 1Summary: Asynchronous JavaScript Engine
2Name: nodejs
dc34e812 3Version: 0.6.15
cb51f00f 4Release: 1
e85103e0
ER
5License: BSD and MIT and ASL 2.0 and GPLv3
6Group: Development/Languages
c3b531ba 7URL: http://www.nodejs.org/
cb51f00f 8Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
dc34e812 9# Source0-md5: 852cfb1ed8125a4cdba456446d869d19
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
cb51f00f
ER
96# Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
97CC=${CC#ccache }
98
a6070ceb 99# NOT autoconf so dont use macro
7372d27d 100export PYTHONPATH=tools
a6070ceb 101./configure \
b52d635c 102 --shared-cares \
a6070ceb
ER
103 --shared-v8 \
104 --shared-zlib \
7223b5ac 105 --without-npm \
a8f57a3f 106 --libdir=%{_libdir} \
210abff9 107 --prefix=%{_prefix}
108
bc5a5fec 109# build library
a6070ceb
ER
110%{__make} dynamiclib
111%{__make} program
7372d27d 112
a6070ceb
ER
113# relink with shared lib
114$CC -o out/Release/node src/node_main.cc -Isrc -Ideps/uv/include -lnode -Lout/Release
210abff9 115
116%install
117rm -rf $RPM_BUILD_ROOT
a6070ceb
ER
118%{__make} install \
119 DESTDIR=$RPM_BUILD_ROOT
120
e85103e0 121# for compat of fedora derivered scripts (shebangs)
c3b531ba
ER
122ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
123
e85103e0
ER
124# globally installed node modules (noarch)
125install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
126
127# default searchpaths
128install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
129
a6070ceb 130# install shared lib
7372d27d 131export PYTHONPATH=tools
8791ea86 132%{__python} tools/waf-light install \
7372d27d 133 --product-type=cshlib \
134 --destdir=$RPM_BUILD_ROOT
135
87c4fdf2
ER
136chmod a+x $RPM_BUILD_ROOT%{_libdir}/*.so*
137
a6070ceb
ER
138# create pkgconfig
139install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
140cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
141version=%{version}
c3b531ba 142prefix=%{_prefix}
87c4fdf2 143libdir=${prefix}/%{_lib}
a6070ceb
ER
144includedir=${prefix}/include/node
145
146Name: nodejs
147Description: Evented I/O for V8 JavaScript.
148Version: ${version}
149Cflags: -I${includedir}
150EOF
a752c1c0 151
bc5a5fec
ER
152%py_ocomp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
153%py_comp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
154# TODO: check it first
155#%%py_postclean %{_libdir}/node/wafadmin
156
a6070ceb
ER
157# install documentation
158install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/html
159cp -a doc/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/html
160cd $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
161install -d api
162mv html/api/*.markdown api
163mv html/api/api/* html/api
164rm -rf html/api/api
165cd -
166
210abff9 167%clean
168rm -rf $RPM_BUILD_ROOT
169
7372d27d 170%post -p /sbin/ldconfig
171%postun -p /sbin/ldconfig
172
210abff9 173%files
174%defattr(644,root,root,755)
a6070ceb 175%doc README.md AUTHORS ChangeLog LICENSE
210abff9 176%attr(755,root,root) %{_bindir}/node
c3b531ba 177%attr(755,root,root) %{_bindir}/nodejs
7372d27d 178%attr(755,root,root) %{_libdir}/libnode.so.*.*.*
e85103e0 179%ghost %{_libdir}/libnode.so.6
8791ea86 180%dir %{_libdir}/node
e85103e0
ER
181%dir %{_prefix}/lib/node
182%dir %{_prefix}/lib/node_modules
210abff9 183%{_mandir}/man1/node.1*
184
210abff9 185%files devel
186%defattr(644,root,root,755)
7372d27d 187%{_libdir}/libnode.so
58494f0c 188%{_includedir}/node
a6070ceb
ER
189%{_pkgconfigdir}/nodejs.pc
190
191%files doc
192%defattr(644,root,root,755)
193%doc %{_docdir}/%{name}-doc-%{version}
194
195%files waf
196%defattr(644,root,root,755)
c6be74cc 197%attr(755,root,root) %{_bindir}/node-waf
afb1c7e5
PZ
198%dir %{_libdir}/node/wafadmin
199%dir %{_libdir}/node/wafadmin/Tools
bc5a5fec 200%{_libdir}/node/wafadmin/*.py[co]
afb1c7e5
PZ
201%{_libdir}/node/wafadmin/*.py
202%{_libdir}/node/wafadmin/Tools/*.py
bc5a5fec 203%{_libdir}/node/wafadmin/Tools/*.py[co]
This page took 0.927691 seconds and 4 git commands to generate.