js.spec 8.3 KB

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