| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- ##
- ## node11.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2018 OpenPKG Project <http://openpkg.org/>
- ##
- ## Permission to use, copy, modify, and distribute this software for
- ## any purpose with or without fee is hereby granted, provided that
- ## the above copyright notice and this permission notice appear in all
- ## copies.
- ##
- ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
- ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- ## SUCH DAMAGE.
- ##
- # package version
- %define V_snap_base 11.0.0
- %define V_snap_type nightly
- %define V_snap_date 20180808
- %define V_snap_hash 6ad12d47f5
- %define V_opkg %{V_snap_base}.%{V_snap_date}
- %define V_dist %{V_snap_base}-%{V_snap_type}%{V_snap_date}%{V_snap_hash}
- # package information
- Name: node11
- Summary: Node JavaScript Run-Time (V11)
- URL: http://nodejs.org/
- Vendor: Node Foundation
- Packager: OpenPKG Project
- Distribution: OpenPKG Community
- Class: PLUS
- Group: Web
- License: MIT/BSD
- Version: %{V_opkg}
- Release: 20180808
- # package options
- %option with_icu yes
- %option with_node no
- # list of sources
- Source0: https://nodejs.org/download/%{V_snap_type}/v%{V_dist}/node-v%{V_dist}.tar.gz
- Source1: node.c
- Patch0: node11.patch
- # build information
- BuildPreReq: OpenPKG, openpkg >= 20160101, make, gcc >= 5.2, gcc::with_cxx = yes, python, pkgconfig
- PreReq: OpenPKG, openpkg >= 20160101
- BuildPreReq: openssl11, libexecinfo, zlib, ares, http-parser, libuv, nghttp2
- PreReq: openssl11, libexecinfo, zlib, ares, http-parser, libuv, nghttp2
- %if "%{with_icu}" == "yes"
- BuildPreReq: icu
- PreReq: icu
- %endif
- %if "%{with_node}" == "yes"
- Provides: node = %{version}
- %endif
- %description
- Node.js (V10) provides an easy way to build scalable network
- servers in JavaScript. It is an event-driven I/O environment based
- on Google V8 JavaScript virtual machine version 6.8.275.24.
- %track
- prog node11:base = {
- version = %{V_snap_base}
- url = https://nodejs.org/download/%{V_snap_type}/
- regex = v(\d+\.\d+\.\d+)-%{V_snap_type}\d{8}[\da-f]{10}/
- }
- prog node11:date = {
- version = %{V_snap_date}
- url = https://nodejs.org/download/%{V_snap_type}/
- regex = v\d+\.\d+\.\d+-%{V_snap_type}(\d{8})[\da-f]{10}/
- }
- prog node11:hash = {
- version = %{V_snap_hash}
- url = https://nodejs.org/download/%{V_snap_type}/
- regex = v\d+\.\d+\.\d+-%{V_snap_type}(\d{8}[\da-f]{10})/
- }
- %prep
- %setup -q -n node-v%{V_dist}
- %patch -p0
- %build
- # provide local tool wrapper scripts as we cannot
- # reliably pass the includes via configure variables
- cflags="-I`pwd`/deps/v8 -I`pwd`/deps/v8/include %{l_cppflags openssl11 .}"
- ldflags="%{l_ldflags openssl11 .}"
- mkdir tool
- for tool in gcc g++ c%{l_nil}c c++; do
- ( echo "#!/bin/sh"
- echo "exec %{l_prefix}/bin/$tool $cflags $ldflags \${1+\"\$@\"}"
- ) >tool/$tool
- chmod a+x tool/$tool
- done
- PATH="`pwd`/tool:$PATH"
- # configure program
- libs="-lexecinfo -lz"
- case "%{l_platform -t} " in
- *-linux* ) libs="$libs -ldl" ;;
- esac
- CC="gcc" \
- CXX="g++" \
- CFLAGS="%{l_cflags -O}" \
- CXXFLAGS="%{l_cxxflags -O} -Wno-deprecated-declarations" \
- CPPFLAGS="%{l_cppflags openssl11 .}" \
- LDFLAGS="%{l_ldflags openssl11 .}" \
- LIBS="$libs" \
- %{l_prefix}/bin/python ./configure \
- --prefix=%{l_prefix} \
- --shared-openssl \
- --shared-openssl-includes=%{l_prefix}/include/openssl11 \
- --shared-openssl-libpath=%{l_prefix}/lib/openssl11 \
- --shared-openssl-libname="ssl,crypto" \
- --shared-zlib \
- --shared-zlib-includes=%{l_prefix}/include \
- --shared-zlib-libpath=%{l_prefix}/lib \
- --shared-zlib-libname="z" \
- --shared-http-parser \
- --shared-http-parser-includes=%{l_prefix}/include \
- --shared-http-parser-libpath=%{l_prefix}/lib \
- --shared-http-parser-libname="http_parser" \
- --shared-cares \
- --shared-cares-includes=%{l_prefix}/include \
- --shared-cares-libpath=%{l_prefix}/lib \
- --shared-cares-libname="ares" \
- --shared-libuv \
- --shared-libuv-includes=%{l_prefix}/include \
- --shared-libuv-libpath=%{l_prefix}/lib \
- --shared-libuv-libname="uv" \
- --shared-nghttp2 \
- --shared-nghttp2-includes=%{l_prefix}/include \
- --shared-nghttp2-libpath=%{l_prefix}/lib \
- --shared-nghttp2-libname="nghttp2" \
- %if "%{with_icu}" == "yes"
- --with-intl=system-icu \
- %else
- --with-intl=small-icu \
- %endif
- --without-snapshot \
- --without-npm
- # build program
- %{l_make} %{l_mflags -O}
- # build wrapper
- %{l_cc} %{l_cflags -O} %{l_cppflags} -DPREFIX="\"%{l_prefix}\"" %{l_ldflags} \
- -o node-wrapper %{SOURCE node.c}
- %install
- # install program
- %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
- # install wrapper
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/node11
- mv $RPM_BUILD_ROOT%{l_prefix}/bin/node \
- $RPM_BUILD_ROOT%{l_prefix}/libexec/node11/node
- %{l_shtool} install -c -s -m 755 \
- node-wrapper $RPM_BUILD_ROOT%{l_prefix}/bin/node
- # post-installation strip-down
- strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/dtrace
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/systemtap
- rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
- %if "%{with_node}" == "yes"
- # create NPM package installation areas
- %{l_shtool} mkdir -f -p -m 755 \
- $RPM_BUILD_ROOT%{l_prefix}/lib/node/usr \
- $RPM_BUILD_ROOT%{l_prefix}/lib/node/pkg
- %endif
- # post-adjust installation
- mv $RPM_BUILD_ROOT%{l_prefix}/bin/node \
- $RPM_BUILD_ROOT%{l_prefix}/bin/node11
- mv $RPM_BUILD_ROOT%{l_prefix}/include/node \
- $RPM_BUILD_ROOT%{l_prefix}/include/node11
- mv $RPM_BUILD_ROOT%{l_prefix}/man/man1/node.1 \
- $RPM_BUILD_ROOT%{l_prefix}/man/man1/node11.1
- %if "%{with_node}" == "yes"
- # shim as Node
- ln -s node11 $RPM_BUILD_ROOT%{l_prefix}/bin/node
- ln -s node11 $RPM_BUILD_ROOT%{l_prefix}/include/node
- ln -s node11.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/node.1
- %endif
- # determine installation files
- %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
- %files -f files
- %clean
|