bash.spec 3.7 KB

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