json.spec 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. ##
  2. ## json.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 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_api_c 0.6
  26. %define V_api_pl1 1.07
  27. %define V_api_pl2 0.01
  28. %define V_api_js 20060510
  29. %define V_draft 01
  30. # package information
  31. Name: json
  32. Summary: JavaScript Object Notation
  33. URL: http://www.json.org/
  34. Vendor: D. Crockford et al.
  35. Packager: OpenPKG
  36. Distribution: OpenPKG
  37. Class: EVAL
  38. Group: Language
  39. License: Open Source
  40. Version: 20060605
  41. Release: 20060605
  42. # list of sources
  43. Source0: http://oss.metaparadigm.com/json-c/json-c-%{V_api_c}.tar.gz
  44. Source1: http://www.cpan.org/authors/id/M/MA/MAKAMAKA/JSON-%{V_api_pl1}.tar.gz
  45. Source2: http://www.cpan.org/authors/id/M/MA/MAKAMAKA/JSON-PC-%{V_api_pl2}.tar.gz
  46. Source3: ftp://ftp.openpkg.org/sources/CPY/VERSIONED/json/json-%{V_api_js}.js
  47. Source4: http://www.json.org/draft-crockford-jsonorg-json-%{V_draft}.txt
  48. # build information
  49. Prefix: %{l_prefix}
  50. BuildRoot: %{l_buildroot}
  51. BuildPreReq: OpenPKG, openpkg >= 20040130, perl, make
  52. PreReq: OpenPKG, openpkg >= 20040130, perl
  53. AutoReq: no
  54. AutoReqProv: no
  55. %description
  56. JSON (JavaScript Object Notation) is a lightweight data-interchange
  57. format. It is easy for humans to read and write. It is easy for
  58. machines to parse and generate. It is based on a subset of the
  59. JavaScript Programming Language, Standard ECMA-262 3rd Edition.
  60. JSON is a text format that is completely language independent but
  61. uses conventions that are familiar to programmers of the C-family
  62. of languages. These properties make JSON an ideal data-interchange
  63. language.
  64. %track
  65. prog json:json-c = {
  66. version = %{V_api_c}
  67. url = http://oss.metaparadigm.com/json-c/
  68. regex = json-c-(__VER__)\.tar\.gz
  69. }
  70. prog json:json-pl1 = {
  71. version = %{V_api_pl1}
  72. url = http://www.cpan.org/authors/id/M/MA/MAKAMAKA/
  73. regex = JSON-(__VER__)\.tar\.gz
  74. }
  75. prog json:json-pl2 = {
  76. version = %{V_api_pl2}
  77. url = http://www.cpan.org/authors/id/M/MA/MAKAMAKA/
  78. regex = JSON-PC-(__VER__)\.tar\.gz
  79. }
  80. prog json:json-js = {
  81. version = %{V_api_js}
  82. url = ftp://ftp.openpkg.org/sources/CPY/VERSIONED/json/
  83. regex = json-(__VER__)\.js
  84. }
  85. %prep
  86. %setup -q -c
  87. %setup -q -T -D -a 1
  88. %setup -q -T -D -a 2
  89. %build
  90. ( cd json-c-%{V_api_c}
  91. CC="%{l_cc}" \
  92. CFLAGS="%{l_cflags -O}" \
  93. ./configure \
  94. --prefix=%{l_prefix} \
  95. --disable-shared
  96. %{l_make} %{l_mflags -O}
  97. ) || exit $?
  98. %{l_prefix}/bin/perl-openpkg prepare
  99. %{l_prefix}/bin/perl-openpkg -d JSON-%{V_api_pl1} configure build
  100. %{l_prefix}/bin/perl-openpkg -d JSON-PC-%{V_api_pl2} configure build
  101. %install
  102. rm -rf $RPM_BUILD_ROOT
  103. ( cd json-c-%{V_api_c}
  104. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  105. ) || exit $?
  106. %{l_shtool} mkdir -f -p -m 755 \
  107. $RPM_BUILD_ROOT%{l_prefix}/share/json
  108. %{l_shtool} install -c -m 644 \
  109. %{SOURCE json-%{V_api_js}.js} \
  110. $RPM_BUILD_ROOT%{l_prefix}/share/json/json.js
  111. %{l_shtool} install -c -m 644 \
  112. %{SOURCE draft-crockford-jsonorg-json-%{V_draft}.txt} \
  113. $RPM_BUILD_ROOT%{l_prefix}/share/json/json.txt
  114. %{l_prefix}/bin/perl-openpkg -d JSON-%{V_api_pl1} install
  115. %{l_prefix}/bin/perl-openpkg -d JSON-PC-%{V_api_pl2} install
  116. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  117. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  118. %{l_files_std} `cat perl-openpkg-files`
  119. %files -f files
  120. %clean
  121. rm -rf $RPM_BUILD_ROOT