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