js.spec 8.9 KB

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