yaml.spec 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. ##
  2. ## yaml.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_libsyck 0.55
  26. %define V_libyaml 0.0.1
  27. %define V_perl_yaml 0.62
  28. %define V_perl_yaml_syck 0.72
  29. %define V_perl_yaml_tiny 1.01
  30. %define V_perl_yaml_appconfig 0.16
  31. %define V_yaml_javascript 0.03
  32. %define V_yaml_spec 2004-12-28
  33. # package information
  34. Name: yaml
  35. Summary: YAML Ain't Markup Language (YAML)
  36. URL: http://yaml.org/
  37. Vendor: B. Ingerson, C. Evans, O. Ben-Kiki et al.
  38. Packager: OpenPKG Foundation e.V.
  39. Distribution: OpenPKG Community
  40. Class: PLUS
  41. Group: Language
  42. License: BSD/Artistic
  43. Version: 20070114
  44. Release: 20070114
  45. # package options
  46. %option with_perl no
  47. %option with_php no
  48. %option with_ruby no
  49. # list of sources
  50. Source0: http://rubyforge-files.ruby-forum.com/syck/syck-%{V_libsyck}.tar.gz
  51. Source1: http://pyyaml.org/download/libyaml/yaml-%{V_libyaml}.tar.gz
  52. Source2: http://www.cpan.org/modules/by-module/YAML/YAML-%{V_perl_yaml}.tar.gz
  53. Source3: http://www.cpan.org/modules/by-module/YAML/YAML-Syck-%{V_perl_yaml_syck}.tar.gz
  54. Source4: http://www.cpan.org/modules/by-module/YAML/YAML-Tiny-%{V_perl_yaml_tiny}.tar.gz
  55. Source5: http://www.cpan.org/modules/by-module/YAML/YAML-AppConfig-%{V_perl_yaml_appconfig}.tar.gz
  56. Source6: http://osdn.dl.sourceforge.net/yaml-javascript/yaml-javascript-%{V_yaml_javascript}.tar.gz
  57. Source7: http://yaml.org/spec/history/%{V_yaml_spec}/%{V_yaml_spec}.pdf
  58. Source8: yaml.yml
  59. Patch0: yaml.patch
  60. # build information
  61. Prefix: %{l_prefix}
  62. BuildRoot: %{l_buildroot}
  63. BuildPreReq: OpenPKG, openpkg >= 20040130, make
  64. PreReq: OpenPKG, openpkg >= 20040130
  65. %if "%{with_perl}" == "yes"
  66. BuildPreReq: perl, perl-openpkg
  67. PreReq: perl
  68. %endif
  69. %if "%{with_php}" == "yes"
  70. BuildPreReq: php
  71. PreReq: php
  72. %endif
  73. %if "%{with_ruby}" == "yes"
  74. BuildPreReq: ruby
  75. PreReq: ruby
  76. %endif
  77. AutoReq: no
  78. AutoReqProv: no
  79. %description
  80. YAML Ain't Markup Language (YAML) is an international collaboration
  81. to make a sophisticated data serialization language which is both
  82. human readable and computationally powerful. This OpenPKG package
  83. provides C, and JavaScript plus optionally Perl, PHP, and Ruby APIs
  84. for the generation and parsing of YAML.
  85. %track
  86. prog yaml:libsyck = {
  87. version = %{V_libsyck}
  88. url = http://whytheluckystiff.net/syck/
  89. regex = syck-(__VER__)\.tar\.gz
  90. }
  91. prog yaml:libyaml = {
  92. version = %{V_libyaml}
  93. url = http://pyyaml.org/wiki/LibYAML
  94. regex = yaml-(__VER__)\.tar\.gz
  95. }
  96. prog yaml:YAML = {
  97. version = %{V_perl_yaml}
  98. url = http://www.cpan.org/modules/by-module/YAML/
  99. regex = YAML-(__VER__)\.tar\.gz
  100. }
  101. prog yaml:YAML-Syck = {
  102. version = %{V_perl_yaml_syck}
  103. url = http://www.cpan.org/modules/by-module/YAML/
  104. regex = YAML-Syck-(__VER__)\.tar\.gz
  105. }
  106. prog yaml:YAML-Tiny = {
  107. version = %{V_perl_yaml_tiny}
  108. url = http://www.cpan.org/modules/by-module/YAML/
  109. regex = YAML-Tiny-(__VER__)\.tar\.gz
  110. }
  111. prog yaml:YAML-AppConfig = {
  112. version = %{V_perl_yaml_appconfig}
  113. url = http://www.cpan.org/modules/by-module/YAML/
  114. regex = YAML-AppConfig-(__VER__)\.tar\.gz
  115. }
  116. prog yaml:yaml-javascript = {
  117. version = %{V_yaml_javascript}
  118. url = http://prdownloads.sourceforge.net/yaml-javascript/
  119. regex = yaml-javascript-(__VER__)\.tar\.gz
  120. }
  121. prog yaml:yaml-spec = {
  122. disabled
  123. comment = "rse: website references not existing 2004-12-30 and no updates since recently anyway"
  124. version = %{V_yaml_spec}
  125. url = http://yaml.org/spec/
  126. regex = (\d{4}-\d{2}-\d{2})\.pdf
  127. }
  128. %prep
  129. %setup -q -c
  130. %setup -q -T -D -a 1
  131. %setup -q -T -D -a 2
  132. %setup -q -T -D -a 3
  133. %setup -q -T -D -a 4
  134. %setup -q -T -D -a 5
  135. %setup -q -T -D -a 6
  136. %patch -p0
  137. %build
  138. # build YAML C API
  139. ( cd yaml-%{V_libyaml}
  140. CC="%{l_cc}" \
  141. CFLAGS="%{l_cflags -O}" \
  142. ./configure \
  143. --prefix=%{l_prefix} \
  144. --disable-shared
  145. %{l_make} %{l_mflags -O}
  146. ) || exit $?
  147. # build Syck C API
  148. ( cd syck-%{V_libsyck}
  149. CC="%{l_cc}" \
  150. CFLAGS="%{l_cflags -O}" \
  151. ./configure \
  152. --prefix=%{l_prefix} \
  153. --disable-shared
  154. %{l_make} %{l_mflags -O}
  155. ) || exit $?
  156. # build PHP API
  157. %if "%{with_php}" == "yes"
  158. ( cd syck-%{V_libsyck}/ext/php
  159. %{l_prefix}/bin/phpize
  160. CC="%{l_cc}" \
  161. CFLAGS="%{l_cflags -O}" \
  162. CPPFLAGS="-I`pwd`/../../lib" \
  163. LDFLAGS="-L`pwd`/../../lib" \
  164. ./configure \
  165. --with-syck=`pwd`/../..
  166. ) || exit $?
  167. %endif
  168. # build Ruby API
  169. %if "%{with_ruby}" == "yes"
  170. ( cd syck-%{V_libsyck}/ext/ruby
  171. %{l_prefix}/bin/ruby install.rb config --prefix=%{l_prefix}
  172. %{l_prefix}/bin/ruby install.rb setup
  173. ) || exit $?
  174. %endif
  175. # build Perl API
  176. %if "%{with_perl}" == "yes"
  177. %{l_prefix}/bin/perl-openpkg prepare
  178. %{l_prefix}/bin/perl-openpkg -d YAML-%{V_perl_yaml} configure build
  179. %{l_prefix}/bin/perl-openpkg -d YAML-Syck-%{V_perl_yaml_syck} configure build
  180. %{l_prefix}/bin/perl-openpkg -d YAML-Tiny-%{V_perl_yaml_tiny} configure build
  181. %{l_prefix}/bin/perl-openpkg -d YAML-AppConfig-%{V_perl_yaml_appconfig} configure build
  182. %endif
  183. %install
  184. rm -rf $RPM_BUILD_ROOT
  185. # install YAML C API
  186. ( cd yaml-%{V_libyaml}
  187. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  188. ) || exit $?
  189. # install Syck C API
  190. ( cd syck-%{V_libsyck}
  191. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  192. ) || exit $?
  193. # install PHP API
  194. %if "%{with_php}" == "yes"
  195. ( cd syck-%{V_libsyck}/ext/php
  196. %{l_make} %{l_mflags} install INSTALL_ROOT=$RPM_BUILD_ROOT
  197. ) || exit $?
  198. %endif
  199. # install Ruby API
  200. %if "%{with_ruby}" == "yes"
  201. ( cd syck-%{V_libsyck}/ext/ruby
  202. %{l_prefix}/bin/ruby install.rb install --prefix=$RPM_BUILD_ROOT
  203. ) || exit $?
  204. %endif
  205. # install Perl API
  206. %if "%{with_perl}" == "yes"
  207. %{l_prefix}/bin/perl-openpkg -d YAML-%{V_perl_yaml} install
  208. %{l_prefix}/bin/perl-openpkg -d YAML-Syck-%{V_perl_yaml_syck} install
  209. %{l_prefix}/bin/perl-openpkg -d YAML-Tiny-%{V_perl_yaml_tiny} install
  210. %{l_prefix}/bin/perl-openpkg -d YAML-AppConfig-%{V_perl_yaml_appconfig} install
  211. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  212. %else
  213. >perl-openpkg-files
  214. %endif
  215. # install JavaScript API
  216. %{l_shtool} mkdir -f -p -m 755 \
  217. $RPM_BUILD_ROOT%{l_prefix}/share/yaml
  218. %{l_shtool} install -c -m 644 \
  219. yaml-javascript-%{V_yaml_javascript}/yaml_dumper.js \
  220. $RPM_BUILD_ROOT%{l_prefix}/share/yaml/
  221. # install YAML specification and quick reference
  222. %{l_shtool} install -c -m 644 \
  223. %{SOURCE %{V_yaml_spec}.pdf} \
  224. $RPM_BUILD_ROOT%{l_prefix}/share/yaml/yaml.pdf
  225. %{l_shtool} install -c -m 644 \
  226. %{SOURCE yaml.yml} \
  227. $RPM_BUILD_ROOT%{l_prefix}/share/yaml/
  228. # determine installation files
  229. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  230. %{l_files_std} `cat perl-openpkg-files`
  231. %files -f files
  232. %clean
  233. rm -rf $RPM_BUILD_ROOT