yaml.spec 9.6 KB

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