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

Name:           nodejs
Version:        0.6.19
Release:        0
Summary:        Evented I/O for V8 JavaScript
License:        MIT
Group:          Development/Languages/Other
Patch0:         nodejs-lib64path.patch
Patch1:         nodejs-devel-lib64path.patch
Patch2:         nodejs-libpath.patch
Patch3:         nodejs-npm-lib64path.patch
Patch4:         node-segfault.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
BuildRequires:  openssl-devel
BuildRequires:  pkg-config
# for waf
BuildRequires:  python
Provides:       npm = %{version}
Obsoletes:      npm <= 1.0.999

Provides an easy way to build scalable network programs

%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

%setup -q -n node-v%{version}
%if %{_lib} == "lib64"
%patch4 -p1

# percent-configure pulls in something that confuses node's configure
# script, so we'll do it thus:
./configure \
    --prefix=%{_prefix} \
    --libdir=%{_libdir} \
make %{?_smp_mflags}

%{?make_install} %{!?make_install:make install DESTDIR=$RPM_BUILD_ROOT}

%defattr(-, root, root)
%dir %{_libdir}/node_modules
%exclude %{_libdir}/node_modules/npm/.npmignore
%attr(755,root,root) %{_bindir}/npm
%attr(755,root,root) %{_libdir}/node_modules/npm/scripts/
%attr(755,root,root) %{_libdir}/node_modules/npm/scripts/

%files devel
%defattr(-, root, root)