]> git.pld-linux.org Git - packages/nodejs.git/blob - nodejs.spec
- up to 0.6.13
[packages/nodejs.git] / nodejs.spec
1 Summary:        Asynchronous JavaScript Engine
2 Name:           nodejs
3 Version:        0.6.13
4 Release:        1
5 License:        BSD and MIT and ASL 2.0 and GPLv3
6 Group:          Development/Languages
7 URL:            http://www.nodejs.org/
8 Source0:        http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
9 # Source0-md5:  87078586e226fd7a4db60d38bea9aad6
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:  rpmbuild(macros) >= 1.219
24 BuildRequires:  v8-devel >= 3.6
25 ExclusiveArch:  %{ix86} %{x8664} arm
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 %description
29 Node.js is a platform built on Chrome's JavaScript runtime for easily
30 building fast, scalable network applications. Node.js uses an
31 event-driven, non-blocking I/O model that makes it lightweight and
32 efficient, perfect for data-intensive real-time applications that run
33 across distributed devices.
34
35 %package devel
36 Summary:        Development headers for nodejs
37 Group:          Development/Libraries
38 Requires:       %{name} = %{version}-%{release}
39 Requires:       %{name}-waf = %{version}-%{release}
40 Requires:       gcc
41 Requires:       libstdc++-devel
42 Requires:       v8-devel
43
44 %description devel
45 Development headers for nodejs.
46
47 %package doc
48 Summary:        Evented I/O for V8 JavaScript - documentation
49 Group:          Documentation
50
51 %description doc
52 Node.js is a server-side JavaScript environment that uses an
53 asynchronous event-driven model. Node's goal is to provide an easy way
54 to build scalable network programs.
55
56 This package contains the documentation for nodejs.
57
58 %package waf
59 Summary:        Evented I/O for V8 JavaScript - customized WAF build system
60 Group:          Libraries
61 Requires:       %{name} = %{version}-%{release}
62
63 %description waf
64 Node.js is a server-side JavaScript environment that uses an
65 asynchronous event-driven model. Node's goal is to provide an easy way
66 to build scalable network programs.
67
68 This package contains the customized version of the WAF build system
69 used by Node.js and many of its modules.
70
71 %prep
72 %setup -q -n node-v%{version}
73 %patch1 -p1
74 %if %{_lib} == "lib64"
75 %patch3 -p1
76 %else
77 %patch2 -p1
78 %endif
79
80 # fix #!/usr/bin/env python -> #!/usr/bin/python:
81 grep -rl 'bin/env python' tools | xargs %{__sed} -i -e '1s,^#!.*python,#!%{__python},'
82
83 %build
84 CFLAGS="%{rpmcflags} -fPIC"
85 CXXFLAGS="%{rpmcxxflags} -fPIC"
86 LDFLAGS="%{rpmcflags}"
87 %if "%{pld_release}" == "ac"
88 CC="%{__cc}4"
89 CXX="%{__cxx}4"
90 %else
91 CC="%{__cc}"
92 CXX="%{__cxx}"
93 %endif
94 export CFLAGS LDFLAGS CXXFLAGS CC CXX
95
96 # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
97 CC=${CC#ccache }
98
99 # NOT autoconf so dont use macro
100 export PYTHONPATH=tools
101 ./configure \
102         --shared-cares \
103         --shared-v8 \
104         --shared-zlib \
105         --without-npm \
106         --libdir=%{_libdir} \
107         --prefix=%{_prefix}
108
109 # build library
110 %{__make} dynamiclib
111 %{__make} program
112
113 # relink with shared lib
114 $CC -o out/Release/node src/node_main.cc -Isrc -Ideps/uv/include -lnode -Lout/Release
115
116 %install
117 rm -rf $RPM_BUILD_ROOT
118 %{__make} install \
119         DESTDIR=$RPM_BUILD_ROOT
120
121 # for compat of fedora derivered scripts (shebangs)
122 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
123
124 # globally installed node modules (noarch)
125 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
126
127 # default searchpaths
128 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
129
130 # install shared lib
131 export PYTHONPATH=tools
132 %{__python} tools/waf-light install \
133         --product-type=cshlib \
134         --destdir=$RPM_BUILD_ROOT
135
136 chmod a+x $RPM_BUILD_ROOT%{_libdir}/*.so*
137
138 # create pkgconfig
139 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
140 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
141 version=%{version}
142 prefix=%{_prefix}
143 libdir=${prefix}/%{_lib}
144 includedir=${prefix}/include/node
145
146 Name: nodejs
147 Description: Evented I/O for V8 JavaScript.
148 Version: ${version}
149 Cflags: -I${includedir}
150 EOF
151
152 %py_ocomp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
153 %py_comp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
154 # TODO: check it first
155 #%%py_postclean %{_libdir}/node/wafadmin
156
157 # install documentation
158 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/html
159 cp -a doc/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/html
160 cd $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
161 install -d api
162 mv html/api/*.markdown api
163 mv html/api/api/* html/api
164 rm -rf html/api/api
165 cd -
166
167 %clean
168 rm -rf $RPM_BUILD_ROOT
169
170 %post   -p /sbin/ldconfig
171 %postun -p /sbin/ldconfig
172
173 %files
174 %defattr(644,root,root,755)
175 %doc README.md AUTHORS ChangeLog LICENSE
176 %attr(755,root,root) %{_bindir}/node
177 %attr(755,root,root) %{_bindir}/nodejs
178 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
179 %ghost %{_libdir}/libnode.so.6
180 %dir %{_libdir}/node
181 %dir %{_prefix}/lib/node
182 %dir %{_prefix}/lib/node_modules
183 %{_mandir}/man1/node.1*
184
185 %files devel
186 %defattr(644,root,root,755)
187 %{_libdir}/libnode.so
188 %{_includedir}/node
189 %{_pkgconfigdir}/nodejs.pc
190
191 %files doc
192 %defattr(644,root,root,755)
193 %doc %{_docdir}/%{name}-doc-%{version}
194
195 %files waf
196 %defattr(644,root,root,755)
197 %attr(755,root,root) %{_bindir}/node-waf
198 %dir %{_libdir}/node/wafadmin
199 %dir %{_libdir}/node/wafadmin/Tools
200 %{_libdir}/node/wafadmin/*.py[co]
201 %{_libdir}/node/wafadmin/*.py
202 %{_libdir}/node/wafadmin/Tools/*.py
203 %{_libdir}/node/wafadmin/Tools/*.py[co]
This page took 0.104637 seconds and 4 git commands to generate.