yaml.spec 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. ##
  2. ## yaml.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package version
  24. %define V_libsyck 20070218
  25. %define V_libyaml 0.1.1
  26. %define V_perl_yaml 0.66
  27. %define V_perl_yaml_syck 1.00
  28. %define V_perl_yaml_tiny 1.23
  29. %define V_perl_yaml_appconfig 0.16
  30. %define V_perl_yaml_libyaml 0.26
  31. %define V_perl_yaml_active 1.06
  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: 20080110
  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/modules/by-module/YAML/YAML-Active-%{V_perl_yaml_active}.tar.gz
  60. Source8: http://www.cpan.org/authors/id/N/NK/NKUITSE/IO-YAML-%{V_perl_io_yaml}.tar.gz
  61. Source9: http://osdn.dl.sourceforge.net/yaml-javascript/yaml-javascript-%{V_yaml_javascript}.tar.gz
  62. Source10: http://yaml.org/spec/history/%{V_yaml_spec}/%{V_yaml_spec}.pdf
  63. Source11: yaml.yml
  64. Patch0: yaml.patch
  65. # build information
  66. Prefix: %{l_prefix}
  67. BuildRoot: %{l_buildroot}
  68. BuildPreReq: OpenPKG, openpkg >= 20040130, make
  69. PreReq: OpenPKG, openpkg >= 20040130
  70. %if "%{with_perl}" == "yes"
  71. BuildPreReq: perl, perl-openpkg, perl-module
  72. PreReq: perl
  73. %endif
  74. %if "%{with_php}" == "yes"
  75. BuildPreReq: php
  76. PreReq: php
  77. %endif
  78. %if "%{with_ruby}" == "yes"
  79. BuildPreReq: ruby
  80. PreReq: ruby
  81. %endif
  82. AutoReq: no
  83. AutoReqProv: no
  84. %description
  85. YAML Ain't Markup Language (YAML) is an international collaboration
  86. to make a sophisticated data serialization language which is both
  87. human readable and computationally powerful. This OpenPKG package
  88. provides C, and JavaScript plus optionally Perl, PHP, and Ruby APIs
  89. for the generation and parsing of YAML.
  90. %track
  91. prog yaml:libsyck = {
  92. version = %{V_libsyck}
  93. url = ftp://ftp.openpkg.org/sources/CPY/yaml/
  94. regex = syck-(__VER__)\.tar\.gz
  95. }
  96. prog yaml:libyaml = {
  97. version = %{V_libyaml}
  98. url = http://pyyaml.org/download/libyaml/
  99. regex = yaml-(__VER__)\.tar\.gz
  100. }
  101. prog yaml:YAML = {
  102. version = %{V_perl_yaml}
  103. url = http://www.cpan.org/modules/by-module/YAML/
  104. regex = YAML-(__VER__)\.tar\.gz
  105. }
  106. prog yaml:YAML-Syck = {
  107. version = %{V_perl_yaml_syck}
  108. url = http://www.cpan.org/modules/by-module/YAML/
  109. regex = YAML-Syck-(__VER__)\.tar\.gz
  110. }
  111. prog yaml:YAML-Tiny = {
  112. version = %{V_perl_yaml_tiny}
  113. url = http://www.cpan.org/modules/by-module/YAML/
  114. regex = YAML-Tiny-(__VER__)\.tar\.gz
  115. }
  116. prog yaml:YAML-AppConfig = {
  117. version = %{V_perl_yaml_appconfig}
  118. url = http://www.cpan.org/modules/by-module/YAML/
  119. regex = YAML-AppConfig-(__VER__)\.tar\.gz
  120. }
  121. prog yaml:YAML-LibYAML = {
  122. version = %{V_perl_yaml_libyaml}
  123. url = http://www.cpan.org/modules/by-module/YAML/
  124. regex = YAML-LibYAML-(__VER__)\.tar\.gz
  125. }
  126. prog yaml:YAML-Active = {
  127. version = %{V_perl_yaml_active}
  128. url = http://www.cpan.org/modules/by-module/YAML/
  129. regex = YAML-Active-(__VER__)\.tar\.gz
  130. }
  131. prog yaml:IO-YAML = {
  132. version = %{V_perl_io_yaml}
  133. url = http://www.cpan.org/authors/id/N/NK/NKUITSE/
  134. regex = IO-YAML-(__VER__)\.tar\.gz
  135. }
  136. prog yaml:yaml-javascript = {
  137. version = %{V_yaml_javascript}
  138. url = http://prdownloads.sourceforge.net/yaml-javascript/
  139. regex = yaml-javascript-(__VER__)\.tar\.gz
  140. }
  141. prog yaml:yaml-spec = {
  142. disabled
  143. comment = "rse: website references not existing 2004-12-30 and no updates since recently anyway"
  144. version = %{V_yaml_spec}
  145. url = http://yaml.org/spec/
  146. regex = (\d{4}-\d{2}-\d{2})\.pdf
  147. }
  148. %prep
  149. %setup -q -c
  150. %setup -q -T -D -a 1
  151. %setup -q -T -D -a 2
  152. %setup -q -T -D -a 3
  153. %setup -q -T -D -a 4
  154. %setup -q -T -D -a 5
  155. %setup -q -T -D -a 6
  156. %setup -q -T -D -a 7
  157. %setup -q -T -D -a 8
  158. %setup -q -T -D -a 9
  159. %patch -p0
  160. %build
  161. # build YAML C API
  162. ( cd yaml-%{V_libyaml}
  163. CC="%{l_cc}" \
  164. CFLAGS="%{l_cflags -O}" \
  165. ./configure \
  166. --prefix=%{l_prefix} \
  167. --disable-shared
  168. %{l_make} %{l_mflags -O}
  169. ) || exit $?
  170. # build Syck C API
  171. ( cd syck-%{V_libsyck}
  172. CC="%{l_cc}" \
  173. CFLAGS="%{l_cflags -O}" \
  174. ./configure \
  175. --prefix=%{l_prefix} \
  176. --disable-shared
  177. %{l_make} %{l_mflags -O}
  178. ) || exit $?
  179. # build PHP API
  180. %if "%{with_php}" == "yes"
  181. ( cd syck-%{V_libsyck}/ext/php
  182. %{l_prefix}/bin/phpize
  183. CC="%{l_cc}" \
  184. CFLAGS="%{l_cflags -O}" \
  185. CPPFLAGS="-I`pwd`/../../lib" \
  186. LDFLAGS="-L`pwd`/../../lib" \
  187. ./configure \
  188. --with-syck=`pwd`/../..
  189. ) || exit $?
  190. %endif
  191. # build Ruby API
  192. %if "%{with_ruby}" == "yes"
  193. ( cd syck-%{V_libsyck}/ext/ruby
  194. %{l_prefix}/bin/ruby install.rb config --prefix=%{l_prefix}
  195. %{l_prefix}/bin/ruby install.rb setup
  196. ) || exit $?
  197. %endif
  198. # build Perl API
  199. %if "%{with_perl}" == "yes"
  200. %{l_prefix}/bin/perl-openpkg prepare
  201. %{l_prefix}/bin/perl-openpkg -d YAML-%{V_perl_yaml} configure build
  202. %{l_prefix}/bin/perl-openpkg -d YAML-Syck-%{V_perl_yaml_syck} configure build
  203. %{l_prefix}/bin/perl-openpkg -d YAML-Tiny-%{V_perl_yaml_tiny} configure build
  204. %{l_prefix}/bin/perl-openpkg -d YAML-AppConfig-%{V_perl_yaml_appconfig} configure build
  205. %{l_prefix}/bin/perl-openpkg -d YAML-LibYAML-%{V_perl_yaml_libyaml} configure build
  206. %{l_prefix}/bin/perl-openpkg -d YAML-Active-%{V_perl_yaml_active} configure build
  207. %{l_prefix}/bin/perl-openpkg -d IO-YAML-%{V_perl_io_yaml} configure build
  208. %endif
  209. %install
  210. rm -rf $RPM_BUILD_ROOT
  211. # install YAML C API
  212. ( cd yaml-%{V_libyaml}
  213. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  214. ) || exit $?
  215. # install Syck C API
  216. ( cd syck-%{V_libsyck}
  217. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  218. ) || exit $?
  219. # install PHP API
  220. %if "%{with_php}" == "yes"
  221. ( cd syck-%{V_libsyck}/ext/php
  222. %{l_make} %{l_mflags} install INSTALL_ROOT=$RPM_BUILD_ROOT
  223. ) || exit $?
  224. %endif
  225. # install Ruby API
  226. %if "%{with_ruby}" == "yes"
  227. ( cd syck-%{V_libsyck}/ext/ruby
  228. %{l_prefix}/bin/ruby install.rb install --prefix=$RPM_BUILD_ROOT
  229. ) || exit $?
  230. %endif
  231. # install Perl API
  232. %if "%{with_perl}" == "yes"
  233. %{l_prefix}/bin/perl-openpkg -d YAML-%{V_perl_yaml} install
  234. %{l_prefix}/bin/perl-openpkg -d YAML-Syck-%{V_perl_yaml_syck} install
  235. %{l_prefix}/bin/perl-openpkg -d YAML-Tiny-%{V_perl_yaml_tiny} install
  236. %{l_prefix}/bin/perl-openpkg -d YAML-AppConfig-%{V_perl_yaml_appconfig} install
  237. %{l_prefix}/bin/perl-openpkg -d YAML-LibYAML-%{V_perl_yaml_libyaml} install
  238. %{l_prefix}/bin/perl-openpkg -d YAML-Active-%{V_perl_yaml_active} install
  239. %{l_prefix}/bin/perl-openpkg -d IO-YAML-%{V_perl_io_yaml} install
  240. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  241. %else
  242. >perl-openpkg-files
  243. %endif
  244. # install JavaScript API
  245. %{l_shtool} mkdir -f -p -m 755 \
  246. $RPM_BUILD_ROOT%{l_prefix}/share/yaml
  247. %{l_shtool} install -c -m 644 \
  248. yaml-javascript-%{V_yaml_javascript}/yaml_dumper.js \
  249. $RPM_BUILD_ROOT%{l_prefix}/share/yaml/
  250. # install YAML specification and quick reference
  251. %{l_shtool} install -c -m 644 \
  252. %{SOURCE %{V_yaml_spec}.pdf} \
  253. $RPM_BUILD_ROOT%{l_prefix}/share/yaml/yaml.pdf
  254. %{l_shtool} install -c -m 644 \
  255. %{SOURCE yaml.yml} \
  256. $RPM_BUILD_ROOT%{l_prefix}/share/yaml/
  257. # determine installation files
  258. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  259. %{l_files_std} `cat perl-openpkg-files`
  260. %files -f files
  261. %clean
  262. rm -rf $RPM_BUILD_ROOT