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