js.spec 7.6 KB

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