]> git.pld-linux.org Git - packages/nodejs.git/blame - nodejs.spec
callout install.py directly instead of patching makefile
[packages/nodejs.git] / nodejs.spec
CommitLineData
29d6d704
ER
1#
2# Conditional build:
3%bcond_without system_v8 # system v8
4
8611106e
ER
5# NOTES:
6# - https://nodejs.org/en/download/releases/
7
210abff9 8Summary: Asynchronous JavaScript Engine
9Name: nodejs
8611106e
ER
10Version: 0.10.40
11Release: 0.1
d5764a43 12License: BSD and MIT and Apache v2.0 and GPL v3
e85103e0 13Group: Development/Languages
8611106e
ER
14Source0: https://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
15# Source0-md5: f6ef20f327ecd6cb1586c41c7184290c
4174c079 16Patch1: %{name}-shared.patch
a6070ceb
ER
17# force node to use /usr/lib/node as the systemwide module directory
18Patch2: %{name}-libpath.patch
19# use /usr/lib64/node as an arch-specific module dir when appropriate
20Patch3: %{name}-lib64path.patch
58e86022 21Patch4: %{name}-use-system-certs.patch
1385a038 22Patch5: uv-fpic.patch
be62a70f
ER
23# The invalid UTF8 fix has been reverted since this breaks v8 API, which cannot
24# be done in a stable distribution release. This build of nodejs will behave as
25# if NODE_INVALID_UTF8 was set. For more information on the implications, see:
26# http://blog.nodejs.org/2014/06/16/openssl-and-breaking-utf-8-change/
27Patch6: %{name}-revert-utf8-v8.patch
28Patch7: %{name}-revert-utf8-node.patch
8611106e 29URL: https://nodejs.org/
c1c359b8 30BuildRequires: c-ares-devel
12a49d35 31BuildRequires: gcc >= 5:4.0
e427e9b0 32BuildRequires: http-parser-devel >= 2.0
210abff9 33BuildRequires: libstdc++-devel
d8825fb6 34BuildRequires: libuv-devel >= 0.10
cd4c73aa
ER
35BuildRequires: openssl-devel
36BuildRequires: pkgconfig
a6070ceb
ER
37BuildRequires: python >= 1:2.5.2
38BuildRequires: python-jsmin
12a49d35 39BuildRequires: rpm >= 4.4.9-56
d44c8857 40BuildRequires: rpmbuild(macros) >= 1.219
536f9f5a 41BuildRequires: sed >= 4.0
29d6d704 42%{?with_system_v8:BuildRequires: v8-devel >= 3.15.11.10}
cd4c73aa 43BuildRequires: zlib-devel
58e86022 44Requires: ca-certificates
5ef76b51 45Obsoletes: nodejs-waf
210abff9 46ExclusiveArch: %{ix86} %{x8664} arm
47BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48
dc60a63b
ER
49%define sover %(echo %{version} | cut -d. -f2)
50
210abff9 51%description
c3b531ba
ER
52Node.js is a platform built on Chrome's JavaScript runtime for easily
53building fast, scalable network applications. Node.js uses an
54event-driven, non-blocking I/O model that makes it lightweight and
55efficient, perfect for data-intensive real-time applications that run
56across distributed devices.
210abff9 57
210abff9 58%package devel
12a49d35 59Summary: Development headers for nodejs
210abff9 60Group: Development/Libraries
a8f57a3f 61Requires: %{name} = %{version}-%{release}
96f19ba5 62Requires: c-ares-devel
d44c8857 63Requires: gcc
96f19ba5 64Requires: http-parser-devel
d44c8857 65Requires: libstdc++-devel
96f19ba5
ER
66Requires: libuv-devel
67Requires: openssl-devel
29d6d704 68%{?with_system_v8:Requires: v8-devel}
96f19ba5 69Requires: zlib-devel
210abff9 70
71%description devel
12a49d35 72Development headers for nodejs.
210abff9 73
a6070ceb
ER
74%package doc
75Summary: Evented I/O for V8 JavaScript - documentation
76Group: Documentation
b6b2dd9b
ER
77%if "%{_rpmversion}" >= "5"
78BuildArch: noarch
79%endif
a6070ceb
ER
80
81%description doc
82Node.js is a server-side JavaScript environment that uses an
83asynchronous event-driven model. Node's goal is to provide an easy way
84to build scalable network programs.
85
86This package contains the documentation for nodejs.
87
210abff9 88%prep
89%setup -q -n node-v%{version}
a600c300 90%patch1 -p1
a6070ceb
ER
91%if %{_lib} == "lib64"
92%patch3 -p1
93%else
94%patch2 -p1
95%endif
58e86022 96%patch4 -p1
1385a038 97%patch5 -p1
be62a70f
ER
98%patch6 -p1
99%patch7 -p1
c4aa3bb0 100
536f9f5a
ER
101grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
102
29d6d704
ER
103rm -r deps/npm
104rm -r deps/cares
105rm -r deps/http_parser
106rm -r deps/openssl
107rm -r deps/uv
108%{?with_system_v8:rm -r deps/v8}
109rm -r deps/zlib
e3e8568d 110
210abff9 111%build
a11025a6
ER
112# CC used only to detect if CC is clang, not used for compiling
113CC="%{__cc}" \
114CXX="%{__cxx}" \
dc60a63b 115GYP_DEFINES="soname_version=%{sover}" \
a6070ceb 116./configure \
29d6d704 117 %{?with_system_v8:--shared-v8} \
a6070ceb 118 --shared-zlib \
be06d6d0 119 --shared-openssl \
c1c359b8 120 --shared-cares \
8939ac26 121 --shared-libuv \
e427e9b0 122 --shared-http-parser \
7223b5ac 123 --without-npm \
c1c359b8 124 --without-dtrace \
210abff9 125 --prefix=%{_prefix}
126
a11025a6
ER
127# add LFS defines from libuv (RHBZ#892601)
128# CXXFLAGS must be exported, as it is needed for make, not gyp
129CXXFLAGS="%{rpmcxxflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC" \
130LDFLAGS="%{rpmldflags}" \
131%{__make} -C out V=1 BUILDTYPE=Release
210abff9 132
133%install
134rm -rf $RPM_BUILD_ROOT
39356b33 135%{__python} tools/install.py install "$RPM_BUILD_ROOT" "%{_lib}"
4174c079 136
f9cee3b6 137lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
4174c079
ER
138ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
139ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
a6070ceb 140
c7898157
ER
141echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
142
1ed21df5 143install -d $RPM_BUILD_ROOT%{_includedir}/node
4174c079 144cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
d5764a43
ER
145
146# install for node-gyp
147install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
148cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
149ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
1ed21df5 150
e85103e0 151# for compat of fedora derivered scripts (shebangs)
c3b531ba
ER
152ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
153
e85103e0
ER
154# globally installed node modules (noarch)
155install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
156
157# default searchpaths
158install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
159
a6070ceb
ER
160# create pkgconfig
161install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
162cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
163version=%{version}
c3b531ba 164prefix=%{_prefix}
87c4fdf2 165libdir=${prefix}/%{_lib}
a6070ceb
ER
166includedir=${prefix}/include/node
167
168Name: nodejs
169Description: Evented I/O for V8 JavaScript.
170Version: ${version}
171Cflags: -I${includedir}
172EOF
a752c1c0 173
a6070ceb 174# install documentation
6f7eebb5
ER
175install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
176cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
177rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
178rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
a6070ceb 179
210abff9 180%clean
181rm -rf $RPM_BUILD_ROOT
182
4174c079 183%post -p /sbin/ldconfig
7372d27d 184%postun -p /sbin/ldconfig
185
210abff9 186%files
187%defattr(644,root,root,755)
a6070ceb 188%doc README.md AUTHORS ChangeLog LICENSE
210abff9 189%attr(755,root,root) %{_bindir}/node
c3b531ba 190%attr(755,root,root) %{_bindir}/nodejs
a600c300 191%attr(755,root,root) %{_libdir}/libnode.so.*.*.*
2492de83 192%ghost %{_libdir}/libnode.so.10
a600c300 193%if "%{_lib}" != "lib"
8791ea86 194%dir %{_libdir}/node
a600c300
ŁC
195%endif
196%dir %{_prefix}/lib/node
e85103e0 197%dir %{_prefix}/lib/node_modules
210abff9 198%{_mandir}/man1/node.1*
c7898157 199%{_mandir}/man1/nodejs.1
210abff9 200
210abff9 201%files devel
202%defattr(644,root,root,755)
a600c300 203%{_libdir}/libnode.so
58494f0c 204%{_includedir}/node
a6070ceb 205%{_pkgconfigdir}/nodejs.pc
d5764a43 206%{_usrsrc}/%{name}
a6070ceb
ER
207
208%files doc
209%defattr(644,root,root,755)
210%doc %{_docdir}/%{name}-doc-%{version}
This page took 0.063159 seconds and 4 git commands to generate.