]> git.pld-linux.org Git - packages/nodejs.git/blame - nodejs.spec
Restore BC: eio
[packages/nodejs.git] / nodejs.spec
CommitLineData
210abff9 1Summary: Asynchronous JavaScript Engine
2Name: nodejs
9dc0bdad 3Version: 0.10.3
7c7c1bb0 4Release: 1
e85103e0
ER
5License: BSD and MIT and ASL 2.0 and GPLv3
6Group: Development/Languages
cb51f00f 7Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
9dc0bdad 8# Source0-md5: 4daca92618515708a4631e98a8e8c779
4174c079 9Patch1: %{name}-shared.patch
a6070ceb
ER
10# force node to use /usr/lib/node as the systemwide module directory
11Patch2: %{name}-libpath.patch
12# use /usr/lib64/node as an arch-specific module dir when appropriate
13Patch3: %{name}-lib64path.patch
1385a038 14Patch5: uv-fpic.patch
4174c079 15URL: http://www.nodejs.org/
12a49d35 16BuildRequires: gcc >= 5:4.0
210abff9 17BuildRequires: libstdc++-devel
a6070ceb
ER
18BuildRequires: python >= 1:2.5.2
19BuildRequires: python-jsmin
12a49d35 20BuildRequires: rpm >= 4.4.9-56
d44c8857 21BuildRequires: rpmbuild(macros) >= 1.219
1ed21df5 22BuildRequires: v8-devel >= 3.15.11.10
a25fcb58 23BuildConflicts: eio
5ef76b51 24Obsoletes: nodejs-waf
210abff9 25ExclusiveArch: %{ix86} %{x8664} arm
26BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28%description
c3b531ba
ER
29Node.js is a platform built on Chrome's JavaScript runtime for easily
30building fast, scalable network applications. Node.js uses an
31event-driven, non-blocking I/O model that makes it lightweight and
32efficient, perfect for data-intensive real-time applications that run
33across distributed devices.
210abff9 34
210abff9 35%package devel
12a49d35 36Summary: Development headers for nodejs
210abff9 37Group: Development/Libraries
a8f57a3f 38Requires: %{name} = %{version}-%{release}
d44c8857
ER
39Requires: gcc
40Requires: libstdc++-devel
fae304aa 41Requires: v8-devel
210abff9 42
43%description devel
12a49d35 44Development headers for nodejs.
210abff9 45
a6070ceb
ER
46%package doc
47Summary: Evented I/O for V8 JavaScript - documentation
48Group: Documentation
49
50%description doc
51Node.js is a server-side JavaScript environment that uses an
52asynchronous event-driven model. Node's goal is to provide an easy way
53to build scalable network programs.
54
55This package contains the documentation for nodejs.
56
210abff9 57%prep
58%setup -q -n node-v%{version}
a600c300 59%patch1 -p1
a6070ceb
ER
60%if %{_lib} == "lib64"
61%patch3 -p1
62%else
63%patch2 -p1
64%endif
1385a038 65%patch5 -p1
c4aa3bb0 66
210abff9 67%build
cb51f00f
ER
68# Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
69CC=${CC#ccache }
a600c300
ŁC
70
71# NOT autoconf so dont use macro
72export PYTHONPATH=tools
a6070ceb 73./configure \
a6070ceb
ER
74 --shared-v8 \
75 --shared-zlib \
be06d6d0 76 --shared-openssl \
7223b5ac 77 --without-npm \
210abff9 78 --prefix=%{_prefix}
79
5ef76b51
AS
80%{__make} -C out \
81 BUILDTYPE=Release \
82 V=1 \
83 CFLAGS.host="%{rpmcflags} -fPIC" \
84 CXXFLAGS.host="%{rpmcppflags} -fPIC" \
85 LDFLAGS.host="%{rpmcflags}" \
86 CFLAGS.target="%{rpmcflags} -fPIC" \
87 CXXFLAGS.target="%{rpmcppflags} -fPIC" \
88 LDFLAGS.target="%{rpmcflags}" \
5ef76b51
AS
89 CC.host="%{__cc}" \
90 CXX.host="%{__cxx}" \
91 CC.target="%{__cc}" \
92 CXX.target="%{__cxx}"
210abff9 93
94%install
95rm -rf $RPM_BUILD_ROOT
be06d6d0
AS
96%{__make} justinstall \
97 DESTDIR=$RPM_BUILD_ROOT \
4174c079
ER
98 LIBDIR=%{_lib}
99
100# no dtrace on linux
101%{__rm} -r $RPM_BUILD_ROOT%{_prefix}/lib/dtrace/node.d
be06d6d0 102
4174c079
ER
103lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*)
104ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
105ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
a6070ceb 106
c7898157
ER
107echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
108
1ed21df5 109install -d $RPM_BUILD_ROOT%{_includedir}/node
4174c079 110cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
1ed21df5 111
e85103e0 112# for compat of fedora derivered scripts (shebangs)
c3b531ba
ER
113ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
114
e85103e0
ER
115# globally installed node modules (noarch)
116install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
117
118# default searchpaths
119install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
120
a6070ceb
ER
121# create pkgconfig
122install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
123cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
124version=%{version}
c3b531ba 125prefix=%{_prefix}
87c4fdf2 126libdir=${prefix}/%{_lib}
a6070ceb
ER
127includedir=${prefix}/include/node
128
129Name: nodejs
130Description: Evented I/O for V8 JavaScript.
131Version: ${version}
132Cflags: -I${includedir}
133EOF
a752c1c0 134
a6070ceb 135# install documentation
6f7eebb5
ER
136install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
137cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
138rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
139rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
a6070ceb 140
210abff9 141%clean
142rm -rf $RPM_BUILD_ROOT
143
4174c079 144%post -p /sbin/ldconfig
7372d27d 145%postun -p /sbin/ldconfig
146
210abff9 147%files
148%defattr(644,root,root,755)
a6070ceb 149%doc README.md AUTHORS ChangeLog LICENSE
210abff9 150%attr(755,root,root) %{_bindir}/node
c3b531ba 151%attr(755,root,root) %{_bindir}/nodejs
a600c300 152%attr(755,root,root) %{_libdir}/libnode.so.*.*.*
2492de83 153%ghost %{_libdir}/libnode.so.10
a600c300 154%if "%{_lib}" != "lib"
8791ea86 155%dir %{_libdir}/node
a600c300
ŁC
156%endif
157%dir %{_prefix}/lib/node
e85103e0 158%dir %{_prefix}/lib/node_modules
210abff9 159%{_mandir}/man1/node.1*
c7898157 160%{_mandir}/man1/nodejs.1
210abff9 161
210abff9 162%files devel
163%defattr(644,root,root,755)
a600c300 164%{_libdir}/libnode.so
58494f0c 165%{_includedir}/node
a6070ceb
ER
166%{_pkgconfigdir}/nodejs.pc
167
168%files doc
169%defattr(644,root,root,755)
170%doc %{_docdir}/%{name}-doc-%{version}
This page took 0.051115 seconds and 4 git commands to generate.