]> git.pld-linux.org Git - packages/bash-completion.git/blob - bash-completion.spec
- added
[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:        20050103
5 Release:        2
6 License:        GPL
7 Group:          Applications/Shells
8 Source0:        http://www.caliban.org/files/bash/%{name}-%{version}.tar.bz2
9 # Source0-md5:  0ee7009b18ff862f8a63c2395e5fd100
10 Source1:        %{name}.cron
11 Patch0:         %{name}-FHS.patch
12 URL:            http://www.caliban.org/bash/
13 Requires(post,preun):   bash
14 Requires(post): grep
15 Requires(post): textutils
16 Requires(postun):       fileutils
17 Requires(postun):       sed
18 BuildArch:      noarch
19 Requires:       bash >= 2.05a-3
20 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21
22 %description
23 bash-completion is a collection of shell functions that take advantage
24 of the programmable completion feature of bash 2.04 and later.
25
26 %description -l pl
27 bash-completion jest kolekcj± funkcji shella, które opieraj± siê na
28 wbudowanych rozszerzeniach basha 2.04 lub pó¼niejszego umo¿liwiaj±cego
29 kompletowanie parametrów linii poleceñ.
30
31 %package rpm-cache
32 Summary:        Cache result of rpm -qa
33 Summary(pl):    Buforowanie wyniku rpm -qa
34 Group:          Applications/Shells
35
36 %description rpm-cache
37 This package contains cached version of rpm -qa, which is used for rpm
38 completion for faster completion.
39
40 %description rpm-cache -l pl
41 Ten pakiet zawiera skrypt buforuj±cy wynik rpm -qa w celu szybszego
42 dope³niania linii poleceñ programu rpm.
43
44 %prep
45 %setup -q -n bash_completion
46 %patch0 -p1
47
48 %install
49 rm -rf $RPM_BUILD_ROOT
50 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/bash_completion.d,/etc/cron.daily,/var/cache}
51
52 install bash_completion $RPM_BUILD_ROOT%{_sysconfdir}
53 install contrib/*       $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
54
55 install %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.daily/rpmpkgs
56 > $RPM_BUILD_ROOT/var/cache/rpmpkgs.txt
57
58 # subversion comes with much better completion file
59 rm $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/subversion
60
61 %clean
62 rm -rf $RPM_BUILD_ROOT
63
64 %post
65 if ! grep -q '\[ -f '%{_sysconfdir}'/bash_completion \]' \
66         %{_sysconfdir}/bashrc 2>/dev/null; then
67                 umask 022
68                 cat <<'EOF' >> %{_sysconfdir}/bashrc
69 # START bash completion -- do not remove this line
70 bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
71 if [ "$bmajor" -eq 2 -a "$bminor" '>' 04 ] || [ "$bmajor" -gt 2 ]; then
72         if [ "$PS1" ] && [ -f %{_sysconfdir}/bash_completion ]; then # interactive shell
73                 # Source completion code
74                 . %{_sysconfdir}/bash_completion
75         fi
76 fi
77 unset bash bmajor bminor
78 # END bash completion -- do not remove this line
79 EOF
80 fi
81
82 %postun
83 if [ "$1" -eq 0 ]; then
84         umask 022
85         sed -e '/^# START bash completion/,/^# END bash completion/d' /etc/bashrc \
86                 > /etc/bashrc.tmp
87         mv -f /etc/bashrc.tmp /etc/bashrc
88 fi
89
90 %files
91 %defattr(644,root,root,755)
92 %doc README Changelog BUGS
93 %{_sysconfdir}/bash_completion
94 %{_sysconfdir}/bash_completion.d/
95
96 %files rpm-cache
97 %attr(755,root,root) /etc/cron.daily/*
98 %ghost /var/cache/rpmpkgs.txt
This page took 0.077848 seconds and 3 git commands to generate.