]> git.pld-linux.org Git - packages/nodejs.git/blame - nodejs.spec
- chmod hack still needed, fix libdir in .pc
[packages/nodejs.git] / nodejs.spec
CommitLineData
210abff9 1Summary: Asynchronous JavaScript Engine
2Name: nodejs
a6070ceb 3Version: 0.6.6
87c4fdf2 4Release: 2
210abff9 5License: BSD
6Group: Libraries
7URL: http://nodejs.org/
a6070ceb
ER
8Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
9# Source0-md5: 43836ebd6e8e9059c4584e3b5ab50009
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
a6070ceb 23BuildRequires: v8-devel >= 3.6
210abff9 24ExclusiveArch: %{ix86} %{x8664} arm
25BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27%description
28Node's goal is to provide an easy way to build scalable network
29programs. In the above example, the two second delay does not prevent
30the server from handling new requests. Node tells the operating system
31(through epoll, kqueue, /dev/poll, or select) that it should be
32notified when the 2 seconds are up or if a new connection is made --
33then it goes to sleep. If someone new connects, then it executes the
34callback, if the timeout expires, it executes the inner callback. Each
35connection is only a small heap allocation.
36
210abff9 37%package devel
12a49d35 38Summary: Development headers for nodejs
210abff9 39Group: Development/Libraries
a8f57a3f 40Requires: %{name} = %{version}-%{release}
210abff9 41
42%description devel
12a49d35 43Development headers for nodejs.
210abff9 44
a6070ceb
ER
45%package doc
46Summary: Evented I/O for V8 JavaScript - documentation
47Group: Documentation
48
49%description doc
50Node.js is a server-side JavaScript environment that uses an
51asynchronous event-driven model. Node's goal is to provide an easy way
52to build scalable network programs.
53
54This package contains the documentation for nodejs.
55
56%package waf
57Summary: Evented I/O for V8 JavaScript - customized WAF build system
58Group: Libraries
59Requires: %{name} = %{version}-%{release}
60
61%description waf
62Node.js is a server-side JavaScript environment that uses an
63asynchronous event-driven model. Node's goal is to provide an easy way
64to build scalable network programs.
65
66This package contains the customized version of the WAF build system
67used by Node.js and many of its modules.
68
210abff9 69%prep
70%setup -q -n node-v%{version}
fb6f511a 71%patch1 -p1
a6070ceb
ER
72%if %{_lib} == "lib64"
73%patch3 -p1
74%else
75%patch2 -p1
76%endif
210abff9 77
78%build
a6070ceb 79%undefine with_ccache
210abff9 80# build library
a6070ceb
ER
81CFLAGS="%{rpmcflags} -fPIC"
82CXXFLAGS="%{rpmcxxflags} -fPIC"
210abff9 83LDFLAGS="%{rpmcflags}"
84%if "%{pld_release}" == "ac"
8791ea86
ER
85CC="%{__cc}4"
86CXX="%{__cxx}4"
210abff9 87%else
8791ea86
ER
88CC="%{__cc}"
89CXX="%{__cxx}"
210abff9 90%endif
58494f0c 91export CFLAGS LDFLAGS CXXFLAGS CC CXX
210abff9 92
a6070ceb 93# NOT autoconf so dont use macro
7372d27d 94export PYTHONPATH=tools
a6070ceb 95./configure \
b52d635c 96 --shared-cares \
a6070ceb
ER
97 --shared-v8 \
98 --shared-zlib \
a8f57a3f 99 --libdir=%{_libdir} \
210abff9 100 --prefix=%{_prefix}
101
a6070ceb
ER
102%{__make} dynamiclib
103%{__make} program
7372d27d 104
a6070ceb
ER
105# relink with shared lib
106$CC -o out/Release/node src/node_main.cc -Isrc -Ideps/uv/include -lnode -Lout/Release
210abff9 107
108%install
109rm -rf $RPM_BUILD_ROOT
a6070ceb
ER
110%{__make} install \
111 DESTDIR=$RPM_BUILD_ROOT
112
113# install shared lib
7372d27d 114export PYTHONPATH=tools
8791ea86 115%{__python} tools/waf-light install \
7372d27d 116 --product-type=cshlib \
117 --destdir=$RPM_BUILD_ROOT
118
87c4fdf2
ER
119chmod a+x $RPM_BUILD_ROOT%{_libdir}/*.so*
120
a6070ceb
ER
121# create pkgconfig
122install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
123cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
124version=%{version}
125prefix=/usr
87c4fdf2 126libdir=${prefix}/%{_lib}
a6070ceb
ER
127includedir=${prefix}/include/node
128
129Name: nodejs
130Description: Evented I/O for V8 JavaScript.
131Version: ${version}
132Cflags: -I${includedir}
133EOF
a752c1c0 134
a6070ceb
ER
135# install documentation
136install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/html
137cp -a doc/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/html
138cd $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
139install -d api
140mv html/api/*.markdown api
141mv html/api/api/* html/api
142rm -rf html/api/api
143cd -
144
145# remove NPM; it's buggy in 0.6.3
146# but really we package npm from separate spec
147rm -rf $RPM_BUILD_ROOT%{_libdir}/node_modules
148rm $RPM_BUILD_ROOT%{_bindir}/npm
27cf5215 149
210abff9 150%clean
151rm -rf $RPM_BUILD_ROOT
152
7372d27d 153%post -p /sbin/ldconfig
154%postun -p /sbin/ldconfig
155
210abff9 156%files
157%defattr(644,root,root,755)
a6070ceb 158%doc README.md AUTHORS ChangeLog LICENSE
210abff9 159%attr(755,root,root) %{_bindir}/node
7372d27d 160%attr(755,root,root) %{_libdir}/libnode.so.*.*.*
8791ea86
ER
161%ghost %{_libdir}/libnode.so.4
162%dir %{_libdir}/node
210abff9 163%{_mandir}/man1/node.1*
164
210abff9 165%files devel
166%defattr(644,root,root,755)
7372d27d 167%{_libdir}/libnode.so
58494f0c 168%{_includedir}/node
a6070ceb
ER
169%{_pkgconfigdir}/nodejs.pc
170
171%files doc
172%defattr(644,root,root,755)
173%doc %{_docdir}/%{name}-doc-%{version}
174
175%files waf
176%defattr(644,root,root,755)
c6be74cc 177%attr(755,root,root) %{_bindir}/node-waf
afb1c7e5
PZ
178%dir %{_libdir}/node/wafadmin
179%dir %{_libdir}/node/wafadmin/Tools
180%{_libdir}/node/wafadmin/*.py
181%{_libdir}/node/wafadmin/Tools/*.py
This page took 0.101028 seconds and 4 git commands to generate.