]> git.pld-linux.org Git - packages/bash-completion.git/blob - bash-completion.spec
- updated to 20021223
[packages/bash-completion.git] / bash-completion.spec
1 Summary:        bash-completion offers programmable completion for bash
2 Summary(pl):    Programowalne uzupe³nianie nazw dla basha
3 Name:           bash-completion
4 Version:        20021223
5 Release:        1
6 License:        GPL
7 Group:          Applications/Shells
8 Source0:        http://www.caliban.org/files/bash/%{name}-%{version}.tar.bz2
9 URL:            http://www.caliban.org/bash/
10 Requires(post): grep
11 Requires(postun):       sed
12 BuildArch:      noarch
13 Requires:       bash >= 2.05a-3
14 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
15
16 %description
17 bash-completion is a collection of shell functions that take advantage
18 of the programmable completion feature of bash 2.04 and later.
19
20 %description -l pl
21 bash-completion jest kolekcj± funkcji shella, które opieraj± siê na
22 wbudowanych rozszerzeniach basha 2.04 lub pó¼niejszego umo¿liwiaj±cego
23 kompletowanie parametrów linii poleceñ.
24
25 %prep
26 %setup -q -n bash_completion
27
28 %install
29 rm -rf $RPM_BUILD_ROOT
30 install -d $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
31
32 install bash_completion $RPM_BUILD_ROOT%{_sysconfdir}
33
34
35 %clean
36 rm -rf $RPM_BUILD_ROOT
37
38 %post
39 if ! grep -q '\[ -f '%{_sysconfdir}'/bash_completion \]' \
40         %{_sysconfdir}/bashrc 2>/dev/null; then
41                 cat <<'EOF' >> %{_sysconfdir}/bashrc
42 # START bash completion -- do not remove this line
43 bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
44 if [ "$PS1" ] && [ "$bmajor" -eq 2 ] && [ "$bminor" '>' 04 ] \
45         && [ -f %{_sysconfdir}/bash_completion ]; then  # interactive shell
46         # Source completion code
47         . %{_sysconfdir}/bash_completion
48 fi
49 unset bash bmajor bminor
50 # END bash completion -- do not remove this line
51 EOF
52 fi
53
54 %postun
55 if [ "$1" -eq 0 ]; then
56         sed -e '/^# START bash completion/,/^# END bash completion/d' /etc/bashrc \
57                 > /etc/bashrc.tmp
58         mv -f /etc/bashrc.tmp /etc/bashrc
59 fi
60 chmod 644 /etc/bashrc
61
62 %files
63 %defattr(644,root,root,755)
64 %doc README Changelog contrib
65 %{_sysconfdir}/bash_completion
66 %dir %{_sysconfdir}/bash_completion.d/
This page took 0.068024 seconds and 3 git commands to generate.