bash.spec 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. ##
  2. ## bash.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package version
  26. %define V_base_real 3.0
  27. %define V_base_comp 30
  28. %define V_plvl_raw 15
  29. %define V_plvl_pad 015
  30. # package information
  31. Name: bash
  32. Summary: Bourne-Again Shell
  33. URL: http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html
  34. Vendor: Free Software Foundation
  35. Packager: The OpenPKG Project
  36. Distribution: OpenPKG
  37. Class: CORE
  38. Group: Shell
  39. License: GPL
  40. Version: %{V_base_real}.%{V_plvl_raw}
  41. Release: 20041101
  42. # list of sources
  43. Source0: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}.tar.gz
  44. Source1: profile
  45. Patch0: bash.patch
  46. Patch1: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-001
  47. Patch2: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-002
  48. Patch3: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-003
  49. Patch4: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-004
  50. Patch5: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-005
  51. Patch6: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-006
  52. Patch7: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-007
  53. Patch8: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-008
  54. Patch9: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-009
  55. Patch10: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-010
  56. Patch11: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-011
  57. Patch12: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-012
  58. Patch13: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-013
  59. Patch14: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-014
  60. Patch15: ftp://ftp.cwru.edu/pub/bash/bash-%{V_base_real}-patches/bash%{V_base_comp}-015
  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
  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. %build
  94. # configure package
  95. ( # force disabled wide-character support
  96. echo "ac_cv_header_wchar_h=no"
  97. echo "ac_cv_header_wctype_h=no"
  98. echo "ac_cv_func_mbsrtowcs=no"
  99. # force disabled internationalization support
  100. echo "ac_cv_header_libintl_h=no"
  101. echo "ac_cv_func_gettext=no"
  102. echo "ac_cv_func_textdomain=no"
  103. echo "ac_cv_func_bindtextdomain=no"
  104. echo "ac_cv_lib_intl_bindtextdomain=no"
  105. ) >config.cache
  106. CC="%{l_cc}" \
  107. CFLAGS="%{l_cflags -O}" \
  108. ./configure \
  109. --cache-file=./config.cache \
  110. --prefix=%{l_prefix} \
  111. --disable-multibyte \
  112. --enable-debugger \
  113. --without-gnu-malloc \
  114. --without-curses \
  115. --disable-nls
  116. %{l_shtool} subst \
  117. -e 's;^\(#define.*SYS_PROFILE["^]*\).*;\1 "%{l_prefix}/etc/bash/profile";' \
  118. pathnames.h
  119. %{l_shtool} subst \
  120. -e 's;/etc/profile;%{l_prefix}/etc/bash/profile;' \
  121. doc/bash.1
  122. # build package
  123. %{l_make} %{l_mflags}
  124. %install
  125. # install package
  126. rm -rf $RPM_BUILD_ROOT
  127. %{l_make} %{l_mflags} install \
  128. prefix=$RPM_BUILD_ROOT%{l_prefix}
  129. # strip down installation
  130. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  131. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/bashbug.1
  132. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/bashbug
  133. strip $RPM_BUILD_ROOT%{l_prefix}/bin/bash
  134. # install global configuration
  135. %{l_shtool} mkdir -f -p -m 755 \
  136. $RPM_BUILD_ROOT%{l_prefix}/etc/bash
  137. %{l_shtool} install -c -m 644 %{l_value -s -a} \
  138. %{SOURCE profile} $RPM_BUILD_ROOT%{l_prefix}/etc/bash/
  139. # determine installation files
  140. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  141. %{l_files_std} \
  142. '%config %{l_prefix}/etc/bash/profile'
  143. %files -f files
  144. %clean
  145. rm -rf $RPM_BUILD_ROOT
  146. %post
  147. if [ ".$1" = .1 ]; then
  148. # display note about login shell prerequisite
  149. if [ -f /etc/shells ]; then
  150. if [ ".`grep $RPM_INSTALL_PREFIX/bin/bash /etc/shells`" = . ]; then
  151. ( echo "Hint: To use $RPM_INSTALL_PREFIX/bin/bash as the login"
  152. echo "shell for users, please add this path to /etc/shells."
  153. ) | %{l_rpmtool} msg -b -t notice
  154. fi
  155. fi
  156. fi