]> git.pld-linux.org Git - packages/bash-completion.git/blob - bash-completion.spec
- upgarde and fix changelog
[packages/bash-completion.git] / bash-completion.spec
1 %define bashversion 2.05a
2 Name:           bash-completion
3 Summary:        bash-completion offers programmable completion for bash %{bashversion}
4 Version:        20020402
5 Release:        1
6 Group:          Applications/Shells
7 License:        GPL
8 Source0:        http://www.caliban.org/files/bash/%{name}-%{version}.tar.bz2
9 URL:            http://www.caliban.org/bash/
10 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
11 BuildArch:      noarch
12 Requires:       bash >= %{bashversion}-3
13 Requires(post): grep
14 Requires(postun):       sed
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. To use
19 this collection, you ideally need bash 2.05a or later.
20
21 %description -l pl
22 bash-completion jest kolekcj± funkcji shella, które opieraj± siê na
23 wbudowanych rozszerzeniach basha 2.04 lub pó¼niejszego. Aby u¿ywac tej
24 kolekcji, potrzebujesz basha 2.05a lub pó¼niejszego.
25
26 %prep
27 %setup -q -n bash_completion
28
29 %install
30 rm -rf $RPM_BUILD_ROOT
31 install -d $RPM_BUILD_ROOT%{_sysconfdir}
32 install bash_completion $RPM_BUILD_ROOT%{_sysconfdir}
33 install -d $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
34
35 gzip -9nf README Changelog
36 %clean
37 rm -rf $RPM_BUILD_ROOT
38
39 %post
40 if ! grep -q '\[ -f '%{_sysconfdir}'/bash_completion \]' \
41      %{_sysconfdir}/bashrc 2>/dev/null; then
42     cat <<'EOF' >> %{_sysconfdir}/bashrc
43 # START bash completion -- do not remove this line
44 bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
45 if [ "$PS1" ] && [ $bmajor -eq 2 ] && [ $bminor '>' 04 ] \
46    && [ -f %{_sysconfdir}/bash_completion ]; then       # interactive shell
47         # Source completion code
48         . %{_sysconfdir}/bash_completion
49 fi
50 unset bash bmajor bminor
51 # END bash completion -- do not remove this line
52 EOF
53 fi
54
55 %postun
56 if [ "$1" -eq 0 ]; then
57     sed -e '/^# START bash completion/,/^# END bash completion/d' /etc/bashrc \
58         > /etc/bashrc.tmp
59     mv -f /etc/bashrc.tmp /etc/bashrc
60 fi
61
62
63 %files
64 %defattr(644,root,root,755)
65 %{_sysconfdir}/bash_completion
66 %dir %{_sysconfdir}/bash_completion.d/
67 %doc *.gz  contrib/
This page took 0.099325 seconds and 4 git commands to generate.