LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File nodejs.spec of Package nodejs (Project devel:languages:nodejs)

# spec file for package nodejs
# Copyright (c) 2013 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.18
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
Patch4:         node-gyp-addon-gypi.patch
Patch5:         nodejs-no-v8-headers.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
BuildRequires:  zlib-devel
# 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"
%patch0 -p1
cd deps/npm/node_modules/node-gyp
%patch4 -p1 
cd -
# Make sure nothing gets included from bundled deps:
# We only delete the source and header files, because
# the remaining build scripts are still used.
for dir in v8 openssl zlib; do
  find deps/$dir -name *.[ch] -delete

# 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 \
make %{?_smp_mflags}

%{?make_install} %{!?make_install:make install DESTDIR=$RPM_BUILD_ROOT}
#node-gyp needs common.gypi too
mkdir -p %{buildroot}%{_datadir}/node
cp -p common.gypi %{buildroot}%{_datadir}/node

%defattr(-, root, root)
%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)