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