io.spec 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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 20070313
  26. %define V_dist 2007-03-13
  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: 20070313
  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}.tar.gz
  46. Patch0: io.patch
  47. # build information
  48. Prefix: %{l_prefix}
  49. BuildRoot: %{l_buildroot}
  50. BuildPreReq: OpenPKG, openpkg >= 20040130, make
  51. PreReq: OpenPKG, openpkg >= 20040130
  52. %if "%{with_zlib}" == "yes"
  53. BuildPreReq: zlib
  54. PreReq: zlib
  55. %endif
  56. %if "%{with_libxml}" == "yes"
  57. BuildPreReq: libxml
  58. PreReq: libxml
  59. %endif
  60. %if "%{with_sqlite}" == "yes"
  61. BuildPreReq: sqlite
  62. PreReq: sqlite
  63. %endif
  64. AutoReq: no
  65. AutoReqProv: no
  66. %description
  67. Io is a small, prototype-based programming language. The ideas
  68. in Io are mostly inspired by Smalltalk (all values are objects),
  69. Self (prototype-based), NewtonScript (differential inheritance),
  70. Act1 (actors and futures for concurrency), LISP (code is a runtime
  71. inspectable/modifiable tree) and Lua (small, embeddable).
  72. %track
  73. prog io = {
  74. version = %{V_dist}
  75. url = http://www.iolanguage.com/downloads/
  76. regex = Io-(__VER__)\.tar\.gz
  77. }
  78. %prep
  79. %setup -q -n Io-%{V_dist}
  80. %patch -p0
  81. %build
  82. # prepare addon directory
  83. ( cd addons
  84. addons=""
  85. addons="$addons BigNum Blowfish CGI ContinuedFraction Contracts MD5 Random"
  86. addons="$addons Rational Regex SHA1 SystemCall Socket User Vector"
  87. %if "%{with_threads}" == "yes"
  88. addons="$addons Thread"
  89. %endif
  90. %if "%{with_zlib}" == "yes"
  91. addons="$addons Zlib"
  92. %endif
  93. %if "%{with_libxml}" == "yes"
  94. addons="$addons Libxml2"
  95. %endif
  96. %if "%{with_sqlite}" == "yes"
  97. addons="$addons SQLite3"
  98. %endif
  99. for addon in *; do mv $addon _$addon; done
  100. for addon in $addons; do mv _$addon $addon; done
  101. rm -rf _*
  102. ) || exit $?
  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. %install
  108. # install program and addons
  109. rm -rf $RPM_BUILD_ROOT
  110. %{l_shtool} mkdir -f -p -m 755 \
  111. $RPM_BUILD_ROOT%{l_prefix}/bin \
  112. $RPM_BUILD_ROOT%{l_prefix}/lib
  113. %{l_make} %{l_mflags} install \
  114. INSTALL_PREFIX=$RPM_BUILD_ROOT%{l_prefix}
  115. # prune addon directory tree
  116. find $RPM_BUILD_ROOT%{l_prefix}/lib/io -type d -depth -print | grep "/_build/headers" | xargs rm -rf
  117. find $RPM_BUILD_ROOT%{l_prefix}/lib/io -type d -depth -print | grep "/_build/objs" | xargs rm -rf
  118. find $RPM_BUILD_ROOT%{l_prefix}/lib/io -type d -depth -print | grep "/_build/lib" | xargs rm -rf
  119. find $RPM_BUILD_ROOT%{l_prefix}/lib/io -type d -depth -print | grep "/tests" | xargs rm -rf
  120. find $RPM_BUILD_ROOT%{l_prefix}/lib/io -type d -depth -print | grep "/source" | xargs rm -rf
  121. find $RPM_BUILD_ROOT%{l_prefix}/lib/io -type f -depth -print | grep "build.io" | xargs rm -f
  122. find $RPM_BUILD_ROOT%{l_prefix}/lib/io -type f -depth -print | grep "depends" | xargs rm -f
  123. find $RPM_BUILD_ROOT%{l_prefix}/lib/io -type d -depth -print | xargs rmdir >/dev/null 2>&1 || true
  124. # prune executable
  125. mv $RPM_BUILD_ROOT%{l_prefix}/bin/io_static \
  126. $RPM_BUILD_ROOT%{l_prefix}/bin/io
  127. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  128. # remove useless files
  129. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libiovmall.*
  130. # determine installation files
  131. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  132. %files -f files
  133. %clean
  134. rm -rf $RPM_BUILD_ROOT