js.spec 7.6 KB

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