]> git.pld-linux.org Git - packages/bash-completion.git/blob - bash-completion.spec
- updated to 20041017
[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:        20041017
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:  3fd0836127d01606a9dc4262f3e2e1fb
10 # Source0-size: 86227
11 URL:            http://www.caliban.org/bash/
12 Requires(post,preun):   bash
13 Requires(post): grep
14 Requires(post): textutils
15 Requires(postun):       fileutils
16 Requires(postun):       sed
17 BuildArch:      noarch
18 Requires:       bash >= 2.05a-3
19 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
20
21 %description
22 bash-completion is a collection of shell functions that take advantage
23 of the programmable completion feature of bash 2.04 and later.
24
25 %description -l pl
26 bash-completion jest kolekcj± funkcji shella, które opieraj± siê na
27 wbudowanych rozszerzeniach basha 2.04 lub pó¼niejszego umo¿liwiaj±cego
28 kompletowanie parametrów linii poleceñ.
29
30 %prep
31 %setup -q -n bash_completion
32
33 %install
34 rm -rf $RPM_BUILD_ROOT
35 install -d $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
36
37 install bash_completion $RPM_BUILD_ROOT%{_sysconfdir}
38 install contrib/*       $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
39
40 # subversion comes with much better completion file
41 rm $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/subversion
42
43 %clean
44 rm -rf $RPM_BUILD_ROOT
45
46 %post
47 if ! grep -q '\[ -f '%{_sysconfdir}'/bash_completion \]' \
48         %{_sysconfdir}/bashrc 2>/dev/null; then
49                 umask 022
50                 cat <<'EOF' >> %{_sysconfdir}/bashrc
51 # START bash completion -- do not remove this line
52 bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
53 if [ "$bmajor" -eq 2 -a "$bminor" '>' 04 ] || [ "$bmajor" -gt 2 ]; then
54         if [ "$PS1" ] && [ -f %{_sysconfdir}/bash_completion ]; then # interactive shell
55                 # Source completion code
56                 . %{_sysconfdir}/bash_completion
57         fi
58 fi
59 unset bash bmajor bminor
60 # END bash completion -- do not remove this line
61 EOF
62 fi
63
64 %postun
65 if [ "$1" -eq 0 ]; then
66         umask 022
67         sed -e '/^# START bash completion/,/^# END bash completion/d' /etc/bashrc \
68                 > /etc/bashrc.tmp
69         mv -f /etc/bashrc.tmp /etc/bashrc
70 fi
71
72 %files
73 %defattr(644,root,root,755)
74 %doc README Changelog BUGS
75 %{_sysconfdir}/bash_completion
76 %{_sysconfdir}/bash_completion.d/
This page took 0.056135 seconds and 3 git commands to generate.