bash.spec 3.7 KB

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