ksh.spec 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. ##
  2. ## ksh.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 versions
  26. %define V_pkg 20041225
  27. %define V_ksh 2004-12-25
  28. %define V_init 2004-12-25
  29. # package information
  30. Name: ksh
  31. Summary: The Original AT&T Korn Shell
  32. URL: http://www.kornshell.com/
  33. Vendor: David G. Korn, AT&T Bell Labs
  34. Packager: The OpenPKG Project
  35. Distribution: OpenPKG
  36. Class: BASE
  37. Group: Shell
  38. License: AT&T
  39. Version: %{V_pkg}
  40. Release: 20041230
  41. # list of sources
  42. # you can't download this automatically anymore, as you will have to sign with
  43. # user/password a license agreement (tho, 30.12.2004)
  44. Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{V_ksh}.tgz
  45. Source1: http://www.research.att.com/~gsf/download/tgz/INIT.%{V_init}.tgz
  46. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc
  50. PreReq: OpenPKG, openpkg >= 20040130
  51. AutoReq: no
  52. AutoReqProv: no
  53. Provides: KSH
  54. Conflicts: pdksh
  55. %description
  56. The KornShell language was designed and developed by David G. Korn
  57. at AT&T Bell Laboratories. It is an interactive command language
  58. that provides access to the UNIX system and to many other systems,
  59. on the many different computers and workstations on which it is
  60. implemented. This is Ksh93 which is intended to conform to the Shell
  61. Language Standard developed by the IEEE POSIX 1003.2 Shell and
  62. Utilities Language Committee.
  63. %track
  64. prog ksh = {
  65. version = %{V_init}
  66. url = http://www.research.att.com/~gsf/cgi-bin/download.cgi?action=list&name=ast-ksh
  67. regex = ast-ksh\.([\d-]+)\.tgz
  68. }
  69. prog ksh:init = {
  70. version = %{V_init}
  71. url = http://www.research.att.com/~gsf/cgi-bin/download.cgi?action=list&name=INIT
  72. regex = INIT\.([\d-]+)\.tgz
  73. }
  74. %prep
  75. %setup -q -c
  76. %setup -q -T -D -a 1
  77. %build
  78. # the supplied Mamfiles work only for standard UNIX environment
  79. # because they are no regenerated by us (no "nmake" available)
  80. case "%{l_platform -t}" in
  81. *-sunos5.6* ) ;;
  82. *-sunos* )
  83. %{l_shtool} subst \
  84. -e '/^exec.*-o ksh/s/\(\${mam_libm}\)/\1 -lsecdb/' \
  85. src/cmd/ksh93/Mamfile
  86. ;;
  87. sparc*-linux* )
  88. %{l_shtool} subst \
  89. -e '/^exec.*-o ksh/s/\(\${mam_libm}\)/\1 -ldll/' \
  90. src/cmd/ksh93/Mamfile
  91. ;;
  92. sparc64-netbsd* )
  93. %{l_shtool} subst \
  94. -e '/^probe_pic=/s/-fpic/-fPIC -fpic/' \
  95. -e '/^probe_PIC=/s/-fpic -fPIC/-fPIC -fpic/' \
  96. src/cmd/INIT/make.probe
  97. ;;
  98. esac
  99. ./bin/package "read" || true
  100. ./bin/package "make" CC="%{l_cc}"
  101. %install
  102. rm -rf $RPM_BUILD_ROOT
  103. %{l_shtool} mkdir -f -p -m 755 \
  104. $RPM_BUILD_ROOT%{l_prefix}/bin \
  105. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  106. %{l_shtool} install -c -s -m 755 \
  107. arch/*/bin/ksh $RPM_BUILD_ROOT%{l_prefix}/bin/ksh
  108. %{l_shtool} install -c -m 644 \
  109. arch/*/man/man1/sh.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/ksh.1
  110. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  111. %files -f files
  112. %clean
  113. rm -rf $RPM_BUILD_ROOT
  114. %post
  115. if [ ".$1" = .1 ]; then
  116. if [ -f /etc/shells ]; then
  117. if [ ".`grep $RPM_INSTALL_PREFIX/bin/ksh /etc/shells`" = . ]; then
  118. ( echo "Hint: To use $RPM_INSTALL_PREFIX/bin/ksh as the login"
  119. echo "shell for users, please add this path to /etc/shells."
  120. ) | %{l_rpmtool} msg -b -t notice
  121. fi
  122. fi
  123. fi