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