]> git.pld-linux.org Git - packages/nodejs.git/blame - nodejs.spec
formatting, cleanups; automate library symlinks
[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
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
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
5ef76b51
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}" \
be06d6d0 88%if "%{pld_release}" == "ac"
5ef76b51
AS
89 CC.host="%{__cc}4" \
90 CXX.host="%{__cxx}4" \
91 CC.target="%{__cc}4" \
92 CXX.target="%{__cxx}4" \
be06d6d0 93%else
5ef76b51
AS
94 CC.host="%{__cc}" \
95 CXX.host="%{__cxx}" \
96 CC.target="%{__cc}" \
97 CXX.target="%{__cxx}"
be06d6d0 98%endif
210abff9 99
100%install
101rm -rf $RPM_BUILD_ROOT
be06d6d0
AS
102%{__make} justinstall \
103 DESTDIR=$RPM_BUILD_ROOT \
4174c079
ER
104 LIBDIR=%{_lib}
105
106# no dtrace on linux
107%{__rm} -r $RPM_BUILD_ROOT%{_prefix}/lib/dtrace/node.d
be06d6d0 108
4174c079
ER
109lib=$(basename $RPM_BUILD_ROOT%{_libdir}/libnode.so.*.*)
110ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so.10
111ln -s $lib $RPM_BUILD_ROOT%{_libdir}/libnode.so
a6070ceb 112
c7898157
ER
113echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
114
1ed21df5 115install -d $RPM_BUILD_ROOT%{_includedir}/node
4174c079 116cp -p src/*.h $RPM_BUILD_ROOT%{_includedir}/node
1ed21df5 117
e85103e0 118# for compat of fedora derivered scripts (shebangs)
c3b531ba
ER
119ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
120
e85103e0
ER
121# globally installed node modules (noarch)
122install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
123
124# default searchpaths
125install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
126
a6070ceb
ER
127# create pkgconfig
128install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
129cat <<'EOF' > $RPM_BUILD_ROOT%{_pkgconfigdir}/%{name}.pc
130version=%{version}
c3b531ba 131prefix=%{_prefix}
87c4fdf2 132libdir=${prefix}/%{_lib}
a6070ceb
ER
133includedir=${prefix}/include/node
134
135Name: nodejs
136Description: Evented I/O for V8 JavaScript.
137Version: ${version}
138Cflags: -I${includedir}
139EOF
a752c1c0 140
a6070ceb 141# install documentation
6f7eebb5
ER
142install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
143cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
144rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
145rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
a6070ceb 146
210abff9 147%clean
148rm -rf $RPM_BUILD_ROOT
149
4174c079 150%post -p /sbin/ldconfig
7372d27d 151%postun -p /sbin/ldconfig
152
210abff9 153%files
154%defattr(644,root,root,755)
a6070ceb 155%doc README.md AUTHORS ChangeLog LICENSE
210abff9 156%attr(755,root,root) %{_bindir}/node
c3b531ba 157%attr(755,root,root) %{_bindir}/nodejs
a600c300 158%attr(755,root,root) %{_libdir}/libnode.so.*.*.*
2492de83 159%ghost %{_libdir}/libnode.so.10
a600c300 160%if "%{_lib}" != "lib"
8791ea86 161%dir %{_libdir}/node
a600c300
ŁC
162%endif
163%dir %{_prefix}/lib/node
e85103e0 164%dir %{_prefix}/lib/node_modules
210abff9 165%{_mandir}/man1/node.1*
c7898157 166%{_mandir}/man1/nodejs.1
210abff9 167
210abff9 168%files devel
169%defattr(644,root,root,755)
a600c300 170%{_libdir}/libnode.so
58494f0c 171%{_includedir}/node
a6070ceb
ER
172%{_pkgconfigdir}/nodejs.pc
173
174%files doc
175%defattr(644,root,root,755)
176%doc %{_docdir}/%{name}-doc-%{version}
This page took 0.051989 seconds and 4 git commands to generate.