yaml.spec 10 KB

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