bash.spec 6.8 KB

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