bash.spec 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. ##
  2. ## bash.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2007 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.2
  26. %define V_base_comp 32
  27. %define V_plvl_raw 25
  28. %define V_plvl_pad 025
  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 Foundation e.V.
  35. Distribution: OpenPKG Community
  36. Class: CORE
  37. Group: Shell
  38. License: GPL
  39. Version: %{V_base_real}.%{V_plvl_raw}
  40. Release: 20070927
  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. Patch12: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-012
  57. Patch13: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-013
  58. Patch14: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-014
  59. Patch15: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-015
  60. Patch16: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-016
  61. Patch17: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-017
  62. Patch18: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-018
  63. Patch19: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-019
  64. Patch20: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-020
  65. Patch21: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-021
  66. Patch22: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-022
  67. Patch23: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-023
  68. Patch24: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-024
  69. Patch25: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-025
  70. # build information
  71. Prefix: %{l_prefix}
  72. BuildRoot: %{l_buildroot}
  73. BuildPreReq: OpenPKG, openpkg >= 20040130
  74. PreReq: OpenPKG, openpkg >= 20040130
  75. AutoReq: no
  76. AutoReqProv: no
  77. %description
  78. Bash (Bourne-Again Shell) is an sh-compatible command language
  79. interpreter that executes commands read from the standard input or
  80. from a file. Bash also incorporates useful features from the Korn
  81. and C shells (ksh and csh). Bash is intended to be a conformant
  82. implementation of the IEEE POSIX Shell and Tools specification (IEEE
  83. Working Group 1003.2).
  84. %track
  85. prog bash = {
  86. version = %{V_base_real}
  87. url = ftp://ftp.cwru.edu/pub/bash/
  88. regex = bash-(__VER__)\.tar\.gz
  89. }
  90. prog bash:patches = {
  91. version = %{V_base_comp}-%{V_plvl_pad}
  92. url = ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/
  93. regex = bash(\S+-\d+)
  94. }
  95. %prep
  96. # unpack and patch distribution
  97. %setup -q -n bash-%{V_base_real}
  98. %patch -p0 -P 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
  99. sleep 1
  100. touch y.tab.[ch]
  101. touch configure config.h.in
  102. # brand with OpenPKG release and fix patchlevel
  103. %{l_shtool} subst \
  104. -e 's;@l_openpkg_release@;%{l_openpkg_release};' \
  105. version.c
  106. %build
  107. # configure package
  108. ( # force disabled wide-character support
  109. echo "ac_cv_header_wchar_h=no"
  110. echo "ac_cv_header_wctype_h=no"
  111. echo "ac_cv_func_mbsrtowcs=no"
  112. # force disabled internationalization support
  113. echo "ac_cv_header_libintl_h=no"
  114. echo "ac_cv_func_gettext=no"
  115. echo "ac_cv_func_textdomain=no"
  116. echo "ac_cv_func_bindtextdomain=no"
  117. echo "ac_cv_lib_intl_bindtextdomain=no"
  118. ) >config.cache
  119. CC="%{l_cc}" \
  120. CFLAGS="%{l_cflags -O}" \
  121. ./configure \
  122. --cache-file=./config.cache \
  123. --prefix=%{l_prefix} \
  124. --disable-multibyte \
  125. --enable-debugger \
  126. --without-gnu-malloc \
  127. --without-curses \
  128. --disable-nls
  129. %{l_shtool} subst \
  130. -e 's;^\(#define.*SYS_PROFILE["^]*\).*;\1 "%{l_prefix}/etc/bash/profile";' \
  131. pathnames.h
  132. %{l_shtool} subst \
  133. -e 's;/etc/profile;%{l_prefix}/etc/bash/profile;' \
  134. doc/bash.1
  135. # build package
  136. %{l_make} %{l_mflags}
  137. %install
  138. # install package
  139. rm -rf $RPM_BUILD_ROOT
  140. %{l_make} %{l_mflags} install \
  141. prefix=$RPM_BUILD_ROOT%{l_prefix}
  142. # strip down installation
  143. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  144. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/bashbug.1
  145. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/bashbug
  146. strip $RPM_BUILD_ROOT%{l_prefix}/bin/bash || true
  147. # install global configuration
  148. %{l_shtool} mkdir -f -p -m 755 \
  149. $RPM_BUILD_ROOT%{l_prefix}/etc/bash
  150. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  151. %{SOURCE profile} $RPM_BUILD_ROOT%{l_prefix}/etc/bash/
  152. # determine installation files
  153. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  154. %{l_files_std} \
  155. '%config %{l_prefix}/etc/bash/profile'
  156. %files -f files
  157. %clean
  158. rm -rf $RPM_BUILD_ROOT
  159. %post
  160. if [ ".$1" = .1 ]; then
  161. # display note about login shell prerequisite
  162. if [ -f /etc/shells ]; then
  163. if [ ".`grep $RPM_INSTALL_PREFIX/bin/bash /etc/shells`" = . ]; then
  164. ( echo "Hint: To use $RPM_INSTALL_PREFIX/bin/bash as the login"
  165. echo "shell for users, please add this path to /etc/shells."
  166. ) | %{l_rpmtool} msg -b -t notice
  167. fi
  168. fi
  169. fi