bash.spec 5.4 KB

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