bash.spec 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. ##
  2. ## bash.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package version
  24. %define V_base_real 3.2
  25. %define V_base_comp 32
  26. %define V_plvl_raw 33
  27. %define V_plvl_pad 033
  28. # package information
  29. Name: bash
  30. Summary: Bourne-Again Shell
  31. URL: http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html
  32. Vendor: Free Software Foundation
  33. Packager: OpenPKG Foundation e.V.
  34. Distribution: OpenPKG Community
  35. Class: CORE
  36. Group: Shell
  37. License: GPL
  38. Version: %{V_base_real}.%{V_plvl_raw}
  39. Release: 20080328
  40. # list of sources
  41. Source0: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}.tar.gz
  42. Source1: profile
  43. Patch0: bash.patch
  44. Patch1: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-001
  45. Patch2: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-002
  46. Patch3: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-003
  47. Patch4: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-004
  48. Patch5: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-005
  49. Patch6: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-006
  50. Patch7: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-007
  51. Patch8: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-008
  52. Patch9: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-009
  53. Patch10: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-010
  54. Patch11: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-011
  55. Patch12: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-012
  56. Patch13: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-013
  57. Patch14: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-014
  58. Patch15: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-015
  59. Patch16: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-016
  60. Patch17: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-017
  61. Patch18: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-018
  62. Patch19: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-019
  63. Patch20: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-020
  64. Patch21: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-021
  65. Patch22: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-022
  66. Patch23: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-023
  67. Patch24: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-024
  68. Patch25: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-025
  69. Patch26: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-026
  70. Patch27: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-027
  71. Patch28: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-028
  72. Patch29: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-029
  73. Patch30: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-030
  74. Patch31: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-031
  75. Patch32: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-032
  76. Patch33: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-033
  77. # build information
  78. Prefix: %{l_prefix}
  79. BuildRoot: %{l_buildroot}
  80. BuildPreReq: OpenPKG, openpkg >= 20040130
  81. PreReq: OpenPKG, openpkg >= 20040130
  82. AutoReq: no
  83. AutoReqProv: no
  84. %description
  85. Bash (Bourne-Again Shell) is an sh-compatible command language
  86. interpreter that executes commands read from the standard input or
  87. from a file. Bash also incorporates useful features from the Korn
  88. and C shells (ksh and csh). Bash is intended to be a conformant
  89. implementation of the IEEE POSIX Shell and Tools specification (IEEE
  90. Working Group 1003.2).
  91. %track
  92. prog bash = {
  93. version = %{V_base_real}
  94. url = ftp://ftp.cwru.edu/pub/bash/
  95. regex = bash-(__VER__)\.tar\.gz
  96. }
  97. prog bash:patches = {
  98. version = %{V_base_comp}-%{V_plvl_pad}
  99. url = ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/
  100. regex = bash(\S+-\d+)
  101. }
  102. %prep
  103. # unpack and patch distribution
  104. %setup -q -n bash-%{V_base_real}
  105. %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 26 27 28 29 30 31 32 33
  106. sleep 1
  107. touch y.tab.[ch]
  108. touch configure config.h.in
  109. # brand with OpenPKG release and fix patchlevel
  110. %{l_shtool} subst \
  111. -e 's;@l_openpkg_release@;%{l_openpkg_release};' \
  112. version.c
  113. %build
  114. # configure package
  115. ( # force disabled wide-character support
  116. echo "ac_cv_header_wchar_h=no"
  117. echo "ac_cv_header_wctype_h=no"
  118. echo "ac_cv_func_mbsrtowcs=no"
  119. # force disabled internationalization support
  120. echo "ac_cv_header_libintl_h=no"
  121. echo "ac_cv_func_gettext=no"
  122. echo "ac_cv_func_textdomain=no"
  123. echo "ac_cv_func_bindtextdomain=no"
  124. echo "ac_cv_lib_intl_bindtextdomain=no"
  125. ) >config.cache
  126. CC="%{l_cc}" \
  127. CFLAGS="%{l_cflags -O}" \
  128. ./configure \
  129. --cache-file=./config.cache \
  130. --prefix=%{l_prefix} \
  131. --disable-multibyte \
  132. --enable-debugger \
  133. --without-gnu-malloc \
  134. --without-curses \
  135. --disable-nls
  136. %{l_shtool} subst \
  137. -e 's;^\(#define.*SYS_PROFILE["^]*\).*;\1 "%{l_prefix}/etc/bash/profile";' \
  138. pathnames.h
  139. %{l_shtool} subst \
  140. -e 's;/etc/profile;%{l_prefix}/etc/bash/profile;' \
  141. doc/bash.1
  142. # build package
  143. %{l_make} %{l_mflags}
  144. %install
  145. # install package
  146. rm -rf $RPM_BUILD_ROOT
  147. %{l_make} %{l_mflags} install \
  148. prefix=$RPM_BUILD_ROOT%{l_prefix}
  149. # strip down installation
  150. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  151. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/bashbug.1
  152. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/bashbug
  153. strip $RPM_BUILD_ROOT%{l_prefix}/bin/bash || true
  154. # install global configuration
  155. %{l_shtool} mkdir -f -p -m 755 \
  156. $RPM_BUILD_ROOT%{l_prefix}/etc/bash
  157. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  158. %{SOURCE profile} $RPM_BUILD_ROOT%{l_prefix}/etc/bash/
  159. # determine installation files
  160. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  161. %{l_files_std} \
  162. '%config %{l_prefix}/etc/bash/profile'
  163. %files -f files
  164. %clean
  165. rm -rf $RPM_BUILD_ROOT
  166. %post
  167. if [ ".$1" = .1 ]; then
  168. # display note about login shell prerequisite
  169. if [ -f /etc/shells ]; then
  170. if [ ".`grep $RPM_INSTALL_PREFIX/bin/bash /etc/shells`" = . ]; then
  171. ( echo "Hint: To use $RPM_INSTALL_PREFIX/bin/bash as the login"
  172. echo "shell for users, please add this path to /etc/shells."
  173. ) | %{l_rpmtool} msg -b -t notice
  174. fi
  175. fi
  176. fi