bash.spec 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. ##
  2. ## bash.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2005 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_base_real 3.1
  26. %define V_base_comp 31
  27. %define V_plvl_raw 0
  28. %define V_plvl_pad 0
  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: OpenPKG
  35. Distribution: OpenPKG
  36. Class: CORE
  37. Group: Shell
  38. License: GPL
  39. Version: %{V_base_real}.%{V_plvl_raw}
  40. Release: 20051208
  41. # list of sources
  42. Source0: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}.tar.gz
  43. Source1: profile
  44. Patch0: bash.patch
  45. # build information
  46. Prefix: %{l_prefix}
  47. BuildRoot: %{l_buildroot}
  48. BuildPreReq: OpenPKG, openpkg >= 20040130
  49. PreReq: OpenPKG, openpkg >= 20040130
  50. AutoReq: no
  51. AutoReqProv: no
  52. %description
  53. Bash (Bourne-Again Shell) is an sh-compatible command language interpreter
  54. that executes commands read from the standard input or from a file. Bash
  55. also incorporates useful features from the Korn and C shells (ksh and csh).
  56. Bash is intended to be a conformant implementation of the IEEE POSIX Shell
  57. and Tools specification (IEEE Working Group 1003.2).
  58. %track
  59. prog bash = {
  60. version = %{V_base_real}
  61. url = ftp://ftp.cwru.edu/pub/bash/
  62. regex = bash-(__VER__)\.tar\.gz
  63. }
  64. prog bash:patches = {
  65. version = %{V_base_comp}-%{V_plvl_pad}
  66. url = ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/
  67. regex = bash(\S+-\d+)
  68. }
  69. %prep
  70. # unpack and patch distribution
  71. %setup -q -n bash-%{V_base_real}
  72. %patch -p0
  73. # brand with OpenPKG release and fix patchlevel
  74. %{l_shtool} subst \
  75. -e 's;@l_openpkg_release@;%{l_openpkg_release};' \
  76. version.c
  77. %build
  78. # configure package
  79. ( # force disabled wide-character support
  80. echo "ac_cv_header_wchar_h=no"
  81. echo "ac_cv_header_wctype_h=no"
  82. echo "ac_cv_func_mbsrtowcs=no"
  83. # force disabled internationalization support
  84. echo "ac_cv_header_libintl_h=no"
  85. echo "ac_cv_func_gettext=no"
  86. echo "ac_cv_func_textdomain=no"
  87. echo "ac_cv_func_bindtextdomain=no"
  88. echo "ac_cv_lib_intl_bindtextdomain=no"
  89. ) >config.cache
  90. CC="%{l_cc}" \
  91. CFLAGS="%{l_cflags -O}" \
  92. ./configure \
  93. --cache-file=./config.cache \
  94. --prefix=%{l_prefix} \
  95. --disable-multibyte \
  96. --enable-debugger \
  97. --without-gnu-malloc \
  98. --without-curses \
  99. --disable-nls
  100. %{l_shtool} subst \
  101. -e 's;^\(#define.*SYS_PROFILE["^]*\).*;\1 "%{l_prefix}/etc/bash/profile";' \
  102. pathnames.h
  103. %{l_shtool} subst \
  104. -e 's;/etc/profile;%{l_prefix}/etc/bash/profile;' \
  105. doc/bash.1
  106. # build package
  107. %{l_make} %{l_mflags}
  108. %install
  109. # install package
  110. rm -rf $RPM_BUILD_ROOT
  111. %{l_make} %{l_mflags} install \
  112. prefix=$RPM_BUILD_ROOT%{l_prefix}
  113. # strip down installation
  114. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  115. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/bashbug.1
  116. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/bashbug
  117. strip $RPM_BUILD_ROOT%{l_prefix}/bin/bash || true
  118. # install global configuration
  119. %{l_shtool} mkdir -f -p -m 755 \
  120. $RPM_BUILD_ROOT%{l_prefix}/etc/bash
  121. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  122. %{SOURCE profile} $RPM_BUILD_ROOT%{l_prefix}/etc/bash/
  123. # determine installation files
  124. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  125. %{l_files_std} \
  126. '%config %{l_prefix}/etc/bash/profile'
  127. %files -f files
  128. %clean
  129. rm -rf $RPM_BUILD_ROOT
  130. %post
  131. if [ ".$1" = .1 ]; then
  132. # display note about login shell prerequisite
  133. if [ -f /etc/shells ]; then
  134. if [ ".`grep $RPM_INSTALL_PREFIX/bin/bash /etc/shells`" = . ]; then
  135. ( echo "Hint: To use $RPM_INSTALL_PREFIX/bin/bash as the login"
  136. echo "shell for users, please add this path to /etc/shells."
  137. ) | %{l_rpmtool} msg -b -t notice
  138. fi
  139. fi
  140. fi