yaml.spec 11 KB

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