]> git.pld-linux.org Git - packages/nodejs.git/blame - nodejs.spec
v0.10.3
[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
c3b531ba 7URL: http://www.nodejs.org/
cb51f00f 8Source0: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
9dc0bdad 9# Source0-md5: 4daca92618515708a4631e98a8e8c779
2492de83 10Patch1: %{name}-shared.patch
a6070ceb
ER
11# force node to use /usr/lib/node as the systemwide module directory
12Patch2: %{name}-libpath.patch
13# use /usr/lib64/node as an arch-specific module dir when appropriate
14Patch3: %{name}-lib64path.patch
1385a038 15Patch5: uv-fpic.patch
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
5ef76b51 23Obsoletes: nodejs-waf
210abff9 24ExclusiveArch: %{ix86} %{x8664} arm
25BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
27%description
c3b531ba
ER
28Node.js is a platform built on Chrome's JavaScript runtime for easily
29building fast, scalable network applications. Node.js uses an
30event-driven, non-blocking I/O model that makes it lightweight and
31efficient, perfect for data-intensive real-time applications that run
32across distributed devices.
210abff9 33
210abff9 34%package devel
12a49d35 35Summary: Development headers for nodejs
210abff9 36Group: Development/Libraries
a8f57a3f 37Requires: %{name} = %{version}-%{release}
d44c8857
ER
38Requires: gcc
39Requires: libstdc++-devel
fae304aa 40Requires: v8-devel
210abff9 41
42%description devel
12a49d35 43Development headers for nodejs.
210abff9 44
a6070ceb
ER
45%package doc
46Summary: Evented I/O for V8 JavaScript - documentation
47Group: Documentation
48
49%description doc
50Node.js is a server-side JavaScript environment that uses an
51asynchronous event-driven model. Node's goal is to provide an easy way
52to build scalable network programs.
53
54This package contains the documentation for nodejs.
55
210abff9 56%prep
57%setup -q -n node-v%{version}
a600c300 58%patch1 -p1
a6070ceb
ER
59%if %{_lib} == "lib64"
60%patch3 -p1
61%else
62%patch2 -p1
63%endif
1385a038 64%patch5 -p1
c4aa3bb0 65
210abff9 66%build
210abff9 67
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}" \
be06d6d0 89%if "%{pld_release}" == "ac"
5ef76b51
AS
90 CC.host="%{__cc}4" \
91 CXX.host="%{__cxx}4" \
92 CC.target="%{__cc}4" \
93 CXX.target="%{__cxx}4" \
be06d6d0 94%else
5ef76b51
AS
95 CC.host="%{__cc}" \
96 CXX.host="%{__cxx}" \
97 CC.target="%{__cc}" \
98 CXX.target="%{__cxx}"
be06d6d0 99%endif
210abff9 100
101%install
102rm -rf $RPM_BUILD_ROOT
be06d6d0
AS
103%{__make} justinstall \
104 DESTDIR=$RPM_BUILD_ROOT \
105 LIBDIR=%{_lib}
106
9dc0bdad
A
107ln -s libnode.so.10.3.0 $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
108ln -s libnode.so.10.3.0 $RPM_BUILD_ROOT%{_libdir}/libnode.so
a6070ceb 109
c7898157
ER
110echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
111
1ed21df5
A
112install -d $RPM_BUILD_ROOT%{_includedir}/node
113install src/*.h $RPM_BUILD_ROOT%{_includedir}/node
114
e85103e0 115# for compat of fedora derivered scripts (shebangs)
c3b531ba
ER
116ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
117
e85103e0
ER
118# globally installed node modules (noarch)
119install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
120
121# default searchpaths
122install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
123
a6070ceb
ER
124# create pkgconfig
125install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
126cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
127version=%{version}
c3b531ba 128prefix=%{_prefix}
87c4fdf2 129libdir=${prefix}/%{_lib}
a6070ceb
ER
130includedir=${prefix}/include/node
131
132Name: nodejs
133Description: Evented I/O for V8 JavaScript.
134Version: ${version}
135Cflags: -I${includedir}
136EOF
a752c1c0 137
a6070ceb 138# install documentation
6f7eebb5
ER
139install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
140cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
141rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
142rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
a6070ceb 143
210abff9 144%clean
145rm -rf $RPM_BUILD_ROOT
146
7372d27d 147%post -p /sbin/ldconfig
148%postun -p /sbin/ldconfig
149
210abff9 150%files
151%defattr(644,root,root,755)
a6070ceb 152%doc README.md AUTHORS ChangeLog LICENSE
210abff9 153%attr(755,root,root) %{_bindir}/node
c3b531ba 154%attr(755,root,root) %{_bindir}/nodejs
a600c300 155%attr(755,root,root) %{_libdir}/libnode.so.*.*.*
2492de83 156%ghost %{_libdir}/libnode.so.10
a600c300 157%if "%{_lib}" != "lib"
8791ea86 158%dir %{_libdir}/node
a600c300
ŁC
159%endif
160%dir %{_prefix}/lib/node
e85103e0 161%dir %{_prefix}/lib/node_modules
210abff9 162%{_mandir}/man1/node.1*
c7898157 163%{_mandir}/man1/nodejs.1
210abff9 164
210abff9 165%files devel
166%defattr(644,root,root,755)
a600c300 167%{_libdir}/libnode.so
58494f0c 168%{_includedir}/node
a6070ceb
ER
169%{_pkgconfigdir}/nodejs.pc
170
171%files doc
172%defattr(644,root,root,755)
173%doc %{_docdir}/%{name}-doc-%{version}
This page took 0.103101 seconds and 4 git commands to generate.