]> git.pld-linux.org Git - packages/bash-completion.git/blame - bash-completion.spec
- new PLD spec
[packages/bash-completion.git] / bash-completion.spec
CommitLineData
aa677e2c 1%define bashversion 2.05a
2Name: bash-completion
3Summary: bash-completion offers programmable completion for bash %{bashversion}
4Version: 20020328
5Release: 1
6Group: System Environment/Shells
7License: GPL
8Source0: http://www.caliban.org/files/bash/%{name}-%{version}.tar.bz2
9URL: http://www.caliban.org/bash/
10BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
11BuildArch: noarch
12Requires: bash >= 2.05-7
13Requires(post): grep
14Requires(postun): sed
15
16%description
17bash-completion is a collection of shell functions that take advantage
18of the programmable completion feature of bash 2.04 and later.
19To use this collection, you ideally need bash 2.05a or later
20
21
22%prep
23%setup -q -n bash_completion
24
25%install
26rm -rf $RPM_BUILD_ROOT
27install -d $RPM_BUILD_ROOT%{_sysconfdir}
28install bash_completion $RPM_BUILD_ROOT%{_sysconfdir}
29install -d $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
30
31%clean
32rm -rf $RPM_BUILD_ROOT
33
34%post
35if ! grep -q '\[ -f '%{_sysconfdir}'/bash_completion \]' \
36 %{_sysconfdir}/bashrc 2>/dev/null; then
37 cat <<'EOF' >> %{_sysconfdir}/bashrc
38# START bash completion -- do not remove this line
39bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
40if [ "$PS1" ] && [ $bmajor -eq 2 ] && [ $bminor '>' 04 ] \
41 && [ -f %{_sysconfdir}/bash_completion ]; then # interactive shell
42 # Source completion code
43 . %{_sysconfdir}/bash_completion
44fi
45unset bash bmajor bminor
46# END bash completion -- do not remove this line
47EOF
48fi
49
50%postun
51if [ "$1" -eq 0 ]; then
52 sed -e '/^# START bash completion/,/^# END bash completion/d' /etc/bashrc \
53 > /etc/bashrc.tmp
54 mv -f /etc/bashrc.tmp /etc/bashrc
55fi
56
57%files
58%defattr(644,root,root,755)
59%{_sysconfdir}/bash_completion
60%dir %{_sysconfdir}/bash_completion.d/
61%doc README Changelog contrib/
This page took 0.070507 seconds and 4 git commands to generate.