]> git.pld-linux.org Git - packages/bash-completion.git/blob - bash-completion.spec
2432305972a2da55ca342e1d2bfacf3af3968416
[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:        20050721
5 Release:        3.1
6 License:        GPL
7 Group:          Applications/Shells
8 Source0:        http://www.caliban.org/files/bash/%{name}-%{version}.tar.bz2
9 # Source0-md5:  4de9f0dee0663f08b5e24f64490e642e
10 Source1:        %{name}.cron
11 Source2:        %{name}-poldek.sh
12 Patch0:         %{name}-FHS.patch
13 Patch1:         %{name}-ifcfg.patch
14 Patch2:         %{name}-known_hosts.patch
15 URL:            http://www.caliban.org/bash/
16 Requires(triggerpostun):        sed >= 4.0
17 Requires:       bash >= 2.05a-3
18 BuildArch:      noarch
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 %package rpm-cache
31 Summary:        Cache result of rpm -qa
32 Summary(pl):    Buforowanie wyniku 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 %description rpm-cache -l pl
40 Ten pakiet zawiera skrypt buforuj±cy wynik rpm -qa w celu szybszego
41 dope³niania linii poleceñ programu rpm.
42
43 %prep
44 %setup -q -n bash_completion
45 %patch0 -p1
46 %patch1 -p2
47 %patch2 -p1
48
49 %install
50 rm -rf $RPM_BUILD_ROOT
51 install -d $RPM_BUILD_ROOT{%{_sysconfdir}/bash_completion.d,/etc/cron.daily,/etc/shrc.d,/var/cache}
52
53 install bash_completion $RPM_BUILD_ROOT%{_sysconfdir}
54 install contrib/*       $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
55
56 install %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.daily/rpmpkgs
57 > $RPM_BUILD_ROOT/var/cache/rpmpkgs.txt
58
59 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/poldek
60 # subversion comes with much better completion file
61 rm $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/subversion
62
63 cat <<'EOF' > %{name}.sh
64 # check for bash
65 [ -z "$BASH_VERSION" ] && return
66
67 # must be interactive shell, not script
68 [[ $- = *i* ]] || return
69
70 # check for correct version of bash
71 bash=${BASH_VERSION%%.*}; bmajor=${bash%%.*}; bminor=${bash#*.}
72 if [ "$bmajor" -eq 2 -a "$bminor" '>' 04 ] || [ "$bmajor" -gt 2 ]; then
73         if [ "$PS1" ]; then # interactive shell
74                 # Source completion code
75                 . %{_sysconfdir}/bash_completion
76         fi
77 fi
78 unset bash bminor bmajor
79 EOF
80
81 install %{name}.sh $RPM_BUILD_ROOT/etc/shrc.d
82
83 %clean
84 rm -rf $RPM_BUILD_ROOT
85
86 %triggerpostun -- %{name} < 20050112-1
87 # legacy clean-up
88 sed -i -e '/^# START bash completion/,/^# END bash completion/d' /etc/bashrc
89
90 %files
91 %defattr(644,root,root,755)
92 %doc README Changelog BUGS
93 %{_sysconfdir}/bash_completion
94 %{_sysconfdir}/bash_completion.d
95 %attr(755,root,root) /etc/shrc.d/%{name}.sh
96
97 %files rpm-cache
98 %defattr(644,root,root,755)
99 %attr(755,root,root) /etc/cron.daily/*
100 %ghost /var/cache/rpmpkgs.txt
This page took 0.044465 seconds and 3 git commands to generate.