File nodejs.spec of Package nodejs
#
# spec file for package nodejs
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: nodejs
Version: 0.8.12
Release: 0
Summary: Evented I/O for V8 JavaScript
License: MIT
Group: Development/Languages/Other
Url: http://www.nodejs.org
Source: http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
Patch0: nodejs-lib64path.patch
Patch1: nodejs-devel-lib64path.patch
Patch2: nodejs-libpath.patch
Patch3: node-v0.8.12_missing_include.patch
BuildRequires: curl
BuildRequires: gcc-c++
BuildRequires: procps
BuildRequires: v8-devel >= 3.7
Requires: v8 >= 3.7
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version}
BuildRequires: libopenssl-devel
%else
BuildRequires: openssl-devel
%endif
BuildRequires: pkg-config
BuildRequires: zlib-devel
# for waf
BuildRequires: python
Provides: npm = %{version}
Obsoletes: npm <= 1.0.999
%description
Provides an easy way to build scalable network programs
http://nodejs.org
%package devel
Summary: Files needed for development of NodeJS platforms
Group: Development/Languages/Other
Requires: %{name} = %{version}
Requires: gcc-c++
Requires: python
%description devel
Provides an easy way to build scalable network programs
http://nodejs.org
%prep
%setup -q -n node-v%{version}
%if %{_lib} == "lib64"
%patch0
%patch1
%else
%patch2
%endif
%patch3
%build
# percent-configure pulls in something that confuses node's configure
# script, so we'll do it thus:
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
./configure \
--prefix=%{_prefix} \
--shared-v8 \
--shared-openssl \
--shared-zlib \
--gdb
make %{?_smp_mflags}
%install
%{?make_install} %{!?make_install:make install DESTDIR=$RPM_BUILD_ROOT}
%files
%defattr(-, root, root)
%{_bindir}/node
%{_mandir}/*/*
%{_libdir}/dtrace
#npm
%doc AUTHORS LICENSE
%{_libdir}/node_modules
%exclude %{_libdir}/node_modules/npm/.npmignore
%attr(755,root,root) %{_bindir}/npm
%attr(755,root,root) %{_libdir}/node_modules/npm/scripts/clean-old.sh
%attr(755,root,root) %{_libdir}/node_modules/npm/scripts/install.sh
%files devel
%defattr(-, root, root)
%{_bindir}/node-waf
%{_includedir}/node
%{_libdir}/node
%changelog