]> git.pld-linux.org Git - packages/nodejs.git/blame - nodejs.spec
- Build as shared library and install properly in lib64
[packages/nodejs.git] / nodejs.spec
CommitLineData
210abff9 1
210abff9 2Summary: Asynchronous JavaScript Engine
3Name: nodejs
5e9fa89b 4Version: 0.4.1
210abff9 5Release: 0
6License: BSD
7Group: Libraries
8URL: http://nodejs.org/
9Source0: http://nodejs.org/dist/node-v%{version}.tar.gz
5e9fa89b 10# Source0-md5: 9566bdbd05c18cc2bbe1fa0fba60dd0a
a3293030 11Patch0: %{name}-ev-multiplicity.patch
a8f57a3f 12Patch1: %{name}-sharedlib.patch
13Patch2: %{name}-soname.patch
14Patch3: %{name}-libdir.patch
a3293030 15BuildRequires: c-ares-devel
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
21BuildRequires: python
12a49d35 22BuildRequires: rpm >= 4.4.9-56
2bc97491 23BuildRequires: v8-devel >= 3.1.5
a752c1c0 24BuildRequires: waf
210abff9 25ExclusiveArch: %{ix86} %{x8664} arm
26BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28%description
29Node's goal is to provide an easy way to build scalable network
30programs. In the above example, the two second delay does not prevent
31the server from handling new requests. Node tells the operating system
32(through epoll, kqueue, /dev/poll, or select) that it should be
33notified when the 2 seconds are up or if a new connection is made --
34then it goes to sleep. If someone new connects, then it executes the
35callback, if the timeout expires, it executes the inner callback. Each
36connection is only a small heap allocation.
37
210abff9 38%package devel
12a49d35 39Summary: Development headers for nodejs
210abff9 40Group: Development/Libraries
a752c1c0 41Requires: waf
a8f57a3f 42Requires: %{name} = %{version}-%{release}
210abff9 43
44%description devel
12a49d35 45Development headers for nodejs.
210abff9 46
47%prep
48%setup -q -n node-v%{version}
a3293030 49%patch0 -p1
a8f57a3f 50%patch1 -p1
51%patch2 -p1
52%patch3 -p0
210abff9 53
54%build
55# build library
210abff9 56CFLAGS="%{rpmcflags}"
57CXXFLAGS="%{rpmcxxflags}"
58LDFLAGS="%{rpmcflags}"
59%if "%{pld_release}" == "ac"
60CC=%{__cc}4
61CXX=%{__cxx}4
62%else
63CC=%{__cc}
64CXX=%{__cxx}
65%endif
58494f0c 66export CFLAGS LDFLAGS CXXFLAGS CC CXX
210abff9 67
58494f0c
ER
68export PYTHONPATH=tools
69%waf configure \
b52d635c 70 --shared-v8 \
71 --shared-cares \
72 --shared-libev \
a8f57a3f 73 --libdir=%{_libdir} \
210abff9 74 --prefix=%{_prefix}
75
a8f57a3f 76%waf build \
77 --product-type=cshlib
78
79$CC -o node -Isrc src/node_main.cc -lnode -Lbuild/default
210abff9 80
81%install
82rm -rf $RPM_BUILD_ROOT
6505a74e 83install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir},%{_libdir}/node/libraries,%{_libdir}/waf/wafadmin/Tools}
a752c1c0 84
58494f0c
ER
85export PYTHONPATH=tools
86%waf install \
a8f57a3f 87 --product-type=cshlib \
210abff9 88 --destdir=$RPM_BUILD_ROOT
89
a8f57a3f 90install node $RPM_BUILD_ROOT%{_bindir}/node
91
e550379f 92cp -a lib/*.js $RPM_BUILD_ROOT%{_libdir}/node/libraries
58494f0c 93cp tools/wafadmin/Tools/node_addon.py $RPM_BUILD_ROOT%{_libdir}/waf/wafadmin/Tools
6505a74e 94
a752c1c0 95rm $RPM_BUILD_ROOT%{_bindir}/node-waf
58494f0c
ER
96# ? really required?
97ln -s waf $RPM_BUILD_ROOT%{_bindir}/node-waf
a752c1c0 98
210abff9 99%clean
100rm -rf $RPM_BUILD_ROOT
101
a8f57a3f 102%post -p /sbin/ldconfig
103%postun -p /sbin/ldconfig
104
210abff9 105%files
106%defattr(644,root,root,755)
107%doc AUTHORS ChangeLog LICENSE
108%attr(755,root,root) %{_bindir}/node
210abff9 109%dir %{_libdir}/node
a8f57a3f 110%attr(755,root,root) %{_libdir}/libnode.so.*.*.*
210abff9 111%dir %{_libdir}/node/libraries
112%{_libdir}/node/libraries/*.js
113%{_mandir}/man1/node.1*
114
210abff9 115%files devel
116%defattr(644,root,root,755)
58494f0c 117%{_includedir}/node
c6be74cc 118%attr(755,root,root) %{_bindir}/node-waf
a8f57a3f 119%{_libdir}/libnode.so
6505a74e 120%{_libdir}/waf/wafadmin/Tools/node_addon.py
a8f57a3f 121%{_libdir}/pkgconfig/nodejs.pc
This page took 0.099543 seconds and 4 git commands to generate.