]> git.pld-linux.org Git - packages/nodejs.git/blob - nodejs.spec
buildconflicts eio vs libeio
[packages/nodejs.git] / nodejs.spec
1 Summary:        Asynchronous JavaScript Engine
2 Name:           nodejs
3 Version:        0.8.15
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:  6cb31180b07475db103e694f65e8bb9b
10 Patch1:     %{name}-shared.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 Patch5:         uv-fpic.patch
16 BuildRequires:  gcc >= 5:4.0
17 BuildRequires:  libstdc++-devel
18 BuildRequires:  python >= 1:2.5.2
19 BuildRequires:  python-jsmin
20 BuildRequires:  rpm >= 4.4.9-56
21 BuildRequires:  rpmbuild(macros) >= 1.219
22 BuildRequires:  v8-devel >= 3.11.10.25
23 BuildConflicts: eio
24 ExclusiveArch:  %{ix86} %{x8664} arm
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27 %description
28 Node.js is a platform built on Chrome's JavaScript runtime for easily
29 building fast, scalable network applications. Node.js uses an
30 event-driven, non-blocking I/O model that makes it lightweight and
31 efficient, perfect for data-intensive real-time applications that run
32 across distributed devices.
33
34 %package devel
35 Summary:        Development headers for nodejs
36 Group:          Development/Libraries
37 Requires:       %{name} = %{version}-%{release}
38 Requires:       %{name}-waf = %{version}-%{release}
39 Requires:       gcc
40 Requires:       libstdc++-devel
41 Requires:       v8-devel
42
43 %description devel
44 Development headers for nodejs.
45
46 %package doc
47 Summary:        Evented I/O for V8 JavaScript - documentation
48 Group:          Documentation
49
50 %description doc
51 Node.js is a server-side JavaScript environment that uses an
52 asynchronous event-driven model. Node's goal is to provide an easy way
53 to build scalable network programs.
54
55 This package contains the documentation for nodejs.
56
57 %package waf
58 Summary:        Evented I/O for V8 JavaScript - customized WAF build system
59 Group:          Libraries
60 Requires:       %{name} = %{version}-%{release}
61
62 %description waf
63 Node.js is a server-side JavaScript environment that uses an
64 asynchronous event-driven model. Node's goal is to provide an easy way
65 to build scalable network programs.
66
67 This package contains the customized version of the WAF build system
68 used by Node.js and many of its modules.
69
70 %prep
71 %setup -q -n node-v%{version}
72 %patch1 -p1
73 %if %{_lib} == "lib64"
74 %patch3 -p1
75 %else
76 %patch2 -p1
77 %endif
78 %patch5 -p1
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
85 # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
86 CC=${CC#ccache }
87
88 # NOT autoconf so dont use macro
89 export PYTHONPATH=tools
90 ./configure \
91         --shared-v8 \
92         --shared-zlib \
93         --shared-openssl \
94         --without-npm \
95         --prefix=%{_prefix}
96
97 %make -C out \
98     BUILDTYPE=Release \
99     V=1 \
100     CFLAGS.host="%{rpmcflags} -fPIC" \
101     CXXFLAGS.host="%{rpmcppflags} -fPIC" \
102     LDFLAGS.host="%{rpmcflags}" \
103     CFLAGS.target="%{rpmcflags} -fPIC" \
104     CXXFLAGS.target="%{rpmcppflags} -fPIC" \
105     LDFLAGS.target="%{rpmcflags}" \
106 %if "%{pld_release}" == "ac"
107     CC.host="%{__cc}4" \
108     CXX.host="%{__cxx}4" \
109     CC.target="%{__cc}4" \
110     CXX.target="%{__cxx}4" \
111 %else
112     CC.host="%{__cc}" \
113     CXX.host="%{__cxx}" \
114     CC.target="%{__cc}" \
115     CXX.target="%{__cxx}"
116 %endif
117
118 %install
119 rm -rf $RPM_BUILD_ROOT
120 install -d $RPM_BUILD_ROOT/%{_prefix}/lib/node/wafadmin
121 %{__make} justinstall \
122         DESTDIR=$RPM_BUILD_ROOT \
123     LIBDIR=%{_lib}
124
125 ln -s libnode.so.8.0.0 $RPM_BUILD_ROOT%{_libdir}/libnode.so.8
126 ln -s libnode.so.8.0.0 $RPM_BUILD_ROOT%{_libdir}/libnode.so
127
128 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
129
130 # for compat of fedora derivered scripts (shebangs)
131 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
132
133 # globally installed node modules (noarch)
134 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
135
136 # default searchpaths
137 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
138
139 # create pkgconfig
140 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
141 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
142 version=%{version}
143 prefix=%{_prefix}
144 libdir=${prefix}/%{_lib}
145 includedir=${prefix}/include/node
146
147 Name: nodejs
148 Description: Evented I/O for V8 JavaScript.
149 Version: ${version}
150 Cflags: -I${includedir}
151 EOF
152
153 %py_ocomp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
154 %py_comp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
155 # TODO: check it first
156 #%%py_postclean %{_libdir}/node/wafadmin
157
158 # install documentation
159 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
160 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
161 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
162 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
163
164 %clean
165 rm -rf $RPM_BUILD_ROOT
166
167 %post   -p /sbin/ldconfig
168 %postun -p /sbin/ldconfig
169
170 %files
171 %defattr(644,root,root,755)
172 %doc README.md AUTHORS ChangeLog LICENSE
173 %attr(755,root,root) %{_bindir}/node
174 %attr(755,root,root) %{_bindir}/nodejs
175 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
176 %ghost %{_libdir}/libnode.so.8
177 %if "%{_lib}" != "lib"
178 %dir %{_libdir}/node
179 %endif
180 %dir %{_prefix}/lib/node
181 %dir %{_prefix}/lib/node_modules
182 %{_mandir}/man1/node.1*
183 %{_mandir}/man1/nodejs.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.139654 seconds and 4 git commands to generate.