]> git.pld-linux.org Git - packages/nodejs.git/blob - nodejs.spec
- fix api docs
[packages/nodejs.git] / nodejs.spec
1 Summary:        Asynchronous JavaScript Engine
2 Name:           nodejs
3 Version:        0.6.19
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:  f5669a9717422b811c6bad1cc961b1e5
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 # Fix linking of zlib
16 Patch4:         %{name}-shared-zlib.patch
17 BuildRequires:  c-ares-devel >= 1.7.4
18 BuildRequires:  gcc >= 5:4.0
19 BuildRequires:  libeio-devel
20 BuildRequires:  libev-devel >= 4.0.0
21 BuildRequires:  libstdc++-devel
22 BuildRequires:  python >= 1:2.5.2
23 BuildRequires:  python-jsmin
24 BuildRequires:  rpm >= 4.4.9-56
25 BuildRequires:  rpmbuild(macros) >= 1.219
26 BuildRequires:  v8-devel >= 3.6
27 ExclusiveArch:  %{ix86} %{x8664} arm
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %description
31 Node.js is a platform built on Chrome's JavaScript runtime for easily
32 building fast, scalable network applications. Node.js uses an
33 event-driven, non-blocking I/O model that makes it lightweight and
34 efficient, perfect for data-intensive real-time applications that run
35 across distributed devices.
36
37 %package devel
38 Summary:        Development headers for nodejs
39 Group:          Development/Libraries
40 Requires:       %{name} = %{version}-%{release}
41 Requires:       %{name}-waf = %{version}-%{release}
42 Requires:       gcc
43 Requires:       libstdc++-devel
44 Requires:       v8-devel
45
46 %description devel
47 Development headers for nodejs.
48
49 %package doc
50 Summary:        Evented I/O for V8 JavaScript - documentation
51 Group:          Documentation
52
53 %description doc
54 Node.js is a server-side JavaScript environment that uses an
55 asynchronous event-driven model. Node's goal is to provide an easy way
56 to build scalable network programs.
57
58 This package contains the documentation for nodejs.
59
60 %package waf
61 Summary:        Evented I/O for V8 JavaScript - customized WAF build system
62 Group:          Libraries
63 Requires:       %{name} = %{version}-%{release}
64
65 %description waf
66 Node.js is a server-side JavaScript environment that uses an
67 asynchronous event-driven model. Node's goal is to provide an easy way
68 to build scalable network programs.
69
70 This package contains the customized version of the WAF build system
71 used by Node.js and many of its modules.
72
73 %prep
74 %setup -q -n node-v%{version}
75 %patch1 -p1
76 %if %{_lib} == "lib64"
77 %patch3 -p1
78 %else
79 %patch2 -p1
80 %endif
81
82 %patch4 -p1
83
84 # fix #!/usr/bin/env python -> #!/usr/bin/python:
85 grep -rl 'bin/env python' tools | xargs %{__sed} -i -e '1s,^#!.*python,#!%{__python},'
86
87 %build
88 CFLAGS="%{rpmcflags} -fPIC"
89 CXXFLAGS="%{rpmcxxflags} -fPIC"
90 LDFLAGS="%{rpmcflags}"
91 %if "%{pld_release}" == "ac"
92 CC="%{__cc}4"
93 CXX="%{__cxx}4"
94 %else
95 CC="%{__cc}"
96 CXX="%{__cxx}"
97 %endif
98 export CFLAGS LDFLAGS CXXFLAGS CC CXX
99
100 # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
101 CC=${CC#ccache }
102
103 # NOT autoconf so dont use macro
104 export PYTHONPATH=tools
105 ./configure \
106         --shared-cares \
107         --shared-v8 \
108         --shared-zlib \
109         --without-npm \
110         --libdir=%{_libdir} \
111         --prefix=%{_prefix}
112
113 # build library
114 %{__make} dynamiclib
115 %{__make} program
116
117 # relink with shared lib
118 $CC -o out/Release/node src/node_main.cc -Isrc -Ideps/uv/include -lnode -Lout/Release
119
120 %install
121 rm -rf $RPM_BUILD_ROOT
122 %{__make} install \
123         DESTDIR=$RPM_BUILD_ROOT
124
125 # for compat of fedora derivered scripts (shebangs)
126 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
127
128 # globally installed node modules (noarch)
129 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
130
131 # default searchpaths
132 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
133
134 # install shared lib
135 export PYTHONPATH=tools
136 %{__python} tools/waf-light install \
137         --product-type=cshlib \
138         --destdir=$RPM_BUILD_ROOT
139
140 chmod a+x $RPM_BUILD_ROOT%{_libdir}/*.so*
141
142 # create pkgconfig
143 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
144 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
145 version=%{version}
146 prefix=%{_prefix}
147 libdir=${prefix}/%{_lib}
148 includedir=${prefix}/include/node
149
150 Name: nodejs
151 Description: Evented I/O for V8 JavaScript.
152 Version: ${version}
153 Cflags: -I${includedir}
154 EOF
155
156 %py_ocomp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
157 %py_comp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
158 # TODO: check it first
159 #%%py_postclean %{_libdir}/node/wafadmin
160
161 # install documentation
162 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
163 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
164 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
165 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
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.041809 seconds and 4 git commands to generate.