js.spec 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. ##
  2. ## js.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2005 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package information
  25. Name: js
  26. Summary: Mozilla JavaScript (JS)
  27. URL: http://www.mozilla.org/js/
  28. Vendor: Brendan Eich et al.
  29. Packager: OpenPKG
  30. Distribution: OpenPKG
  31. Class: EVAL
  32. Group: Language
  33. License: MPL/GPL/LGPL
  34. Version: 1.5
  35. Release: 20051025
  36. # package options
  37. %option with_perl no
  38. # list of sources
  39. Source0: http://ftp.mozilla.org/pub/mozilla.org/js/js-%{version}.tar.gz
  40. Source1: js.pc
  41. Patch0: js.patch
  42. # build information
  43. Prefix: %{l_prefix}
  44. BuildRoot: %{l_buildroot}
  45. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, make
  46. PreReq: OpenPKG, openpkg >= 20040130
  47. %if "%{with_perl}" == "yes"
  48. BuildPreReq: perl, perl-openpkg
  49. PreReq: perl
  50. %endif
  51. AutoReq: no
  52. AutoReqProv: no
  53. %description
  54. This is the JavaScript (JS) reference implementation in C
  55. from Mozilla, aka JSRef or SpiderMonkey. JavaScript is the
  56. Netscape-developed object scripting language used in millions of web
  57. pages and server applications worldwide. Netscape's JavaScript is a
  58. superset of the ECMA-262 Edition 3 (ECMAScript) standard scripting
  59. language.
  60. %track
  61. prog js = {
  62. version = %{version}
  63. url = http://ftp.mozilla.org/pub/mozilla.org/js/
  64. regex = js-(__VER__)\.tar\.gz
  65. }
  66. %prep
  67. %setup -q -c
  68. %patch -p0 -d js/src
  69. %build
  70. cd js/src
  71. # build components
  72. cp Makefile.ref Makefile
  73. case "%{l_platform -t}" in
  74. *-freebsd* ) cp config/Linux_All.mk config/`uname -s``uname -r`.mk ;;
  75. esac
  76. touch config/`uname -s``uname -r`.mk
  77. %{l_make} %{l_mflags} \
  78. CC="%{l_cc}" \
  79. XCFLAGS="%{l_cppflags} %{l_cflags -O}" \
  80. XLDFLAGS="%{l_ldflags}" \
  81. BUILD_OPT=1 \
  82. JS_EDITLINE=1
  83. %if "%{with_perl}" == "yes"
  84. # build Perl API
  85. objdir="`echo *.OBJ`"
  86. %{l_shtool} subst \
  87. -e "s:\\(\$inc.=.\"\\).*\\(\";\\):\\1-I../$objdir -I..\\2:g" \
  88. -e "s:\\(\$libpath.=.\"\\).*\\(\";\\):\\1-L../$objdir\\2:g" \
  89. perlconnect/Makefile.PL
  90. %{l_prefix}/bin/perl-openpkg prepare
  91. %{l_prefix}/bin/perl-openpkg -d perlconnect -A "-c" configure
  92. %{l_prefix}/bin/perl-openpkg -d perlconnect build
  93. %endif
  94. %install
  95. # create installation hierarchy
  96. rm -rf $RPM_BUILD_ROOT
  97. %{l_shtool} mkdir -f -p -m 755 \
  98. $RPM_BUILD_ROOT%{l_prefix}/bin \
  99. $RPM_BUILD_ROOT%{l_prefix}/include/js \
  100. $RPM_BUILD_ROOT%{l_prefix}/lib \
  101. $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
  102. # install vendor components
  103. ( cd js/src
  104. %{l_shtool} install -c -s -m 755 \
  105. *.OBJ/js $RPM_BUILD_ROOT%{l_prefix}/bin/
  106. %{l_shtool} install -c -m 644 \
  107. *.OBJ/libjs.a $RPM_BUILD_ROOT%{l_prefix}/lib/
  108. for h in *.OBJ/jsautocfg.h jsapi.h jscompat.h \
  109. jslong.h jsosdep.h jsotypes.h jspubtd.h jstypes.h; do
  110. %{l_shtool} install -c -m 644 \
  111. $h $RPM_BUILD_ROOT%{l_prefix}/include/js/
  112. done
  113. %{l_shtool} install -c -m 644 \
  114. fdlibm/*.OBJ/libfdm.a $RPM_BUILD_ROOT%{l_prefix}/lib/libjsfdlibm.a
  115. %{l_shtool} install -c -m 644 \
  116. fdlibm/fdlibm.h $RPM_BUILD_ROOT%{l_prefix}/include/js/
  117. %if "%{with_perl}" == "yes"
  118. %{l_prefix}/bin/perl-openpkg -d perlconnect install
  119. %endif
  120. ) || exit $?
  121. %if "%{with_perl}" == "yes"
  122. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  123. %else
  124. >perl-openpkg-files
  125. %endif
  126. # install pkgconfig(1) file
  127. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  128. -e 's;@version@;%{version};' \
  129. %{SOURCE js.pc} $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/
  130. # determine installation files
  131. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  132. %{l_files_std} `cat perl-openpkg-files` \
  133. '%not %dir %{l_prefix}/lib/pkgconfig'
  134. %files -f files
  135. %clean
  136. rm -rf $RPM_BUILD_ROOT