-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbash-completion.spec
More file actions
110 lines (93 loc) · 3.3 KB
/
bash-completion.spec
File metadata and controls
110 lines (93 loc) · 3.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
%define _python_bytecompile_errors_terminate_build 0
%undefine _debugsource_packages
Summary: Programmable completion for bash
Name: bash-completion
Epoch: 2
Version: 2.16.0
Release: 2
Group: Shells
License: GPLv2
Url: https://github.com/scop/bash-completion/releases
Source0: https://github.com/scop/bash-completion/releases/download/%{version}/%{name}-%{version}.tar.xz
# libarchive tar is better than gtar in many ways -- among other things
# its ability to un"tar" zip files, iso files and more. Let's teach
# bash-completions what our tar can do.
Patch11: bash-completion-2.10-tar-libarchive-extras.patch
BuildArch: noarch
BuildSystem: autotools
%description
bash-completion is a collection of shell functions that take advantage of
the programmable completion feature of bash.
%package devel
Summary: Development files for for %{name}
Group: Development/Other
Requires: %{name} = %{EVRD}
Conflicts: %{name} < 2:2.1-7
%description devel
Development files and headers files for %{name}.
%install -a
chmod 644 %{buildroot}%{_datadir}/bash-completion/bash_completion
# (tpg) remove files which are in upstream packages
rm -f %{buildroot}%{_datadir}/bash-completion/completions/{nmcli,chsh,su,cal,dmesg,eject,hexdump,ionice,look,mount,umount,renice,hwclock,rtcwake,rfkill,secret-tool}
# adapt installation
rm -f %{buildroot}%{_sysconfdir}/profile.d/bash_completion.sh
mkdir -p %{buildroot}%{_sysconfdir}/profile.d/
cat <<'EOF' >> %{buildroot}%{_sysconfdir}/profile.d/20bash-completion.sh
# Check for interactive bash and that we haven't already been sourced.
if [ -z "$BASH_VERSION" ] || [ -z "$PS1" ] || [ -n "$BASH_COMPLETION_COMPAT_DIR" ]; then
return
fi
# source system wide config file
. %{_sysconfdir}/sysconfig/bash-completion
# source user config file if available,
if [ -f $HOME/.bash_completion ]; then
. $HOME/.bash_completion
fi
if [ -n "$ENABLE_BASH_COMPLETION" ]; then
. %{_datadir}/bash-completion/bash_completion
fi
EOF
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
cat <<'EOF' >> %{buildroot}%{_sysconfdir}/sysconfig/bash-completion
# bash completion global configuration
# enable bash completion
ENABLE_BASH_COMPLETION=1
# enable remote cvs completion
COMP_CVS_REMOTE=
# enable configure arguments completion
COMP_CONFIGURE_HINTS=
# enable tar archive internal path completion
COMP_TAR_INTERNAL_PATHS=
# enable wireless uid completion
COMP_IWLIST_SCAN=
# enable zeroconf hostnames completion
COMP_KNOWN_HOSTS_WITH_AVAHI=
# enable hostfile hostnames completion
COMP_KNOWN_HOSTS_WITH_HOSTFILE=1
EOF
mkdir -p %{buildroot}%{_sysconfdir}/skel
cat <<'EOF' >> %{buildroot}%{_sysconfdir}/skel/.bash_completion
# bash completion local configuration
# enable bash completion
#ENABLE_BASH_COMPLETION=1
# enable remote cvs completion
#COMP_CVS_REMOTE=
# enable configure arguments completion
#COMP_CONFIGURE_HINTS=
# enable tar archive internal path completion
#COMP_TAR_INTERNAL_PATHS=
# enable wireless uid completion
#COMP_IWCONFIG_SCAN=
# enable zeroconf hostnames completion
#COMP_AVAHI_BROWSE=
EOF
%files
%doc README*
%{_sysconfdir}/profile.d/20bash-completion.sh
%{_sysconfdir}/bash_completion.d
%{_datadir}/bash-completion
%config(noreplace) %{_sysconfdir}/sysconfig/bash-completion
%config(noreplace) %{_sysconfdir}/skel/.bash_completion
%files devel
%{_datadir}/pkgconfig/bash-completion.pc
%{_datadir}/cmake/bash-completion/*.cmake