]> git.pld-linux.org Git - packages/nodejs.git/blame - nodejs.spec
- create .py[co]; fix shebangs
[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
bc5a5fec 16BuildRequires: rpmbuild(macros) >= 1.219
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
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}
210abff9 39
40%description devel
12a49d35 41Development headers for nodejs.
210abff9 42
a6070ceb
ER
43%package doc
44Summary: Evented I/O for V8 JavaScript - documentation
45Group: Documentation
46
47%description doc
48Node.js is a server-side JavaScript environment that uses an
49asynchronous event-driven model. Node's goal is to provide an easy way
50to build scalable network programs.
51
52This package contains the documentation for nodejs.
53
54%package waf
55Summary: Evented I/O for V8 JavaScript - customized WAF build system
56Group: Libraries
57Requires: %{name} = %{version}-%{release}
e85103e0
ER
58Requires: %{name}-devel
59Requires: gcc
60Requires: libstdc++-devel
a6070ceb
ER
61
62%description waf
63Node.js is a server-side JavaScript environment that uses an
64asynchronous event-driven model. Node's goal is to provide an easy way
65to build scalable network programs.
66
67This package contains the customized version of the WAF build system
68used by Node.js and many of its modules.
69
210abff9 70%prep
71%setup -q -n node-v%{version}
fb6f511a 72%patch1 -p1
a6070ceb
ER
73%if %{_lib} == "lib64"
74%patch3 -p1
75%else
76%patch2 -p1
77%endif
210abff9 78
bc5a5fec
ER
79# fix #!/usr/bin/env python -> #!/usr/bin/python:
80grep -rl 'bin/env python' tools | xargs %{__sed} -i -e '1s,^#!.*python,#!%{__python},'
81
210abff9 82%build
a6070ceb
ER
83CFLAGS="%{rpmcflags} -fPIC"
84CXXFLAGS="%{rpmcxxflags} -fPIC"
210abff9 85LDFLAGS="%{rpmcflags}"
86%if "%{pld_release}" == "ac"
8791ea86
ER
87CC="%{__cc}4"
88CXX="%{__cxx}4"
210abff9 89%else
8791ea86
ER
90CC="%{__cc}"
91CXX="%{__cxx}"
210abff9 92%endif
58494f0c 93export CFLAGS LDFLAGS CXXFLAGS CC CXX
210abff9 94
a6070ceb 95# NOT autoconf so dont use macro
7372d27d 96export PYTHONPATH=tools
a6070ceb 97./configure \
b52d635c 98 --shared-cares \
a6070ceb
ER
99 --shared-v8 \
100 --shared-zlib \
7223b5ac 101 --without-npm \
a8f57a3f 102 --libdir=%{_libdir} \
210abff9 103 --prefix=%{_prefix}
104
bc5a5fec 105# build library
a6070ceb
ER
106%{__make} dynamiclib
107%{__make} program
7372d27d 108
a6070ceb
ER
109# relink with shared lib
110$CC -o out/Release/node src/node_main.cc -Isrc -Ideps/uv/include -lnode -Lout/Release
210abff9 111
112%install
113rm -rf $RPM_BUILD_ROOT
a6070ceb
ER
114%{__make} install \
115 DESTDIR=$RPM_BUILD_ROOT
116
e85103e0 117# for compat of fedora derivered scripts (shebangs)
c3b531ba
ER
118ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
119
e85103e0
ER
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
a6070ceb 126# install shared lib
7372d27d 127export PYTHONPATH=tools
8791ea86 128%{__python} tools/waf-light install \
7372d27d 129 --product-type=cshlib \
130 --destdir=$RPM_BUILD_ROOT
131
87c4fdf2
ER
132chmod a+x $RPM_BUILD_ROOT%{_libdir}/*.so*
133
a6070ceb
ER
134# create pkgconfig
135install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
136cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
137version=%{version}
c3b531ba 138prefix=%{_prefix}
87c4fdf2 139libdir=${prefix}/%{_lib}
a6070ceb
ER
140includedir=${prefix}/include/node
141
142Name: nodejs
143Description: Evented I/O for V8 JavaScript.
144Version: ${version}
145Cflags: -I${includedir}
146EOF
a752c1c0 147
bc5a5fec
ER
148%py_ocomp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
149%py_comp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
150# TODO: check it first
151#%%py_postclean %{_libdir}/node/wafadmin
152
a6070ceb
ER
153# install documentation
154install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/html
155cp -a doc/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/html
156cd $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
157install -d api
158mv html/api/*.markdown api
159mv html/api/api/* html/api
160rm -rf html/api/api
161cd -
162
210abff9 163%clean
164rm -rf $RPM_BUILD_ROOT
165
7372d27d 166%post -p /sbin/ldconfig
167%postun -p /sbin/ldconfig
168
210abff9 169%files
170%defattr(644,root,root,755)
a6070ceb 171%doc README.md AUTHORS ChangeLog LICENSE
210abff9 172%attr(755,root,root) %{_bindir}/node
c3b531ba 173%attr(755,root,root) %{_bindir}/nodejs
7372d27d 174%attr(755,root,root) %{_libdir}/libnode.so.*.*.*
e85103e0 175%ghost %{_libdir}/libnode.so.6
8791ea86 176%dir %{_libdir}/node
e85103e0
ER
177%dir %{_prefix}/lib/node
178%dir %{_prefix}/lib/node_modules
210abff9 179%{_mandir}/man1/node.1*
180
210abff9 181%files devel
182%defattr(644,root,root,755)
7372d27d 183%{_libdir}/libnode.so
58494f0c 184%{_includedir}/node
a6070ceb
ER
185%{_pkgconfigdir}/nodejs.pc
186
187%files doc
188%defattr(644,root,root,755)
189%doc %{_docdir}/%{name}-doc-%{version}
190
191%files waf
192%defattr(644,root,root,755)
c6be74cc 193%attr(755,root,root) %{_bindir}/node-waf
afb1c7e5
PZ
194%dir %{_libdir}/node/wafadmin
195%dir %{_libdir}/node/wafadmin/Tools
bc5a5fec 196%{_libdir}/node/wafadmin/*.py[co]
afb1c7e5
PZ
197%{_libdir}/node/wafadmin/*.py
198%{_libdir}/node/wafadmin/Tools/*.py
bc5a5fec 199%{_libdir}/node/wafadmin/Tools/*.py[co]
This page took 0.087857 seconds and 4 git commands to generate.