tcl.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. ##
  2. ## tcl.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package version
  26. %define V_major 8
  27. %define V_minor 4
  28. %define V_level 6
  29. # package information
  30. Name: tcl
  31. Summary: Tool Command Language (TCL)
  32. URL: http://tcl.activestate.com/
  33. Vendor: John Ousterhout
  34. Packager: The OpenPKG Project
  35. Distribution: OpenPKG
  36. Class: BASE
  37. Group: Language
  38. License: GPL
  39. Version: %{V_major}.%{V_minor}.%{V_level}
  40. Release: 20040304
  41. # package options
  42. %option with_x11 no
  43. # list of sources
  44. Source0: ftp://ftp.scriptics.com/pub/tcl/tcl%{V_major}_%{V_minor}/tcl%{V_major}.%{V_minor}.%{V_level}-src.tar.gz
  45. Source1: ftp://ftp.scriptics.com/pub/tcl/tcl%{V_major}_%{V_minor}/tk%{V_major}.%{V_minor}.%{V_level}-src.tar.gz
  46. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20040130
  50. PreReq: OpenPKG, openpkg >= 20040130
  51. %if "%{with_x11}" == "yes"
  52. BuildPreReq: X11
  53. PreReq: X11
  54. %endif
  55. AutoReq: no
  56. AutoReqProv: no
  57. %description
  58. The Tool Command Language (TCL), optionally including the
  59. popular TCL Widget Toolkit (Tk).
  60. %track
  61. prog tcl:tcl = {
  62. version = %{version}
  63. url = ftp://ftp.scriptics.com/pub/tcl/tcl8_4/
  64. regex = tcl(__VER__)-src\.tar.gz
  65. }
  66. prog tcl:tk = {
  67. version = %{version}
  68. url = ftp://ftp.scriptics.com/pub/tcl/tcl8_4/
  69. regex = tk(__VER__)-src\.tar.gz
  70. }
  71. %prep
  72. %setup -q -c -n tcl-%{V_major}.%{V_minor}.%{V_level}
  73. %setup -q -T -D -a 1
  74. %build
  75. # build Tcl
  76. ( cd tcl%{V_major}.%{V_minor}.%{V_level}/unix
  77. CC="%{l_cc}" \
  78. CFLAGS="%{l_cflags -O}" \
  79. ./configure \
  80. --prefix=%{l_prefix} \
  81. --includedir=%{l_prefix}/include/tcl \
  82. --disable-shared
  83. %{l_make} %{l_mflags -O}
  84. ) || exit $?
  85. # build Tk (optional)
  86. %if "%{with_x11}" == "yes"
  87. ( cd tk%{V_major}.%{V_minor}.%{V_level}/unix
  88. CC="%{l_cc}" \
  89. CFLAGS="%{l_cflags -O}" \
  90. ./configure \
  91. --prefix=%{l_prefix} \
  92. --includedir=%{l_prefix}/include/tcl \
  93. --disable-shared \
  94. --with-tcl=../../tcl%{V_major}.%{V_minor}.%{V_level}/unix \
  95. --with-x \
  96. --x-includes=`%{l_prefix}/etc/rc --query x11_incdir` \
  97. --x-libraries=`%{l_prefix}/etc/rc --query x11_libdir`
  98. %{l_make} %{l_mflags -O}
  99. ) || exit $?
  100. %endif
  101. %install
  102. rm -rf $RPM_BUILD_ROOT
  103. # install Tcl
  104. ( cd tcl%{V_major}.%{V_minor}.%{V_level}/unix
  105. %{l_shtool} subst \
  106. -e 's;-L[^ ]*;%{l_ldflags};g' \
  107. -e "s;\\(TCL_BUILD_STUB_LIB_PATH=\\).*;\\1'%{l_prefix}/lib/libtclstub%{V_major}.%{V_minor}\${TCL_DBGX}.a';" \
  108. tclConfig.sh
  109. %{l_make} %{l_mflags} install INSTALL_ROOT=$RPM_BUILD_ROOT
  110. ) || exit $?
  111. ( cd $RPM_BUILD_ROOT%{l_prefix}
  112. mv bin/tclsh%{V_major}.%{V_minor} bin/tclsh
  113. ln lib/libtcl%{V_major}.%{V_minor}.a lib/libtcl.a
  114. ln lib/libtclstub%{V_major}.%{V_minor}.a lib/libtclstub.a
  115. cd man/mann
  116. for mo in *.n; do
  117. mn=`echo $mo | sed -e 's;\.n$;.3;'`
  118. mv $mo ../man3/$mn
  119. done
  120. cd ../man3
  121. chmod u+w *
  122. for mp in *.3; do
  123. if [ ".`echo $mp | grep '^Tcl_'`" = . ]; then
  124. mv $mp Tcl_$mp
  125. fi
  126. done
  127. ) || exit $?
  128. # install Tk (optional)
  129. %if "%{with_x11}" == "yes"
  130. ( cd tk%{V_major}.%{V_minor}.%{V_level}/unix
  131. %{l_shtool} subst \
  132. -e 's;-L[^ ]*;%{l_ldflags};g' \
  133. -e "s;\\(TK_BUILD_STUB_LIB_PATH=\\).*;\\1'%{l_prefix}/lib/libtkstub%{V_major}.%{V_minor}.a';" \
  134. tkConfig.sh
  135. %{l_make} %{l_mflags} install INSTALL_ROOT=$RPM_BUILD_ROOT
  136. ) || exit $?
  137. ( cd $RPM_BUILD_ROOT%{l_prefix}
  138. mv bin/wish%{V_major}.%{V_minor} bin/wish
  139. ln lib/libtk%{V_major}.%{V_minor}.a lib/libtk.a
  140. ln lib/libtkstub%{V_major}.%{V_minor}.a lib/libtkstub.a
  141. cd man/mann
  142. for mo in *.n; do
  143. mn=`echo $mo | sed -e 's;\.n$;.3;'`
  144. mv $mo ../man3/$mn
  145. done
  146. cd ../man3
  147. chmod u+w *
  148. for mp in *.3; do
  149. if [ ".`echo $mp | grep '^Tcl_'`" = . ] && \
  150. [ ".`echo $mp | grep '^Tk_'`" = . ]; then
  151. mv $mp Tk_$mp
  152. fi
  153. done
  154. ) || exit $?
  155. %endif
  156. # post-process installation
  157. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  158. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  159. %files -f files
  160. %clean
  161. rm -rf $RPM_BUILD_ROOT