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