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