]> git.pld-linux.org Git - packages/bash-completion.git/blob - bash-completion.spec
fdd5ffc3958dbfc7b9474bee0061201a0299cdf6
[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:        20040704
5 Release:        1
6 License:        GPL
7 Group:          Applications/Shells
8 Source0:        http://www.caliban.org/files/bash/%{name}-%{version}.tar.bz2
9 # Source0-md5:  1a0991f4ff892ed6fed1c6cf39ee7022
10 URL:            http://www.caliban.org/bash/
11 Requires(post,preun):   bash
12 Requires(post): grep
13 Requires(post): textutils
14 Requires(postun):       fileutils
15 Requires(postun):       sed
16 BuildArch:      noarch
17 Requires:       bash >= 2.05a-3
18 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
19
20 %description
21 bash-completion is a collection of shell functions that take advantage
22 of the programmable completion feature of bash 2.04 and later.
23
24 %description -l pl
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ñ.
28
29 %prep
30 %setup -q -n bash_completion
31
32 %install
33 rm -rf $RPM_BUILD_ROOT
34 install -d $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
35
36 install bash_completion $RPM_BUILD_ROOT%{_sysconfdir}
37 install contrib/*       $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
38
39 %clean
40 rm -rf $RPM_BUILD_ROOT
41
42 %post
43 if ! grep -q '\[ -f '%{_sysconfdir}'/bash_completion \]' \
44         %{_sysconfdir}/bashrc 2>/dev/null; then
45                 umask 022
46                 cat <<'EOF' >> %{_sysconfdir}/bashrc
47 # START bash completion -- do not remove this line
48 bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
49 if [ "$PS1" ] && [ "$bmajor" -eq 2 ] && [ "$bminor" '>' 04 ] \
50         && [ -f %{_sysconfdir}/bash_completion ]; then  # interactive shell
51         # Source completion code
52         . %{_sysconfdir}/bash_completion
53 fi
54 unset bash bmajor bminor
55 # END bash completion -- do not remove this line
56 EOF
57 fi
58
59 %postun
60 if [ "$1" -eq 0 ]; then
61         umask 022
62         sed -e '/^# START bash completion/,/^# END bash completion/d' /etc/bashrc \
63                 > /etc/bashrc.tmp
64         mv -f /etc/bashrc.tmp /etc/bashrc
65 fi
66
67 %files
68 %defattr(644,root,root,755)
69 %doc README Changelog BUGS
70 %{_sysconfdir}/bash_completion
71 %{_sysconfdir}/bash_completion.d/
This page took 0.081015 seconds and 2 git commands to generate.