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