bash.spec 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. ##
  2. ## bash.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_real 2.05b
  27. %define V_comp 205b
  28. %define V_plvl 7
  29. # package information
  30. Name: bash
  31. Summary: Bourne-Again Shell
  32. URL: http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html
  33. Vendor: Free Software Foundation
  34. Packager: The OpenPKG Project
  35. Distribution: OpenPKG
  36. Class: CORE
  37. Group: Shell
  38. License: GPL
  39. Version: %{V_real}.%{V_plvl}
  40. Release: 20040327
  41. # list of sources
  42. Source0: ftp://ftp.cwru.edu/pub/bash/bash-%{V_real}.tar.gz
  43. Source1: profile
  44. Patch0: bash.patch
  45. Patch1: ftp://ftp.cwru.edu/pub/bash/bash-%{V_real}-patches/bash%{V_comp}-001
  46. Patch2: ftp://ftp.cwru.edu/pub/bash/bash-%{V_real}-patches/bash%{V_comp}-002
  47. Patch3: ftp://ftp.cwru.edu/pub/bash/bash-%{V_real}-patches/bash%{V_comp}-003
  48. Patch4: ftp://ftp.cwru.edu/pub/bash/bash-%{V_real}-patches/bash%{V_comp}-004
  49. Patch5: ftp://ftp.cwru.edu/pub/bash/bash-%{V_real}-patches/bash%{V_comp}-005
  50. Patch6: ftp://ftp.cwru.edu/pub/bash/bash-%{V_real}-patches/bash%{V_comp}-006
  51. Patch7: ftp://ftp.cwru.edu/pub/bash/bash-%{V_real}-patches/bash%{V_comp}-007
  52. # build information
  53. Prefix: %{l_prefix}
  54. BuildRoot: %{l_buildroot}
  55. BuildPreReq: OpenPKG, openpkg >= 20040130
  56. PreReq: OpenPKG, openpkg >= 20040130
  57. AutoReq: no
  58. AutoReqProv: no
  59. %description
  60. Bash (Bourne-Again Shell) is an sh-compatible command language interpreter
  61. that executes commands read from the standard input or from a file. Bash
  62. also incorporates useful features from the Korn and C shells (ksh and csh).
  63. Bash is intended to be a conformant implementation of the IEEE POSIX Shell
  64. and Tools specification (IEEE Working Group 1003.2).
  65. %track
  66. prog bash = {
  67. version = %{version}
  68. url = ftp://ftp.cwru.edu/pub/bash/
  69. regex = bash-(__VER__)\.tar\.gz
  70. }
  71. prog bash:patches = {
  72. version = %{V_comp}-007
  73. url = ftp://ftp.cwru.edu/pub/bash/
  74. regex = (bash-\d+\.\d+[a-z]+-patches)
  75. url = ftp://ftp.cwru.edu/pub/bash/__NEWVER__/
  76. regex = bash(\S+-\d+)
  77. }
  78. %prep
  79. %setup -q
  80. %patch -p0 -P 0 1 2 3 4 5 6 7
  81. %{l_shtool} subst \
  82. -e 's;@l_openpkg_release@;%{l_openpkg_release};' \
  83. version.c
  84. %{l_shtool} subst \
  85. -e 's;\(PATCHLEVEL\) 0;\1 %{V_plvl};' \
  86. patchlevel.h
  87. %build
  88. # configure package
  89. ( # force disabled wide-character support
  90. echo "ac_cv_header_wchar_h=no"
  91. echo "ac_cv_header_wctype_h=no"
  92. echo "ac_cv_func_mbsrtowcs=no"
  93. # force disabled internationalization support
  94. echo "ac_cv_header_libintl_h=no"
  95. echo "ac_cv_func_gettext=no"
  96. echo "ac_cv_func_textdomain=no"
  97. echo "ac_cv_func_bindtextdomain=no"
  98. echo "ac_cv_lib_intl_bindtextdomain=no"
  99. ) >config.cache
  100. CC="%{l_cc}" \
  101. CFLAGS="%{l_cflags -O}" \
  102. ./configure \
  103. --cache-file=./config.cache \
  104. --prefix=%{l_prefix} \
  105. --without-gnu-malloc \
  106. --without-curses
  107. %{l_shtool} subst \
  108. -e 's;^\(#define.*SYS_PROFILE["^]*\).*;\1 "%{l_prefix}/etc/bash/profile";' \
  109. pathnames.h
  110. %{l_shtool} subst \
  111. -e 's;/etc/profile;%{l_prefix}/etc/bash/profile;' \
  112. doc/bash.1
  113. # build package
  114. %{l_make} %{l_mflags}
  115. %install
  116. # install package
  117. rm -rf $RPM_BUILD_ROOT
  118. %{l_make} %{l_mflags} install \
  119. prefix=$RPM_BUILD_ROOT%{l_prefix}
  120. # strip down installation
  121. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  122. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/bashbug.1
  123. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/bashbug
  124. strip $RPM_BUILD_ROOT%{l_prefix}/bin/bash
  125. # install global configuration
  126. %{l_shtool} mkdir -f -p -m 755 \
  127. $RPM_BUILD_ROOT%{l_prefix}/etc/bash
  128. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  129. %{SOURCE profile} $RPM_BUILD_ROOT%{l_prefix}/etc/bash/
  130. # determine installation files
  131. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  132. %{l_files_std} \
  133. '%config %{l_prefix}/etc/bash/profile'
  134. %files -f files
  135. %clean
  136. rm -rf $RPM_BUILD_ROOT
  137. %post
  138. if [ ".$1" = .1 ]; then
  139. # display note about login shell prerequisite
  140. if [ -f /etc/shells ]; then
  141. if [ ".`grep $RPM_INSTALL_PREFIX/bin/bash /etc/shells`" = . ]; then
  142. ( echo "Hint: To use $RPM_INSTALL_PREFIX/bin/bash as the login"
  143. echo "shell for users, please add this path to /etc/shells."
  144. ) | %{l_rpmtool} msg -b -t notice
  145. fi
  146. fi
  147. fi