bash.spec 6.3 KB

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