]> git.pld-linux.org Git - packages/nodejs.git/blame - nodejs.spec
- reverted to glen's version
[packages/nodejs.git] / nodejs.spec
CommitLineData
210abff9 1Summary: Asynchronous JavaScript Engine
2Name: nodejs
a600c300 3Version: 0.6.21
7c7c1bb0 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
a600c300
ŁC
9# Source0-md5: 0da985a0bf820400af92363b9f453fe4
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
1385a038 15Patch5: uv-fpic.patch
a3293030 16BuildRequires: c-ares-devel >= 1.7.4
12a49d35 17BuildRequires: gcc >= 5:4.0
210abff9 18BuildRequires: libeio-devel
a3293030 19BuildRequires: libev-devel >= 4.0.0
210abff9 20BuildRequires: libstdc++-devel
a6070ceb
ER
21BuildRequires: python >= 1:2.5.2
22BuildRequires: python-jsmin
12a49d35 23BuildRequires: rpm >= 4.4.9-56
d44c8857 24BuildRequires: rpmbuild(macros) >= 1.219
a6070ceb 25BuildRequires: v8-devel >= 3.6
210abff9 26ExclusiveArch: %{ix86} %{x8664} arm
27BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
28
29%description
c3b531ba
ER
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.
210abff9 35
210abff9 36%package devel
12a49d35 37Summary: Development headers for nodejs
210abff9 38Group: Development/Libraries
a8f57a3f 39Requires: %{name} = %{version}-%{release}
d44c8857
ER
40Requires: %{name}-waf = %{version}-%{release}
41Requires: gcc
42Requires: libstdc++-devel
fae304aa 43Requires: v8-devel
210abff9 44
45%description devel
12a49d35 46Development headers for nodejs.
210abff9 47
a6070ceb
ER
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
210abff9 72%prep
73%setup -q -n node-v%{version}
a600c300 74%patch1 -p1
a6070ceb
ER
75%if %{_lib} == "lib64"
76%patch3 -p1
77%else
78%patch2 -p1
79%endif
1385a038 80%patch5 -p1
c4aa3bb0 81
bc5a5fec
ER
82# fix #!/usr/bin/env python -> #!/usr/bin/python:
83grep -rl 'bin/env python' tools | xargs %{__sed} -i -e '1s,^#!.*python,#!%{__python},'
84
210abff9 85%build
a6070ceb 86CFLAGS="%{rpmcflags} -fPIC"
1385a038 87CPPFLAGS="%{rpmcppflags} -fPIC"
a6070ceb 88CXXFLAGS="%{rpmcxxflags} -fPIC"
210abff9 89LDFLAGS="%{rpmcflags}"
90%if "%{pld_release}" == "ac"
8791ea86
ER
91CC="%{__cc}4"
92CXX="%{__cxx}4"
210abff9 93%else
8791ea86
ER
94CC="%{__cc}"
95CXX="%{__cxx}"
210abff9 96%endif
1385a038 97export CFLAGS LDFLAGS CXXFLAGS CC CXX LINKFLAGS_UV
210abff9 98
cb51f00f
ER
99# Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
100CC=${CC#ccache }
a600c300
ŁC
101
102# NOT autoconf so dont use macro
103export PYTHONPATH=tools
a6070ceb 104./configure \
a600c300 105 --shared-cares \
a6070ceb
ER
106 --shared-v8 \
107 --shared-zlib \
7223b5ac 108 --without-npm \
a600c300 109 --libdir=%{_libdir} \
210abff9 110 --prefix=%{_prefix}
111
bc5a5fec 112# build library
a600c300
ŁC
113%{__make} dynamiclib
114%{__make} program
115
116# relink with shared lib
117$CC -o out/Release/node src/node_main.cc -Isrc -Ideps/uv/include -lnode -Lout/Release
210abff9 118
119%install
120rm -rf $RPM_BUILD_ROOT
a6070ceb
ER
121%{__make} install \
122 DESTDIR=$RPM_BUILD_ROOT
123
c7898157
ER
124echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
125
e85103e0 126# for compat of fedora derivered scripts (shebangs)
c3b531ba
ER
127ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
128
e85103e0
ER
129# globally installed node modules (noarch)
130install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
131
132# default searchpaths
133install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
134
a6070ceb 135# install shared lib
7372d27d 136export PYTHONPATH=tools
a600c300
ŁC
137%{__python} tools/waf-light install \
138 --product-type=cshlib \
139 --destdir=$RPM_BUILD_ROOT
7372d27d 140
a600c300 141chmod a+x $RPM_BUILD_ROOT%{_libdir}/*.so*
87c4fdf2 142
a6070ceb
ER
143# create pkgconfig
144install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
145cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
146version=%{version}
c3b531ba 147prefix=%{_prefix}
87c4fdf2 148libdir=${prefix}/%{_lib}
a6070ceb
ER
149includedir=${prefix}/include/node
150
151Name: nodejs
152Description: Evented I/O for V8 JavaScript.
153Version: ${version}
154Cflags: -I${includedir}
155EOF
a752c1c0 156
bc5a5fec
ER
157%py_ocomp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
158%py_comp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
159# TODO: check it first
160#%%py_postclean %{_libdir}/node/wafadmin
161
a6070ceb 162# install documentation
6f7eebb5
ER
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
a6070ceb 167
210abff9 168%clean
169rm -rf $RPM_BUILD_ROOT
170
7372d27d 171%post -p /sbin/ldconfig
172%postun -p /sbin/ldconfig
173
210abff9 174%files
175%defattr(644,root,root,755)
a6070ceb 176%doc README.md AUTHORS ChangeLog LICENSE
210abff9 177%attr(755,root,root) %{_bindir}/node
c3b531ba 178%attr(755,root,root) %{_bindir}/nodejs
a600c300
ŁC
179%attr(755,root,root) %{_libdir}/libnode.so.*.*.*
180%ghost %{_libdir}/libnode.so.6
181%if "%{_lib}" != "lib"
8791ea86 182%dir %{_libdir}/node
a600c300
ŁC
183%endif
184%dir %{_prefix}/lib/node
e85103e0 185%dir %{_prefix}/lib/node_modules
210abff9 186%{_mandir}/man1/node.1*
c7898157 187%{_mandir}/man1/nodejs.1
210abff9 188
210abff9 189%files devel
190%defattr(644,root,root,755)
a600c300 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.077996 seconds and 4 git commands to generate.