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