bash.spec 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. ##
  2. ## bash.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2001 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2001 Ralf S. Engelschall <rse@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 information
  25. Name: bash
  26. Summary: Bourne-Again Shell
  27. URL: http://www.gnu.org/software/bash/
  28. Vendor: Free Software Foundation
  29. Packager: The OpenPKG Project
  30. Distribution: OpenPKG [EXP]
  31. Group: Shell
  32. License: GPL
  33. Version: 2.05
  34. Release: %{l_branch}.0
  35. # list of sources
  36. Source0: ftp://ftp.gnu.org/gnu/bash/bash-%{version}.tar.gz
  37. Source1: profile
  38. Patch0: bash-%{version}.patch.1
  39. Patch1: bash-%{version}.patch.2
  40. # build information
  41. Prefix: %{l_prefix}
  42. BuildRoot: %{l_buildroot}
  43. BuildPreReq: OpenPKG, openpkg >= 20011023.0
  44. PreReq: OpenPKG, openpkg >= 20011023.0
  45. AutoReq: no
  46. AutoReqProv: no
  47. %description
  48. Bash (Bourne-Again Shell) is an sh-compatible command language interpreter
  49. that executes commands read from the standard input or from a file. Bash
  50. also incorporates useful features from the Korn and C shells (ksh and csh).
  51. Bash is intended to be a conformant implementation of the IEEE POSIX Shell
  52. and Tools specification (IEEE Working Group 1003.2).
  53. %prep
  54. %setup -q
  55. %patch0 -p0
  56. %patch1 -p0
  57. %build
  58. CC="%{l_cc}" \
  59. CFLAGS="%{l_cflags -O}" \
  60. ./configure \
  61. --prefix=%{l_prefix}
  62. %{l_rpmtool} subst \
  63. 's;^\(#define.*SYS_PROFILE["^]*\).*;\1 "%{l_prefix}/etc/bash/profile";' \
  64. -- pathnames.h
  65. %{l_rpmtool} subst \
  66. 's;/etc/profile;%{l_prefix}/etc/bash/profile;' \
  67. -- doc/bash.1
  68. %{l_make} %{l_mflags -O}
  69. %install
  70. rm -rf $RPM_BUILD_ROOT
  71. %{l_make} %{l_mflags} install prefix=$RPM_BUILD_ROOT%{l_prefix}
  72. rm -f $RPM_BUILD_ROOT%{l_prefix}/info/dir
  73. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/bashbug.1
  74. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/bashbug
  75. strip $RPM_BUILD_ROOT%{l_prefix}/bin/bash
  76. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/bash
  77. %{l_shtool} install -c -m 644 -e "s;@l_prefix@;%{l_prefix};g" \
  78. %{SOURCE profile} $RPM_BUILD_ROOT%{l_prefix}/etc/bash/
  79. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  80. %{l_files_std} \
  81. '%config %{l_prefix}/etc/bash/profile'
  82. %files -f files
  83. %clean
  84. rm -rf $RPM_BUILD_ROOT
  85. %post
  86. if [ ".$1" = .1 -a -w /etc/shells ]; then
  87. cp -p /etc/shells /tmp/shells
  88. grep -v "$RPM_INSTALL_PREFIX/bin/bash" </tmp/shells >/etc/shells
  89. echo "$RPM_INSTALL_PREFIX/bin/bash" >>/etc/shells
  90. rm -f /tmp/shells
  91. fi
  92. %postun
  93. if [ ".$1" = .0 -a -w /etc/shells ]; then
  94. cp -p /etc/shells /tmp/shells
  95. grep -v "$RPM_INSTALL_PREFIX/bin/bash" </tmp/shells >/etc/shells
  96. rm -f /tmp/shells
  97. fi