1 | %define patchleveltag .0
|
---|
2 | %define baseversion 3.2
|
---|
3 |
|
---|
4 | Summary: The GNU Bourne Again shell
|
---|
5 | Name: bash
|
---|
6 | Version: %{baseversion}%{patchleveltag}
|
---|
7 | Release: 1
|
---|
8 | License: BSD
|
---|
9 | Group: System Environment/Shells
|
---|
10 | Source: bash.zip
|
---|
11 | #Source: ftp://ftp.debian.org/debian/dists/woody/main/source/shells/%{name}_%{version}.orig.tar.gz
|
---|
12 | #Patch0: ftp://ftp.debian.org/debian/dists/woody/main/source/shells/%{name}_%{version}-38.diff.gz
|
---|
13 | #Patch2: ash-0.3.8-tempfile.patch
|
---|
14 | #Patch1: ash-0.3.8-build.patch
|
---|
15 | #Patch3: ash-0.3.8-mannewline.patch
|
---|
16 | #Patch4: ash-0.3.8-segv.patch
|
---|
17 | #Prereq: fileutils grep
|
---|
18 | #BuildPrereq: pmake >= 1.45 byacc
|
---|
19 | #Buildroot: %{_tmppath}/%{name}-%{version}-root
|
---|
20 | #Conflicts: mkinitrd <= 1.7
|
---|
21 |
|
---|
22 | %description
|
---|
23 | The GNU Bourne Again shell (Bash) is a shell or command language
|
---|
24 | interpreter that is compatible with the Bourne shell (sh). Bash
|
---|
25 | incorporates useful features from the Korn shell (ksh) and the C shell
|
---|
26 | (csh). Most sh scripts can be run by bash without modification.
|
---|
27 |
|
---|
28 | %prep
|
---|
29 | %setup -q -n bash-%{version}
|
---|
30 | #%patch0 -p1 -b .linux
|
---|
31 | #%patch2 -p1 -b .tempfile
|
---|
32 | #%ifarch alpha
|
---|
33 | #%patch1 -p1 -b .alpha
|
---|
34 | #%endif
|
---|
35 | #%patch3 -p1
|
---|
36 | #%patch4 -p0 -b .segv
|
---|
37 | #chmod -R a+rX .
|
---|
38 |
|
---|
39 | %build
|
---|
40 | #chmod u+x debian/bsdyacc
|
---|
41 | #pmake CFLAGS="-g ${RPM_OPT_FLAGS} \
|
---|
42 | # -DBSD=1 -DSMALL -D_GNU_SOURCE \
|
---|
43 | # -DGLOB_BROKEN -D__COPYRIGHT\(x\)= \
|
---|
44 | # -D__RCSID\(x\)= -D_DIAGASSERT\(x\)=" \
|
---|
45 | # YACC=`pwd`/debian/bsdyacc
|
---|
46 | #mv sh sh.dynamic
|
---|
47 | #
|
---|
48 | #pmake CFLAGS="-g ${RPM_OPT_FLAGS} \
|
---|
49 | # -DBSD=1 -DSMALL -D_GNU_SOURCE \
|
---|
50 | # -DGLOB_BROKEN -D__COPYRIGHT\(x\)= \
|
---|
51 | # -D__RCSID\(x\)= -D_DIAGASSERT\(x\)=" \
|
---|
52 | # YACC=`pwd`/debian/bsdyacc LDFLAGS="-static"
|
---|
53 | #mv sh sh.static
|
---|
54 |
|
---|
55 |
|
---|
56 | %install
|
---|
57 | rm -rf %{buildroot}
|
---|
58 | mkdir -p %{buildroot}/bin
|
---|
59 | mkdir -p %{buildroot}/usr/bin
|
---|
60 |
|
---|
61 | cp usr/bin/bash.exe %{buildroot}/usr/bin/bash.exe
|
---|
62 | cp usr/bin/bash.exe %{buildroot}/bin/bash
|
---|
63 | #cp usr/bin/bash.exe %{buildroot}/bin/sh
|
---|
64 |
|
---|
65 | #%post
|
---|
66 | #if [ ! -f /etc/shells ]; then
|
---|
67 | # echo "/bin/ash" > /etc/shells
|
---|
68 | # echo "/bin/bsh" >> /etc/shells
|
---|
69 | #else
|
---|
70 | # if ! grep '^/bin/ash$' /etc/shells > /dev/null; then
|
---|
71 | # echo "/bin/ash" >> /etc/shells
|
---|
72 | # fi
|
---|
73 | # if ! grep '^/bin/bsh$' /etc/shells > /dev/null; then
|
---|
74 | # echo "/bin/bsh" >> /etc/shells
|
---|
75 | # fi
|
---|
76 | #fi
|
---|
77 |
|
---|
78 | #%postun
|
---|
79 | #if [ "$1" = "0" ]; then
|
---|
80 | # grep -v '^/bin/ash' < /etc/shells | grep -v '^/bin/bsh' > /etc/shells.new
|
---|
81 | # mv /etc/shells.new /etc/shells
|
---|
82 | #fi
|
---|
83 |
|
---|
84 | %verifyscript
|
---|
85 | #
|
---|
86 | #for n in ash bsh; do
|
---|
87 | # echo -n "Looking for $n in /etc/shells... "
|
---|
88 | # if ! grep "^/bin/${n}\$" /etc/shells > /dev/null; then
|
---|
89 | # echo "missing"
|
---|
90 | # echo "${n} missing from /etc/shells" >&2
|
---|
91 | # else
|
---|
92 | # echo "found"
|
---|
93 | # fi
|
---|
94 | #done
|
---|
95 |
|
---|
96 | %clean
|
---|
97 | rm -rf %{buildroot}
|
---|
98 |
|
---|
99 | %files
|
---|
100 | %defattr(-,root,root)
|
---|
101 | /bin/bash
|
---|
102 | /usr/bin/bash.exe
|
---|
103 | #/bin/bsh
|
---|
104 | #%{_mandir}/man1/*
|
---|