yaml.spec 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. ##
  2. ## yaml.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_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 0.11
  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: 20061126
  44. Release: 20061126
  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_perl_yaml_appconfig}
  118. url = http://prdownloads.sourceforge.net/yaml-javascript/
  119. regex = yaml-javascript-(__VER__)\.tar\.gz
  120. }
  121. prog yaml:yaml-spec = {
  122. version = %{V_yaml_spec}
  123. url = http://yaml.org/spec/
  124. regex = (\d{4}-\d{2}-\d{2})\.pdf
  125. }
  126. %prep
  127. %setup -q -c
  128. %setup -q -T -D -a 1
  129. %setup -q -T -D -a 2
  130. %setup -q -T -D -a 3
  131. %setup -q -T -D -a 4
  132. %setup -q -T -D -a 5
  133. %setup -q -T -D -a 6
  134. %patch -p0
  135. %build
  136. # build YAML C API
  137. ( cd yaml-%{V_libyaml}
  138. CC="%{l_cc}" \
  139. CFLAGS="%{l_cflags -O}" \
  140. ./configure \
  141. --prefix=%{l_prefix} \
  142. --disable-shared
  143. %{l_make} %{l_mflags -O}
  144. ) || exit $?
  145. # build Syck C API
  146. ( cd syck-%{V_libsyck}
  147. CC="%{l_cc}" \
  148. CFLAGS="%{l_cflags -O}" \
  149. ./configure \
  150. --prefix=%{l_prefix} \
  151. --disable-shared
  152. %{l_make} %{l_mflags -O}
  153. ) || exit $?
  154. # build PHP API
  155. %if "%{with_php}" == "yes"
  156. ( cd syck-%{V_libsyck}/ext/php
  157. %{l_prefix}/bin/phpize
  158. CC="%{l_cc}" \
  159. CFLAGS="%{l_cflags -O}" \
  160. CPPFLAGS="-I`pwd`/../../lib" \
  161. LDFLAGS="-L`pwd`/../../lib" \
  162. ./configure \
  163. --with-syck=`pwd`/../..
  164. ) || exit $?
  165. %endif
  166. # build Ruby API
  167. %if "%{with_ruby}" == "yes"
  168. ( cd syck-%{V_libsyck}/ext/ruby
  169. %{l_prefix}/bin/ruby install.rb config --prefix=%{l_prefix}
  170. %{l_prefix}/bin/ruby install.rb setup
  171. ) || exit $?
  172. %endif
  173. # build Perl API
  174. %if "%{with_perl}" == "yes"
  175. %{l_prefix}/bin/perl-openpkg prepare
  176. %{l_prefix}/bin/perl-openpkg -d YAML-%{V_perl_yaml} configure build
  177. %{l_prefix}/bin/perl-openpkg -d YAML-Syck-%{V_perl_yaml_syck} configure build
  178. %{l_prefix}/bin/perl-openpkg -d YAML-Tiny-%{V_perl_yaml_tiny} configure build
  179. %{l_prefix}/bin/perl-openpkg -d YAML-AppConfig-%{V_perl_yaml_appconfig} configure build
  180. %endif
  181. %install
  182. rm -rf $RPM_BUILD_ROOT
  183. # install YAML C API
  184. ( cd yaml-%{V_libyaml}
  185. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  186. ) || exit $?
  187. # install Syck C API
  188. ( cd syck-%{V_libsyck}
  189. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  190. ) || exit $?
  191. # install PHP API
  192. %if "%{with_php}" == "yes"
  193. ( cd syck-%{V_libsyck}/ext/php
  194. %{l_make} %{l_mflags} install INSTALL_ROOT=$RPM_BUILD_ROOT
  195. ) || exit $?
  196. %endif
  197. # install Ruby API
  198. %if "%{with_ruby}" == "yes"
  199. ( cd syck-%{V_libsyck}/ext/ruby
  200. %{l_prefix}/bin/ruby install.rb install --prefix=$RPM_BUILD_ROOT
  201. ) || exit $?
  202. %endif
  203. # install Perl API
  204. %if "%{with_perl}" == "yes"
  205. %{l_prefix}/bin/perl-openpkg -d YAML-%{V_perl_yaml} install
  206. %{l_prefix}/bin/perl-openpkg -d YAML-Syck-%{V_perl_yaml_syck} install
  207. %{l_prefix}/bin/perl-openpkg -d YAML-Tiny-%{V_perl_yaml_tiny} install
  208. %{l_prefix}/bin/perl-openpkg -d YAML-AppConfig-%{V_perl_yaml_appconfig} install
  209. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  210. %else
  211. >perl-openpkg-files
  212. %endif
  213. # install JavaScript API
  214. %{l_shtool} mkdir -f -p -m 755 \
  215. $RPM_BUILD_ROOT%{l_prefix}/share/yaml
  216. %{l_shtool} install -c -m 644 \
  217. yaml-javascript-%{V_yaml_javascript}/yaml_dumper.js \
  218. $RPM_BUILD_ROOT%{l_prefix}/share/yaml/
  219. # install YAML specification and quick reference
  220. %{l_shtool} install -c -m 644 \
  221. %{SOURCE %{V_yaml_spec}.pdf} \
  222. $RPM_BUILD_ROOT%{l_prefix}/share/yaml/yaml.pdf
  223. %{l_shtool} install -c -m 644 \
  224. %{SOURCE yaml.yml} \
  225. $RPM_BUILD_ROOT%{l_prefix}/share/yaml/
  226. # determine installation files
  227. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  228. %{l_files_std} `cat perl-openpkg-files`
  229. %files -f files
  230. %clean
  231. rm -rf $RPM_BUILD_ROOT