From nobody Sat May 4 17:44:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1516182070565355.2403682336359; Wed, 17 Jan 2018 01:41:10 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 70D00356EB; Wed, 17 Jan 2018 09:41:03 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 740EF7C758; Wed, 17 Jan 2018 09:41:02 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7F36A18033D9; Wed, 17 Jan 2018 09:40:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w0H9eOgn022558 for ; Wed, 17 Jan 2018 04:40:24 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3FCA86EE78; Wed, 17 Jan 2018 09:40:23 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id BB0826EE76 for ; Wed, 17 Jan 2018 09:40:20 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Wed, 17 Jan 2018 10:40:19 +0100 Message-Id: <148e8fe9d3ca688b5c4361ae541474651f691bf9.1516181998.git.phrdina@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] spec: enable bash completion only on new enough distros X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 17 Jan 2018 09:41:04 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" RHEL-6 doesn't have bash-completion package by default, it has to be installed from EPEL. Signed-off-by: Pavel Hrdina Reviewed-by: Daniel P. Berrange --- libvirt.spec.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index d4ef116b2d..ef96888d09 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -87,6 +87,7 @@ %define with_libssh2 0%{!?_without_libssh2:0} %define with_wireshark 0%{!?_without_wireshark:0} %define with_libssh 0%{!?_without_libssh:0} +%define with_bash_completion 0%{!?_without_bash_completion:0} %define with_pm_utils 1 =20 # Finally set the OS / architecture specific special cases @@ -190,6 +191,11 @@ %define with_libssh 0%{!?_without_libssh:1} %endif =20 +# Enable bash-completion for new enough distros +%if 0%{?fedora} || 0%{?rhel} >=3D 7 + %define with_bash_completion 0%{!?_without_bash_completion:1} +%endif + =20 %if %{with_qemu} || %{with_lxc} || %{with_uml} # numad is used to manage the CPU and memory placement dynamically, @@ -306,7 +312,9 @@ BuildRequires: xen-devel BuildRequires: libxml2-devel BuildRequires: libxslt BuildRequires: readline-devel +%if %{with_bash_completion} BuildRequires: bash-completion >=3D 2.0 +%endif BuildRequires: ncurses-devel BuildRequires: gettext BuildRequires: libtasn1-devel @@ -2048,7 +2056,9 @@ exit 0 %{_datadir}/systemtap/tapset/libvirt_qemu_probes*.stp %{_datadir}/systemtap/tapset/libvirt_functions.stp =20 +%if %{with_bash_completion} %{_datadir}/bash-completion/completions/vsh +%endif =20 =20 %if %{with_systemd} --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list