io.spec 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. ##
  2. ## io.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_opkg 20070528
  26. %define V_dist 2007-05-28
  27. # package information
  28. Name: io
  29. Summary: IO Programming Language
  30. URL: http://www.iolanguage.com/
  31. Vendor: Steve Dekorte
  32. Packager: OpenPKG Foundation e.V.
  33. Distribution: OpenPKG Community
  34. Class: EVAL
  35. Group: Language
  36. License: BSD
  37. Version: %{V_opkg}
  38. Release: 20070531
  39. # package options
  40. %option with_threads no
  41. %option with_zlib no
  42. %option with_libxml no
  43. %option with_sqlite no
  44. # list of sources
  45. Source0: http://io.urbanape.com/release/Io-%{V_dist}.zip
  46. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20040130, make, infozip
  50. PreReq: OpenPKG, openpkg >= 20040130
  51. %if "%{with_zlib}" == "yes"
  52. BuildPreReq: zlib
  53. PreReq: zlib
  54. %endif
  55. %if "%{with_libxml}" == "yes"
  56. BuildPreReq: libxml
  57. PreReq: libxml
  58. %endif
  59. %if "%{with_sqlite}" == "yes"
  60. BuildPreReq: sqlite
  61. PreReq: sqlite
  62. %endif
  63. AutoReq: no
  64. AutoReqProv: no
  65. %description
  66. Io is a small, prototype-based programming language. The ideas
  67. in Io are mostly inspired by Smalltalk (all values are objects),
  68. Self (prototype-based), NewtonScript (differential inheritance),
  69. Act1 (actors and futures for concurrency), LISP (code is a runtime
  70. inspectable/modifiable tree) and Lua (small, embeddable).
  71. %track
  72. prog io = {
  73. version = %{V_dist}
  74. url = http://www.iolanguage.com/downloads/
  75. regex = Io-(__VER__)\.zip
  76. }
  77. %prep
  78. %setup -q -T -c
  79. %{l_prefix}/bin/unzip -q -x %{SOURCE0}
  80. %build
  81. # prepare addon directory
  82. ( cd Io-%{V_dist}/addons
  83. addons=""
  84. addons="$addons BigNum Blowfish CGI ContinuedFraction Contracts MD5 Random"
  85. addons="$addons Rational Regex SHA1 SystemCall Socket User Vector"
  86. %if "%{with_threads}" == "yes"
  87. addons="$addons Thread"
  88. %endif
  89. %if "%{with_zlib}" == "yes"
  90. addons="$addons Zlib"
  91. %endif
  92. %if "%{with_libxml}" == "yes"
  93. addons="$addons Libxml2"
  94. %endif
  95. %if "%{with_sqlite}" == "yes"
  96. addons="$addons SQLite3"
  97. %endif
  98. for addon in *; do mv $addon _$addon; done
  99. for addon in $addons; do mv _$addon $addon; done
  100. rm -rf _*
  101. ) || exit $?
  102. ( cd Io-%{V_dist}
  103. # build program and addons
  104. %{l_make} %{l_mflags -O} \
  105. INSTALL_PREFIX=%{l_prefix} \
  106. CC="%{l_cc} %{l_cflags -O} %{l_cppflags} -L_build/lib %{l_ldflags}"
  107. ) || exit $?
  108. %install
  109. # install program and addons
  110. rm -rf $RPM_BUILD_ROOT
  111. %{l_shtool} mkdir -f -p -m 755 \
  112. $RPM_BUILD_ROOT%{l_prefix}/bin \
  113. $RPM_BUILD_ROOT%{l_prefix}/lib
  114. ( cd Io-%{V_dist}
  115. %{l_make} %{l_mflags} install \
  116. INSTALL_PREFIX=$RPM_BUILD_ROOT%{l_prefix}
  117. ) || exit $?
  118. # prune addon directory tree
  119. find $RPM_BUILD_ROOT%{l_prefix}/lib/io -type d -depth -print | grep "/_build/headers" | xargs rm -rf
  120. find $RPM_BUILD_ROOT%{l_prefix}/lib/io -type d -depth -print | grep "/_build/objs" | xargs rm -rf
  121. find $RPM_BUILD_ROOT%{l_prefix}/lib/io -type d -depth -print | grep "/_build/lib" | xargs rm -rf
  122. find $RPM_BUILD_ROOT%{l_prefix}/lib/io -type d -depth -print | grep "/tests" | xargs rm -rf
  123. find $RPM_BUILD_ROOT%{l_prefix}/lib/io -type d -depth -print | grep "/source" | xargs rm -rf
  124. find $RPM_BUILD_ROOT%{l_prefix}/lib/io -type f -depth -print | grep "build.io" | xargs rm -f
  125. find $RPM_BUILD_ROOT%{l_prefix}/lib/io -type f -depth -print | grep "depends" | xargs rm -f
  126. find $RPM_BUILD_ROOT%{l_prefix}/lib/io -type d -depth -print | xargs rmdir >/dev/null 2>&1 || true
  127. # prune executable
  128. mv $RPM_BUILD_ROOT%{l_prefix}/bin/io_static \
  129. $RPM_BUILD_ROOT%{l_prefix}/bin/io
  130. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  131. # remove useless files
  132. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libiovmall.*
  133. # determine installation files
  134. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  135. %files -f files
  136. %clean
  137. rm -rf $RPM_BUILD_ROOT