| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
- ##
- ## js.spec -- OpenPKG RPM Package Specification
- ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
- ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
- ##
- ## 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.04
- %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: 20070222
- # 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: 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: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
- %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 $?
- %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 $?
- %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
|