## ## js.spec -- OpenPKG RPM Package Specification ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. ## Copyright (c) 2000-2007 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.20070208 %define V_javascript 1.03 %define V_javascript_spidermonkey 0.17 %define V_javascript_squish 0.05 %define V_javascript_code 0.08 %define V_javascript_jslint 0.06 %define V_javascript_engine 0.009 %define V_jsmin 20070108 # package information Name: js Summary: Mozilla JavaScript (JS) URL: http://www.mozilla.org/js/ Vendor: Brendan Eich et al. Packager: OpenPKG Foundation e.V. Distribution: OpenPKG Community Class: PLUS Group: Language License: MPL/GPL/LGPL Version: %{V_js} Release: 20070509 # package options %option with_file yes %option with_dso yes %option with_perl no %option with_editline no %option with_utf8 no # list of sources Source0: ftp://ftp.ossp.org/pkg/lib/js/js-%{V_js}.tar.gz Source1: http://www.cpan.org/modules/by-authors/id/C/CL/CLAESJAC/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 Source6: http://www.cpan.org/modules/by-module/JavaScript/JE-%{V_javascript_engine}.tar.gz Source7: ftp://ftp.openpkg.org/sources/CPY/VERSIONED/jsmin/jsmin-%{V_jsmin}.c 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-authors/id/C/CL/CLAESJAC/ 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 } prog js:JavaScript-Engine = { version = %{V_javascript_engine} url = http://www.cpan.org/modules/by-module/JavaScript/ regex = JE-(__VER__)\.tar\.gz } prog js:jsmin = { version = %{V_jsmin} url = ftp://ftp.openpkg.org/sources/CPY/VERSIONED/jsmin/ regex = jsmin-(__VER__)\.c } %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 %setup -q -D -T -a 6 %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 %if "%{with_dso}" == "yes" --with-dso \ %endif %if "%{with_utf8}" == "yes" --with-utf8 \ %endif --disable-shared %{l_make} %{l_mflags} ) || exit $? # build add-on tool %{l_cc} -o jsmin %{SOURCE jsmin-%{V_jsmin}.c} %if "%{with_perl}" == "yes" # build add-on Perl bindings ( cd JavaScript-%{V_javascript} export JS_LIB="../js-%{V_js}/.libs" export JS_INC="../js-%{V_js}/src" %if "%{with_utf8}" == "yes" export JS_UTF8="1" %endif %{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 $? ( cd JE-%{V_javascript_engine} %{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 $? # install add-on tool %{l_shtool} install -c -s -m 755 \ jsmin $RPM_BUILD_ROOT%{l_prefix}/bin/ %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 $? ( cd JE-%{V_javascript_engine} %{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