]> git.pld-linux.org Git - packages/nodejs.git/blob - nodejs.spec
acff4ad99aa2bc77f9b1b087cc52c830d704c4a1
[packages/nodejs.git] / nodejs.spec
1 Summary:        Asynchronous JavaScript Engine
2 Name:           nodejs
3 Version:        0.10.26
4 Release:        1
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:  15e9018dadc63a2046f61eb13dfd7bd6
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 >= 0.10
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:  sed >= 4.0
28 BuildRequires:  v8-devel >= 3.15.11.10
29 BuildRequires:  zlib-devel
30 Obsoletes:      nodejs-waf
31 ExclusiveArch:  %{ix86} %{x8664} arm
32 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33
34 %define         sover   %(echo %{version} | cut -d. -f2)
35
36 %description
37 Node.js is a platform built on Chrome's JavaScript runtime for easily
38 building fast, scalable network applications. Node.js uses an
39 event-driven, non-blocking I/O model that makes it lightweight and
40 efficient, perfect for data-intensive real-time applications that run
41 across distributed devices.
42
43 %package devel
44 Summary:        Development headers for nodejs
45 Group:          Development/Libraries
46 Requires:       %{name} = %{version}-%{release}
47 Requires:       c-ares-devel
48 Requires:       gcc
49 Requires:       http-parser-devel
50 Requires:       libstdc++-devel
51 Requires:       libuv-devel
52 Requires:       openssl-devel
53 Requires:       v8-devel
54 Requires:       zlib-devel
55
56 %description devel
57 Development headers for nodejs.
58
59 %package doc
60 Summary:        Evented I/O for V8 JavaScript - documentation
61 Group:          Documentation
62
63 %description doc
64 Node.js is a server-side JavaScript environment that uses an
65 asynchronous event-driven model. Node's goal is to provide an easy way
66 to build scalable network programs.
67
68 This package contains the documentation for nodejs.
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 grep -r '#!.*env python' -l . | xargs %{__sed} -i -e '1 s,#!.*env python,#!%{__python},'
81
82 rm -r deps
83
84 %build
85 # CC used only to detect if CC is clang, not used for compiling
86 CC="%{__cc}" \
87 CXX="%{__cxx}" \
88 GYP_DEFINES="soname_version=%{sover}" \
89 ./configure \
90         --shared-v8 \
91         --shared-zlib \
92         --shared-openssl \
93         --shared-cares \
94         --shared-libuv \
95         --shared-http-parser \
96         --without-npm \
97         --without-dtrace \
98         --prefix=%{_prefix}
99
100 # add LFS defines from libuv (RHBZ#892601)
101 # CXXFLAGS must be exported, as it is needed for make, not gyp
102 CXXFLAGS="%{rpmcxxflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC" \
103 LDFLAGS="%{rpmldflags}" \
104 %{__make} -C out V=1 BUILDTYPE=Release
105
106 %install
107 rm -rf $RPM_BUILD_ROOT
108 %{__make} justinstall \
109         DESTDIR=$RPM_BUILD_ROOT \
110         LIBDIR=%{_lib}
111
112 # no dtrace on linux
113 %{__rm} -r $RPM_BUILD_ROOT%{_prefix}/lib/dtrace/node.d
114
115 lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*.*)
116 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
117 ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
118
119 echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
120
121 install -d $RPM_BUILD_ROOT%{_includedir}/node
122 cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
123
124 # install for node-gyp
125 install -d $RPM_BUILD_ROOT%{_usrsrc}/%{name}
126 cp -p common.gypi $RPM_BUILD_ROOT%{_usrsrc}/%{name}
127 ln -s %{_includedir}/node $RPM_BUILD_ROOT%{_usrsrc}/%{name}/src
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 # create pkgconfig
139 install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
140 cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
141 version=%{version}
142 prefix=%{_prefix}
143 libdir=${prefix}/%{_lib}
144 includedir=${prefix}/include/node
145
146 Name: nodejs
147 Description: Evented I/O for V8 JavaScript.
148 Version: ${version}
149 Cflags: -I${includedir}
150 EOF
151
152 # install documentation
153 install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
154 cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
155 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
156 rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
157
158 %clean
159 rm -rf $RPM_BUILD_ROOT
160
161 %post   -p /sbin/ldconfig
162 %postun -p /sbin/ldconfig
163
164 %files
165 %defattr(644,root,root,755)
166 %doc README.md AUTHORS ChangeLog LICENSE
167 %attr(755,root,root) %{_bindir}/node
168 %attr(755,root,root) %{_bindir}/nodejs
169 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
170 %ghost %{_libdir}/libnode.so.10
171 %if "%{_lib}" != "lib"
172 %dir %{_libdir}/node
173 %endif
174 %dir %{_prefix}/lib/node
175 %dir %{_prefix}/lib/node_modules
176 %{_mandir}/man1/node.1*
177 %{_mandir}/man1/nodejs.1
178
179 %files devel
180 %defattr(644,root,root,755)
181 %{_libdir}/libnode.so
182 %{_includedir}/node
183 %{_pkgconfigdir}/nodejs.pc
184 %{_usrsrc}/%{name}
185
186 %files doc
187 %defattr(644,root,root,755)
188 %doc %{_docdir}/%{name}-doc-%{version}
This page took 0.049841 seconds and 2 git commands to generate.