]> git.pld-linux.org Git - packages/nodejs.git/blobdiff - nodejs.spec
up to 0.6.20
[packages/nodejs.git] / nodejs.spec
index 90d23b8fbff3509f9c03f97cb42376134ee4b22f..1a369bf515fea43125c427d0dd2e9ca654eed3ff 100644 (file)
@@ -1,17 +1,18 @@
 Summary:       Asynchronous JavaScript Engine
 Name:          nodejs
-Version:       0.6.8
+Version:       0.6.20
 Release:       1
-License:       BSD
-Group:         Libraries
+License:       BSD and MIT and ASL 2.0 and GPLv3
+Group:         Development/Languages
 URL:           http://www.nodejs.org/
-Source0:       http://www.nodejs.org/dist/node-v%{version}.tar.gz
-# Source0-md5: 9fd7baa2d27b848c3134e6ae35bb87b2
+Source0:       http://nodejs.org/dist/v%{version}/node-v%{version}.tar.gz
+# Source0-md5: fcf8e0f2981f9dd66606a2162a2df55d
 Patch1:                %{name}-soname.patch
 # force node to use /usr/lib/node as the systemwide module directory
 Patch2:                %{name}-libpath.patch
 # use /usr/lib64/node as an arch-specific module dir when appropriate
 Patch3:                %{name}-lib64path.patch
+Patch5:                uv-fpic.patch
 BuildRequires: c-ares-devel >= 1.7.4
 BuildRequires: gcc >= 5:4.0
 BuildRequires: libeio-devel
@@ -20,6 +21,7 @@ BuildRequires:        libstdc++-devel
 BuildRequires: python >= 1:2.5.2
 BuildRequires: python-jsmin
 BuildRequires: rpm >= 4.4.9-56
+BuildRequires: rpmbuild(macros) >= 1.219
 BuildRequires: v8-devel >= 3.6
 ExclusiveArch: %{ix86} %{x8664} arm
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -35,6 +37,10 @@ across distributed devices.
 Summary:       Development headers for nodejs
 Group:         Development/Libraries
 Requires:      %{name} = %{version}-%{release}
+Requires:      %{name}-waf = %{version}-%{release}
+Requires:      gcc
+Requires:      libstdc++-devel
+Requires:      v8-devel
 
 %description devel
 Development headers for nodejs.
@@ -71,11 +77,14 @@ used by Node.js and many of its modules.
 %else
 %patch2 -p1
 %endif
+%patch5 -p1
+
+# fix #!/usr/bin/env python -> #!/usr/bin/python:
+grep -rl 'bin/env python' tools | xargs %{__sed} -i -e '1s,^#!.*python,#!%{__python},'
 
 %build
-%undefine      with_ccache
-# build library
 CFLAGS="%{rpmcflags} -fPIC"
+CPPFLAGS="%{rpmcppflags} -fPIC"
 CXXFLAGS="%{rpmcxxflags} -fPIC"
 LDFLAGS="%{rpmcflags}"
 %if "%{pld_release}" == "ac"
@@ -85,7 +94,10 @@ CXX="%{__cxx}4"
 CC="%{__cc}"
 CXX="%{__cxx}"
 %endif
-export CFLAGS LDFLAGS CXXFLAGS CC CXX
+export CFLAGS LDFLAGS CXXFLAGS CC CXX LINKFLAGS_UV
+
+# Error: V8 doesn't like ccache. Please set your CC env var to 'gcc'
+CC=${CC#ccache }
 
 # NOT autoconf so dont use macro
 export PYTHONPATH=tools
@@ -93,9 +105,11 @@ export PYTHONPATH=tools
        --shared-cares \
        --shared-v8 \
        --shared-zlib \
+       --without-npm \
        --libdir=%{_libdir} \
        --prefix=%{_prefix}
 
+# build library
 %{__make} dynamiclib
 %{__make} program
 
@@ -107,8 +121,17 @@ rm -rf $RPM_BUILD_ROOT
 %{__make} install \
        DESTDIR=$RPM_BUILD_ROOT
 
+echo '.so man1/node.1' > $RPM_BUILD_ROOT%{_mandir}/man1/nodejs.1
+
+# for compat of fedora derivered scripts (shebangs)
 ln -s node $RPM_BUILD_ROOT%{_bindir}/nodejs
 
+# globally installed node modules (noarch)
+install -d $RPM_BUILD_ROOT%{_prefix}/lib/node_modules
+
+# default searchpaths
+install -d $RPM_BUILD_ROOT{%{_libdir},%{_prefix}/lib}/node
+
 # install shared lib
 export PYTHONPATH=tools
 %{__python} tools/waf-light install \
@@ -131,20 +154,16 @@ Version: ${version}
 Cflags: -I${includedir}
 EOF
 
+%py_ocomp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
+%py_comp $RPM_BUILD_ROOT%{_libdir}/node/wafadmin
+# TODO: check it first
+#%%py_postclean %{_libdir}/node/wafadmin
+
 # install documentation
-install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/html
-cp -a doc/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/html
-cd $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
-install -d api
-mv html/api/*.markdown api
-mv html/api/api/* html/api
-rm -rf html/api/api
-cd -
-
-# remove NPM; it's buggy in 0.6.3
-# but really we package npm from separate spec
-rm -rf $RPM_BUILD_ROOT%{_libdir}/node_modules
-rm $RPM_BUILD_ROOT%{_bindir}/npm
+install -d $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
+cp -a doc/api/* $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}
+rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.markdown
+rm $RPM_BUILD_ROOT%{_docdir}/%{name}-doc-%{version}/*.json
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -158,9 +177,12 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/node
 %attr(755,root,root) %{_bindir}/nodejs
 %attr(755,root,root) %{_libdir}/libnode.so.*.*.*
-%ghost %{_libdir}/libnode.so.4
+%ghost %{_libdir}/libnode.so.6
 %dir %{_libdir}/node
+%dir %{_prefix}/lib/node
+%dir %{_prefix}/lib/node_modules
 %{_mandir}/man1/node.1*
+%{_mandir}/man1/nodejs.1
 
 %files devel
 %defattr(644,root,root,755)
@@ -177,5 +199,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/node-waf
 %dir %{_libdir}/node/wafadmin
 %dir %{_libdir}/node/wafadmin/Tools
+%{_libdir}/node/wafadmin/*.py[co]
 %{_libdir}/node/wafadmin/*.py
 %{_libdir}/node/wafadmin/Tools/*.py
+%{_libdir}/node/wafadmin/Tools/*.py[co]
This page took 0.150618 seconds and 4 git commands to generate.