-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbash-completion.spec
More file actions
124 lines (103 loc) · 3.68 KB
/
bash-completion.spec
File metadata and controls
124 lines (103 loc) · 3.68 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
%define _python_bytecompile_errors_terminate_build 0
Summary: Programmable completion for bash
Name: bash-completion
Epoch: 2
Version: 2.11
Release: 3
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
# ~/.bash_completion is used for completion variables setting, it has
# to be sourced from profile scriptlet instead of completion code itself
Patch10: bash-completion-1.99-disable-user-completion.patch
# 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
Patch13: bash-completion-2.1-fix-readline-quoting.patch
BuildArch: noarch
%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}.
%prep
%autosetup -p1
%build
%configure
%make_build
%install
%make_install
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}
# 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
%triggerpostun -- bash-completion < 2:1.90-3
# drop dangling symlinks resulting from previous setup
find %{_sysconfdir}/bash_completion.d -type l | xargs rm -f
%files
%doc README*
%{_sysconfdir}/profile.d/20bash-completion.sh
%{_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