##
## js.spec -- OpenPKG RPM Package Specification
## Copyright (c) 2000-2006 OpenPKG Foundation e.V.
## Copyright (c) 2000-2006 Ralf S. Engelschall
##
## 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_js 1.6.20060729
%define V_javascript 0.55
%define V_javascript_spidermonkey 0.17
%define V_javascript_squish 0.05
%define V_javascript_code 0.05
%define V_javascript_jslint 0.04
# package information
Name: js
Summary: Mozilla JavaScript (JS)
URL: http://www.mozilla.org/js/
Vendor: Brendan Eich et al.
Packager: OpenPKG
Distribution: OpenPKG
Class: EVAL
Group: Language
License: MPL/GPL/LGPL
Version: %{V_js}
Release: 20060729
# package options
%option with_file yes
%option with_perl no
%option with_editline no
# list of sources
Source0: ftp://ftp.ossp.org/pkg/lib/js/js-%{V_js}.tar.gz
Source1: http://www.cpan.org/modules/by-module/JavaScript/JavaScript-%{V_javascript}.tar.gz
Source2: http://www.cpan.org/modules/by-module/JavaScript/JavaScript-SpiderMonkey-%{V_javascript_spidermonkey}.tar.gz
Source3: http://www.cpan.org/modules/by-module/JavaScript/JavaScript-Squish-%{V_javascript_squish}.tar.gz
Source4: http://www.cpan.org/modules/by-module/JavaScript/JavaScript-Code-%{V_javascript_code}.tar.gz
Source5: http://www.cpan.org/modules/by-module/JavaScript/JavaScript-JSLint-%{V_javascript_jslint}.tar.gz
Patch0: js.patch
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, make
PreReq: OpenPKG, openpkg >= 20040130
%if "%{with_perl}" == "yes"
BuildPreReq: perl, perl-openpkg
PreReq: perl
%endif
%if "%{with_editline}" == "yes"
BuildPreReq: editline
PreReq: editline
%endif
AutoReq: no
AutoReqProv: no
%description
This is the JavaScript (JS) reference implementation in C
from Mozilla, aka JSRef or SpiderMonkey. JavaScript is the
Netscape-developed object scripting language used in millions of web
pages and server applications worldwide. Netscape's JavaScript is a
superset of the ECMA-262 Edition 3 (ECMAScript) standard scripting
language. This package is based on the OSSP js distribution of
Mozilla JavaScript and also optionally provides Perl bindings.
%track
prog js = {
version = %{V_js}
url = ftp://ftp.ossp.org/pkg/lib/js/
regex = js-(__VER__)\.tar\.gz
}
prog js:JavaScript = {
version = %{V_javascript}
url = http://www.cpan.org/modules/by-module/JavaScript/
regex = JavaScript-(__VER__)\.tar\.gz
}
prog js:JavaScript-SpiderMonkey = {
version = %{V_javascript_spidermonkey}
url = http://www.cpan.org/modules/by-module/JavaScript/
regex = JavaScript-SpiderMonkey-(__VER__)\.tar\.gz
}
prog js:JavaScript-Squish = {
version = %{V_javascript_squish}
url = http://www.cpan.org/modules/by-module/JavaScript/
regex = JavaScript-Squish-(__VER__)\.tar\.gz
}
prog js:JavaScript-Code = {
version = %{V_javascript_code}
url = http://www.cpan.org/modules/by-module/JavaScript/
regex = JavaScript-Code-(__VER__)\.tar\.gz
}
prog js:JavaScript-JSLint = {
version = %{V_javascript_jslint}
url = http://www.cpan.org/modules/by-module/JavaScript/
regex = JavaScript-JSLint-(__VER__)\.tar\.gz
}
%prep
%setup -q -c
%setup -q -D -T -a 1
%setup -q -D -T -a 2
%setup -q -D -T -a 3
%setup -q -D -T -a 4
%setup -q -D -T -a 5
%patch -p0
%build
# build components
%if "%{with_perl}" == "yes"
%{l_prefix}/bin/perl-openpkg prepare
%endif
( cd js-%{V_js}
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
GREP="grep" \
./configure \
--prefix=%{l_prefix} \
--mandir=%{l_prefix}/man \
%if "%{with_perl}" == "yes"
--with-perl=%{l_prefix}/bin/perl \
%endif
%if "%{with_editline}" == "yes"
--with-editline=%{l_prefix} \
%endif
%if "%{with_file}" != "yes"
--without-file \
%endif
--disable-shared
%{l_make} %{l_mflags}
) || exit $?
%if "%{with_perl}" == "yes"
# build add-on Perl bindings
( cd JavaScript-%{V_javascript}
%{l_shtool} subst \
-e 's;-I\.\./js/src;-I../js-%{V_js}/src;' \
-e 's;-L\.\./js/src;-L../js-%{V_js}/.libs;' \
Makefile.PL
%{l_prefix}/bin/perl-openpkg configure build
) || exit $?
( cd JavaScript-SpiderMonkey-%{V_javascript_spidermonkey}
%{l_shtool} subst \
-e 's;\.\./js/src;../js-%{V_js}/src;' \
-e 's;\.\./js/.libs;../js-%{V_js}/.libs;' \
Makefile.PL
%{l_prefix}/bin/perl-openpkg configure build
) || exit $?
( cd JavaScript-Squish-%{V_javascript_squish}
%{l_prefix}/bin/perl-openpkg configure build
) || exit $?
( cd JavaScript-Code-%{V_javascript_code}
%{l_prefix}/bin/perl-openpkg configure build
) || exit $?
( cd JavaScript-JSLint-%{V_javascript_jslint}
%{l_prefix}/bin/perl-openpkg configure build
) || exit $?
%endif
%install
# create installation hierarchy
rm -rf $RPM_BUILD_ROOT
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/bin \
$RPM_BUILD_ROOT%{l_prefix}/include/js \
$RPM_BUILD_ROOT%{l_prefix}/lib \
$RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
# install vendor components
( cd js-%{V_js}
%{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
) || exit $?
%if "%{with_perl}" == "yes"
# install add-on Perl bindings
( cd JavaScript-%{V_javascript}
%{l_prefix}/bin/perl-openpkg install
) || exit $?
( cd JavaScript-SpiderMonkey-%{V_javascript_spidermonkey}
%{l_prefix}/bin/perl-openpkg install
) || exit $?
( cd JavaScript-Squish-%{V_javascript_squish}
%{l_prefix}/bin/perl-openpkg install
) || exit $?
( cd JavaScript-Code-%{V_javascript_code}
%{l_prefix}/bin/perl-openpkg install
) || exit $?
( cd JavaScript-JSLint-%{V_javascript_jslint}
%{l_prefix}/bin/perl-openpkg install
) || exit $?
%endif
%if "%{with_perl}" == "yes"
%{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
%else
>perl-openpkg-files
%endif
# determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
%{l_files_std} `cat perl-openpkg-files` \
'%not %dir %{l_prefix}/lib/pkgconfig'
%files -f files
%clean
rm -rf $RPM_BUILD_ROOT