1 Summary: bash-completion offers programmable completion for bash
2 Summary(pl): Programowalne uzupe³nianie nazw dla basha
7 Group: Applications/Shells
8 Source0: http://www.caliban.org/files/bash/%{name}-%{version}.tar.bz2
9 # Source0-md5: ed95a89f57357a42b8e4eb95487bf9d0
10 Source1: %{name}-poldek.sh
11 Patch0: %{name}-FHS.patch
12 Patch1: %{name}-rpm-arch.patch
13 URL: http://www.caliban.org/bash/
14 Requires(triggerpostun): sed >= 4.0
15 Requires: bash >= 2.05a-3
16 Obsoletes: bash-completion-rpm-cache
18 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21 bash-completion is a collection of shell functions that take advantage
22 of the programmable completion feature of bash 2.04 and later.
25 bash-completion jest kolekcj± funkcji shella, które opieraj± siê na
26 wbudowanych rozszerzeniach basha 2.04 lub pó¼niejszego umo¿liwiaj±cego
27 kompletowanie parametrów linii poleceñ.
30 %setup -q -n bash_completion
34 cat <<'EOF' > %{name}.sh
36 [ -z "$BASH_VERSION" ] && return
38 # must be interactive shell, not script
39 [[ $- = *i* ]] || return
41 # check for correct version of bash
42 bash=${BASH_VERSION%%.*}; bmajor=${bash%%.*}; bminor=${bash#*.}
43 if [ "$bmajor" -eq 2 -a "$bminor" '>' 04 ] || [ "$bmajor" -gt 2 ]; then
44 if [ "$PS1" ]; then # interactive shell
45 # Source completion code
46 . %{_sysconfdir}/bash_completion
49 unset bash bminor bmajor
53 rm -rf $RPM_BUILD_ROOT
54 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/bash_completion.d,/etc/shrc.d,/var/cache}
56 install bash_completion $RPM_BUILD_ROOT%{_sysconfdir}
57 install contrib/* $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
58 > $RPM_BUILD_ROOT/var/cache/rpmpkgs.txt
59 install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/poldek
60 install %{name}.sh $RPM_BUILD_ROOT/etc/shrc.d
63 rm -rf $RPM_BUILD_ROOT
66 if [ ! -f /var/cache/rpmpkgs.txt ]; then
67 touch /var/cache/rpmpkgs.txt
68 chown root:wheel /var/cache/rpmpkgs.txt
69 chmod 664 /var/cache/rpmpkgs.txt
71 # rpm binary check for vservers
72 if [ -x /bin/rpm ]; then
74 rpm -qa --qf '%%{name}-%%{version}-%%{release}.%%{arch}.rpm\n' 2>&1 | sort > /var/cache/rpmpkgs.txt
78 %triggerpostun -- %{name} < 20050721-3.9
79 sed -i -e '/^# START bash completion/,/^# END bash completion/d' /etc/bashrc
80 chown root:wheel /var/cache/rpmpkgs.txt
81 chmod 664 /var/cache/rpmpkgs.txt
84 %defattr(644,root,root,755)
85 %doc README Changelog BUGS
86 %{_sysconfdir}/bash_completion
87 %{_sysconfdir}/bash_completion.d
88 %attr(755,root,root) /etc/shrc.d/%{name}.sh
89 %ghost %attr(664,root,wheel) /var/cache/rpmpkgs.txt