Browse Source

nodejs: build with internal openssl on Vine Linux 6

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@7570 ec354946-7b23-47d6-9f5a-488ba84defc7
daisuke 11 years ago
parent
commit
98f4770ab8
1 changed files with 84 additions and 18 deletions
  1. 84 18
      n/nodejs/nodejs-vl.spec

+ 84 - 18
n/nodejs/nodejs-vl.spec

@@ -1,6 +1,17 @@
+%global system_zlib 1
+%global system_v8 1
+%global system_openssl 1
+%global system_http_parser 0
+%global system_cares 0
+%global system_libuv 0
+
+%if "%{_dist_release}" < "vl7"
+%global system_openssl 0
+%endif
+
 Name: nodejs
 Version: 0.10.0
-Release: 1%{?_dist_release}
+Release: 2%{?_dist_release}
 Summary: JavaScript runtime
 Summary(ja): JavaScript runtime
 License: MIT and ASL 2.0 and ISC and BSD
@@ -23,16 +34,31 @@ Source6: nodejs-fixdep
 %global v8_ge 3.13.7.5
 %global v8_lt 3.14
 
+%if %{system_v8}
 BuildRequires: v8-devel >= %{v8_ge}
-#BuildRequires: http-parser-devel >= 2.0
-#BuildRequires: libuv-devel
-#BuildRequires: c-ares-devel
+%endif
+%if %{system_http_parser}
+BuildRequires: http-parser-devel >= 2.0
+%endif
+%if %{system_libuv}
+BuildRequires: libuv-devel
+%endif
+%if %{system_cares}
+BuildRequires: c-ares-devel
+%endif
+%if %{system_zlib}
 BuildRequires: zlib-devel
+%endif
+
+%if %{system_openssl}
 # Node.js requires some features from openssl 1.0.1 for SPDY support
 BuildRequires: openssl-devel >= 1.0.1
+%endif
 
+%if %{system_v8}
 Requires: v8%{?isa}
 Requires: v8%{?isa} < %{v8_lt}
+%endif
 
 #virtual provides for automatic depedency generation
 Provides: nodejs(engine) = %{version}
@@ -57,8 +83,21 @@ Summary: JavaScript runtime - development headers
 Summary(ja): JavaScript runtime - development headers
 Group: Development/Languages
 Requires: %{name} == %{version}-%{release}
-#Requires: libuv-devel http-parser-devel openssl-devel c-ares-devel zlib-devel
-Requires: openssl-devel zlib-devel
+%if %{system_libuv}
+Requires: libuv-devel
+%endif
+%if %{system_http_parser}
+Requires: http-parser-devel
+%endif
+%if %{system_cares}
+Requires: c-ares-devel
+%endif
+%if %{system_zlib}
+Requires: zlib-devel
+%endif
+%if %{system_openssl}
+Requires: openssl-devel
+%endif
 
 %description devel
 Development headers for the Node.js JavaScript runtime.
@@ -78,26 +117,35 @@ The API documentation for the Node.js JavaScript runtime.
 # We only delete the source and header files, because
 # the remaining build scripts are still used.
 
-#find deps/cares -name "*.c" -exec rm -f {} \;
-#find deps/cares -name "*.h" -exec rm -f {} \;
-
-#find deps/npm -name "*.c" -exec rm -f {} \;
-#find deps/npm -name "*.h" -exec rm -f {} \;
+%if %{system_cares}
+find deps/cares -name "*.c" -exec rm -f {} \;
+find deps/cares -name "*.h" -exec rm -f {} \;
+%endif
 
+%if %{system_zlib}
 find deps/zlib -name "*.c" -exec rm -f {} \;
 find deps/zlib -name "*.h" -exec rm -f {} \;
+%endif
 
+%if %{system_v8}
 find deps/v8 -name "*.c" -exec rm -f {} \;
 find deps/v8 -name "*.h" -exec rm -f {} \;
+%endif
 
-#find deps/http_parser -name "*.c" -exec rm -f {} \;
-#find deps/http_parser -name "*.h" -exec rm -f {} \;
+%if %{system_http_parser}
+find deps/http_parser -name "*.c" -exec rm -f {} \;
+find deps/http_parser -name "*.h" -exec rm -f {} \;
+%endif
 
+%if %{system_openssl}
 find deps/openssl -name "*.c" -exec rm -f {} \;
 find deps/openssl -name "*.h" -exec rm -f {} \;
+%endif
 
-#find deps/uv -name "*.c" -exec rm -f {} \;
-#find deps/uv -name "*.h" -exec rm -f {} \;
+%if %{system_libuv}
+find deps/uv -name "*.c" -exec rm -f {} \;
+find deps/uv -name "*.h" -exec rm -f {} \;
+%endif
 
 %build
 # build with debugging symbols and add defines from libuv (#892601)
@@ -105,9 +153,24 @@ export CFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
 export CXXFLAGS='%{optflags} -g -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
 
 ./configure --prefix=%{_prefix} \
-           --shared-v8 \
-           --shared-openssl \
-           --shared-zlib \
+          %if %{system_v8}
+	    --shared-v8 \
+	  %endif
+          %if %{system_openssl}
+	    --shared-openssl \
+	  %endif
+          %if %{system_zlib}
+	    --shared-zlib \
+	  %endif
+          %if %{system_cares}
+	    --shared-cares \
+	  %endif
+          %if %{system_libuv}
+	    --shared-libuv \
+	  %endif
+          %if %{system_http_parser}
+	    --shared-http-parser \
+	  %endif
             --without-dtrace
 
 # Setting BUILDTYPE=Debug builds both release and debug binaries
@@ -174,6 +237,9 @@ cp -p common.gypi %{buildroot}%{_datadir}/node
 %doc LICENSE
 
 %changelog
+* Fri Mar 15 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 0.10.0-2
+- build with internal openssl on Vine Linux 6
+
 * Wed Mar 13 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 0.10.0-1
 - update to 0.10.0