yaml.spec 9.1 KB

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