]> git.pld-linux.org Git - packages/nodejs.git/blob - nodejs.spec
update deps for -devel package
[packages/nodejs.git] / nodejs.spec
1 Summary:        Asynchronous JavaScript Engine
2 Name:           nodejs
3 Version:        0.10.3
4 Release:        4
5 License:        BSD and MIT and Apache v2.0 and GPL v3
6 Group:          Development/Languages
7 Source0:        http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
8 # Source0-md5:  4daca92618515708a4631e98a8e8c779
9 Patch1:         %{name}-shared.patch
10 # force node to use /usr/lib/node as the systemwide module directory
11 Patch2:         %{name}-libpath.patch
12 # use /usr/lib64/node as an arch-specific module dir when appropriate
13 Patch3:         %{name}-lib64path.patch
14 Patch5:         uv-fpic.patch
15 URL:            http://www.nodejs.org/
16 BuildRequires:  c-ares-devel
17 BuildRequires:  gcc >= 5:4.0
18 BuildRequires:  http-parser-devel >= 2.0
19 BuildRequires:  libstdc++-devel
20 BuildRequires:  libuv-devel >= %{version}
21 BuildRequires:  openssl-devel
22 BuildRequires:  pkgconfig
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.15.11.10
28 BuildRequires:  zlib-devel
29 BuildConflicts: eio
30 Obsoletes:      nodejs-waf
31 ExclusiveArch:  %{ix86} %{x8664} arm
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %description
35 Node.js is a platform built on Chrome's JavaScript runtime for easily
36 building fast, scalable network applications. Node.js uses an
37 event-driven, non-blocking I/O model that makes it lightweight and
38 efficient, perfect for data-intensive real-time applications that run
39 across distributed devices.
40
41 %package devel
42 Summary:        Development headers for nodejs
43 Group:          Development/Libraries
44 Requires:       %{name} = %{version}-%{release}
45 Requires:       c-ares-devel
46 Requires:       gcc
47 Requires:       http-parser-devel
48 Requires:       libstdc++-devel
49 Requires:       libuv-devel
50 Requires:       openssl-devel
51 Requires:       v8-devel
52 Requires:       zlib-devel
53
54 %description devel
55 Development headers for nodejs.
56
57 %package doc
58 Summary:        Evented I/O for V8 JavaScript - documentation
59 Group:          Documentation
60
61 %description doc
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 documentation for nodejs.
67
68 %prep
69 %setup -q -n node-v%{version}
70 %patch1 -p1
71 %if %{_lib} == "lib64"
72 %patch3 -p1
73 %else
74 %patch2 -p1
75 %endif
76 %patch5 -p1
77
78 %build
79 # Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
80 CC=${CC#ccache }
81
82 # add defines from libuv (RHBZ#892601)
83 export CFLAGS="%{rpmcflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
84 export CXXFLAGS="%{rpmcppflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
85
86 # NOT autoconf so don't use macro
87 export PYTHONPATH=tools
88 ./configure \
89         --shared-v8 \
90         --shared-zlib \
91         --shared-openssl \
92         --shared-cares \
93         --shared-libuv \
94         --shared-http-parser \
95         --without-npm \
96         --without-dtrace \
97         --prefix=%{_prefix}
98
99 %{__make} -C out \
100         BUILDTYPE=Release \
101         V=1 \
102         CFLAGS.host="%{rpmcflags} -fPIC" \
103         CXXFLAGS.host="%{rpmcppflags} -fPIC" \
104         LDFLAGS.host="%{rpmcflags}" \
105         CFLAGS.target="%{rpmcflags} -fPIC" \
106         CXXFLAGS.target="%{rpmcppflags} -fPIC" \
107         LDFLAGS.target="%{rpmcflags}" \
108         CC.host="%{__cc}" \
109         CXX.host="%{__cxx}" \
110         CC.target="%{__cc}" \
111         CXX.target="%{__cxx}"
112
113 %install
114 rm -rf $RPM_BUILD_ROOT
115 %{__make} justinstall \
116         DESTDIR=$RPM_BUILD_ROOT \
117         LIBDIR=%{_lib}
118
119 # no dtrace on linux
120 %{__rm} -r $RPM_BUILD_ROOT%{_prefix}/lib/dtrace/node.d
121
122 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*)
123 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
124 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
125
126 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
127
128 install -d $RPM_BUILD_ROOT%{_includedir}/node
129 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
130
131 # install for node-gyp
132 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
133 cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
134 ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
135
136 # for compat of fedora derivered scripts (shebangs)
137 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
138
139 # globally installed node modules (noarch)
140 install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
141
142 # default searchpaths
143 install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
144
145 # create pkgconfig
146 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
147 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
148 version=%{version}
149 prefix=%{_prefix}
150 libdir=${prefix}/%{_lib}
151 includedir=${prefix}/include/node
152
153 Name: nodejs
154 Description: Evented I/O for V8 JavaScript.
155 Version: ${version}
156 Cflags: -I${includedir}
157 EOF
158
159 # install documentation
160 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
161 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
162 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
163 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
164
165 %clean
166 rm -rf $RPM_BUILD_ROOT
167
168 %post   -p /sbin/ldconfig
169 %postun -p /sbin/ldconfig
170
171 %files
172 %defattr(644,root,root,755)
173 %doc README.md AUTHORS ChangeLog LICENSE
174 %attr(755,root,root) %{_bindir}/node
175 %attr(755,root,root) %{_bindir}/nodejs
176 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
177 %ghost %{_libdir}/libnode.so.10
178 %if "%{_lib}" != "lib"
179 %dir %{_libdir}/node
180 %endif
181 %dir %{_prefix}/lib/node
182 %dir %{_prefix}/lib/node_modules
183 %{_mandir}/man1/node.1*
184 %{_mandir}/man1/nodejs.1
185
186 %files devel
187 %defattr(644,root,root,755)
188 %{_libdir}/libnode.so
189 %{_includedir}/node
190 %{_pkgconfigdir}/nodejs.pc
191 %{_usrsrc}/%{name}
192
193 %files doc
194 %defattr(644,root,root,755)
195 %doc %{_docdir}/%{name}-doc-%{version}
This page took 0.092583 seconds and 4 git commands to generate.