]> git.pld-linux.org Git - packages/bash-completion.git/blob - bash-completion.spec
75912b75d641969a20a449587faf25e06c8ce378
[packages/bash-completion.git] / bash-completion.spec
1 %define bashversion 2.05a
2 Summary:        bash-completion offers programmable completion for bash %{bashversion}
3 Summary(pl):    Programowalne uzupe³nianie nazw dla basha %{bashversion}
4 Name:           bash-completion
5 Version:        20020413
6 Release:        1
7 Group:          Applications/Shells
8 License:        GPL
9 Source0:        http://www.caliban.org/files/bash/%{name}-%{version}.tar.bz2
10 URL:            http://www.caliban.org/bash/
11 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
12 BuildArch:      noarch
13 Requires:       bash >= %{bashversion}-3
14 Requires(post): grep
15 Requires(postun): sed
16
17 %description
18 bash-completion is a collection of shell functions that take advantage
19 of the programmable completion feature of bash 2.04 and later. To use
20 this collection, you ideally need bash 2.05a or later.
21
22 %description -l pl
23 bash-completion jest kolekcj± funkcji shella, które opieraj± siê na
24 wbudowanych rozszerzeniach basha 2.04 lub pó¼niejszego. Aby u¿ywaæ tej
25 kolekcji, potrzebujesz basha 2.05a lub pó¼niejszego.
26
27 %prep
28 %setup -q -n bash_completion
29
30 %install
31 rm -rf $RPM_BUILD_ROOT
32 install -d $RPM_BUILD_ROOT%{_sysconfdir}
33 install bash_completion $RPM_BUILD_ROOT%{_sysconfdir}
34 install -d $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
35
36 gzip -9nf README Changelog
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
64 %files
65 %defattr(644,root,root,755)
66 %{_sysconfdir}/bash_completion
67 %dir %{_sysconfdir}/bash_completion.d/
68 %doc *.gz  contrib/
This page took 0.046303 seconds and 2 git commands to generate.