]> git.pld-linux.org Git - packages/bash-completion.git/blob - bash-completion.spec
- -rpm-cache subpackage
[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:        1.1
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 Group:          Applications/Shells
34
35 %description rpm-cache
36 This package contains cached version of rpm -qa, which is used for rpm
37 completion for faster completion.
38
39 %prep
40 %setup -q -n bash_completion
41 %patch0 -p1
42
43 %install
44 rm -rf $RPM_BUILD_ROOT
45 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/bash_completion.d,/etc/cron.daily,/var/cache}
46
47 install bash_completion $RPM_BUILD_ROOT%{_sysconfdir}
48 install contrib/*       $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
49
50 install %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.daily/rpmpkgs
51 > $RPM_BUILD_ROOT/var/cache/rpmpkgs.txt
52
53 # subversion comes with much better completion file
54 rm $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/subversion
55
56 %clean
57 rm -rf $RPM_BUILD_ROOT
58
59 %post
60 if ! grep -q '\[ -f '%{_sysconfdir}'/bash_completion \]' \
61         %{_sysconfdir}/bashrc 2>/dev/null; then
62                 umask 022
63                 cat <<'EOF' >> %{_sysconfdir}/bashrc
64 # START bash completion -- do not remove this line
65 bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
66 if [ "$bmajor" -eq 2 -a "$bminor" '>' 04 ] || [ "$bmajor" -gt 2 ]; then
67         if [ "$PS1" ] && [ -f %{_sysconfdir}/bash_completion ]; then # interactive shell
68                 # Source completion code
69                 . %{_sysconfdir}/bash_completion
70         fi
71 fi
72 unset bash bmajor bminor
73 # END bash completion -- do not remove this line
74 EOF
75 fi
76
77 %postun
78 if [ "$1" -eq 0 ]; then
79         umask 022
80         sed -e '/^# START bash completion/,/^# END bash completion/d' /etc/bashrc \
81                 > /etc/bashrc.tmp
82         mv -f /etc/bashrc.tmp /etc/bashrc
83 fi
84
85 %files
86 %defattr(644,root,root,755)
87 %doc README Changelog BUGS
88 %{_sysconfdir}/bash_completion
89 %{_sysconfdir}/bash_completion.d/
90
91 %files rpm-cache
92 %attr(755,root,root) /etc/cron.daily/*
93 %ghost /var/cache/rpmpkgs.txt
This page took 0.027125 seconds and 3 git commands to generate.