js.spec 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. ##
  2. ## js.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 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 version
  25. %define V_js 1.6.20060820
  26. %define V_javascript 1.00_02
  27. %define V_javascript_spidermonkey 0.17
  28. %define V_javascript_squish 0.05
  29. %define V_javascript_code 0.05
  30. %define V_javascript_jslint 0.04
  31. # package information
  32. Name: js
  33. Summary: Mozilla JavaScript (JS)
  34. URL: http://www.mozilla.org/js/
  35. Vendor: Brendan Eich et al.
  36. Packager: OpenPKG
  37. Distribution: OpenPKG
  38. Class: EVAL
  39. Group: Language
  40. License: MPL/GPL/LGPL
  41. Version: %{V_js}
  42. Release: 20060820
  43. # package options
  44. %option with_file yes
  45. %option with_dso yes
  46. %option with_perl no
  47. %option with_editline no
  48. %option with_utf8 no
  49. # list of sources
  50. Source0: ftp://ftp.ossp.org/pkg/lib/js/js-%{V_js}.tar.gz
  51. Source1: http://www.cpan.org/modules/by-authors/id/C/CL/CLAESJAC/JavaScript-%{V_javascript}.tar.gz
  52. Source2: http://www.cpan.org/modules/by-module/JavaScript/JavaScript-SpiderMonkey-%{V_javascript_spidermonkey}.tar.gz
  53. Source3: http://www.cpan.org/modules/by-module/JavaScript/JavaScript-Squish-%{V_javascript_squish}.tar.gz
  54. Source4: http://www.cpan.org/modules/by-module/JavaScript/JavaScript-Code-%{V_javascript_code}.tar.gz
  55. Source5: http://www.cpan.org/modules/by-module/JavaScript/JavaScript-JSLint-%{V_javascript_jslint}.tar.gz
  56. Patch0: js.patch
  57. # build information
  58. Prefix: %{l_prefix}
  59. BuildRoot: %{l_buildroot}
  60. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc, make
  61. PreReq: OpenPKG, openpkg >= 20040130
  62. %if "%{with_perl}" == "yes"
  63. BuildPreReq: perl, perl-openpkg
  64. PreReq: perl
  65. %endif
  66. %if "%{with_editline}" == "yes"
  67. BuildPreReq: editline
  68. PreReq: editline
  69. %endif
  70. AutoReq: no
  71. AutoReqProv: no
  72. %description
  73. This is the JavaScript (JS) reference implementation in C
  74. from Mozilla, aka JSRef or SpiderMonkey. JavaScript is the
  75. Netscape-developed object scripting language used in millions of web
  76. pages and server applications worldwide. Netscape's JavaScript is a
  77. superset of the ECMA-262 Edition 3 (ECMAScript) standard scripting
  78. language. This package is based on the OSSP js distribution of
  79. Mozilla JavaScript and also optionally provides Perl bindings.
  80. %track
  81. prog js = {
  82. version = %{V_js}
  83. url = ftp://ftp.ossp.org/pkg/lib/js/
  84. regex = js-(__VER__)\.tar\.gz
  85. }
  86. prog js:JavaScript = {
  87. version = %{V_javascript}
  88. url = http://www.cpan.org/modules/by-module/JavaScript/
  89. regex = JavaScript-(__VER__)\.tar\.gz
  90. }
  91. prog js:JavaScript-SpiderMonkey = {
  92. version = %{V_javascript_spidermonkey}
  93. url = http://www.cpan.org/modules/by-module/JavaScript/
  94. regex = JavaScript-SpiderMonkey-(__VER__)\.tar\.gz
  95. }
  96. prog js:JavaScript-Squish = {
  97. version = %{V_javascript_squish}
  98. url = http://www.cpan.org/modules/by-module/JavaScript/
  99. regex = JavaScript-Squish-(__VER__)\.tar\.gz
  100. }
  101. prog js:JavaScript-Code = {
  102. version = %{V_javascript_code}
  103. url = http://www.cpan.org/modules/by-module/JavaScript/
  104. regex = JavaScript-Code-(__VER__)\.tar\.gz
  105. }
  106. prog js:JavaScript-JSLint = {
  107. version = %{V_javascript_jslint}
  108. url = http://www.cpan.org/modules/by-module/JavaScript/
  109. regex = JavaScript-JSLint-(__VER__)\.tar\.gz
  110. }
  111. %prep
  112. %setup -q -c
  113. %setup -q -D -T -a 1
  114. %setup -q -D -T -a 2
  115. %setup -q -D -T -a 3
  116. %setup -q -D -T -a 4
  117. %setup -q -D -T -a 5
  118. %patch -p0
  119. %build
  120. # build components
  121. %if "%{with_perl}" == "yes"
  122. %{l_prefix}/bin/perl-openpkg prepare
  123. %endif
  124. ( cd js-%{V_js}
  125. CC="%{l_cc}" \
  126. CFLAGS="%{l_cflags -O}" \
  127. GREP="grep" \
  128. ./configure \
  129. --prefix=%{l_prefix} \
  130. --mandir=%{l_prefix}/man \
  131. %if "%{with_perl}" == "yes"
  132. --with-perl=%{l_prefix}/bin/perl \
  133. %endif
  134. %if "%{with_editline}" == "yes"
  135. --with-editline=%{l_prefix} \
  136. %endif
  137. %if "%{with_file}" != "yes"
  138. --without-file \
  139. %endif
  140. %if "%{with_dso}" == "yes"
  141. --with-dso \
  142. %endif
  143. %if "%{with_utf8}" == "yes"
  144. --with-utf8 \
  145. %endif
  146. --disable-shared
  147. %{l_make} %{l_mflags}
  148. ) || exit $?
  149. %if "%{with_perl}" == "yes"
  150. # build add-on Perl bindings
  151. ( cd JavaScript-%{V_javascript}
  152. export JS_LIB="../js-%{V_js}/.libs"
  153. export JS_INC="../js-%{V_js}/src"
  154. %if "%{with_utf8}" == "yes"
  155. export JS_C_STRINGS_ARE_UTF8=1
  156. %endif
  157. %{l_prefix}/bin/perl-openpkg configure build
  158. ) || exit $?
  159. ( cd JavaScript-SpiderMonkey-%{V_javascript_spidermonkey}
  160. %{l_shtool} subst \
  161. -e 's;\.\./js/src;../js-%{V_js}/src;' \
  162. -e 's;\.\./js/.libs;../js-%{V_js}/.libs;' \
  163. Makefile.PL
  164. %{l_prefix}/bin/perl-openpkg configure build
  165. ) || exit $?
  166. ( cd JavaScript-Squish-%{V_javascript_squish}
  167. %{l_prefix}/bin/perl-openpkg configure build
  168. ) || exit $?
  169. ( cd JavaScript-Code-%{V_javascript_code}
  170. %{l_prefix}/bin/perl-openpkg configure build
  171. ) || exit $?
  172. ( cd JavaScript-JSLint-%{V_javascript_jslint}
  173. %{l_prefix}/bin/perl-openpkg configure build
  174. ) || exit $?
  175. %endif
  176. %install
  177. # create installation hierarchy
  178. rm -rf $RPM_BUILD_ROOT
  179. %{l_shtool} mkdir -f -p -m 755 \
  180. $RPM_BUILD_ROOT%{l_prefix}/bin \
  181. $RPM_BUILD_ROOT%{l_prefix}/include/js \
  182. $RPM_BUILD_ROOT%{l_prefix}/lib \
  183. $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig
  184. # install vendor components
  185. ( cd js-%{V_js}
  186. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  187. ) || exit $?
  188. %if "%{with_perl}" == "yes"
  189. # install add-on Perl bindings
  190. ( cd JavaScript-%{V_javascript}
  191. %{l_prefix}/bin/perl-openpkg install
  192. ) || exit $?
  193. ( cd JavaScript-SpiderMonkey-%{V_javascript_spidermonkey}
  194. %{l_prefix}/bin/perl-openpkg install
  195. ) || exit $?
  196. ( cd JavaScript-Squish-%{V_javascript_squish}
  197. %{l_prefix}/bin/perl-openpkg install
  198. ) || exit $?
  199. ( cd JavaScript-Code-%{V_javascript_code}
  200. %{l_prefix}/bin/perl-openpkg install
  201. ) || exit $?
  202. ( cd JavaScript-JSLint-%{V_javascript_jslint}
  203. %{l_prefix}/bin/perl-openpkg install
  204. ) || exit $?
  205. %endif
  206. %if "%{with_perl}" == "yes"
  207. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  208. %else
  209. >perl-openpkg-files
  210. %endif
  211. # determine installation files
  212. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  213. %{l_files_std} `cat perl-openpkg-files` \
  214. '%not %dir %{l_prefix}/lib/pkgconfig'
  215. %files -f files
  216. %clean
  217. rm -rf $RPM_BUILD_ROOT