pkgdata_DATA =
sbin_SCRIPTS =
scripts_SCRIPTS =
+completion_SCRIPTS =
scripts_DATA =
SUFFIXES =
check_DATA =
pkgconfig_DATA =
scriptsdir = $(pkgdatadir)/scripts
+completiondir = $(sysconfdir)/bash_completion.d
pkgconfigdir = $(libdir)/pkgconfig
# This ensures that files added to EXTRA_DIST are always distributed,
+etc/bash_completion.d/ovs-appctl-bashcomp.bash
usr/bin/ovs-appctl
usr/bin/ovs-benchmark
usr/bin/ovs-docker
+etc/bash_completion.d/ovs-vsctl-bashcomp.bash
usr/bin/ovs-dpctl
usr/bin/ovs-dpctl-top
usr/bin/ovs-pcap
%files
%defattr(-,root,root)
+/etc/bash_completion.d/ovs-appctl-bashcomp.bash
+/etc/bash_completion.d/ovs-vsctl-bashcomp.bash
/etc/init.d/openvswitch
%config(noreplace) /etc/logrotate.d/openvswitch
/etc/sysconfig/network-scripts/ifup-ovs
utilities/ovs-save
scripts_DATA += utilities/ovs-lib
+completion_SCRIPTS += \
+ utilities/ovs-appctl-bashcomp.bash \
+ utilities/ovs-vsctl-bashcomp.bash
+
check_SCRIPTS += \
utilities/ovs-appctl-bashcomp.bash \
utilities/ovs-vsctl-bashcomp.bash
How to use:
-----------
- To use the scripts, either copy them inside /etc/bash_completion.d/ or
- manually run it directly in bash via . ovs-appctl-bashcomp.bash or
- . ovs-vsctl-bashcomp.bash.
+ The bashcomp scripts should be placed at /etc/bash_completion.d/
+ to be available for all bash sessions. Running 'make install'
+ will place the scripts to $(sysconfdir)/bash_completion.d/. So user
+ should specify --sysconfdir=/etc at configuration. Meanwhile, if OVS is
+ installed from packages, the scripts will automatically be placed inside
+ /etc/bash_completion.d/.
+
+ If you just want to run the scripts in one bash, you can remove them from
+ /etc/bash_completion.d/ and run the scripts via '. ovs-appctl-bashcomp.bash'
+ or '. ovs-vsctl-bashcomp.bash'.
Test:
-----
%files
%defattr(-,root,root)
+/etc/bash_completion.d/ovs-appctl-bashcomp.bash
+/etc/bash_completion.d/ovs-vsctl-bashcomp.bash
/etc/init.d/openvswitch
/etc/init.d/openvswitch-xapi-update
/etc/xapi.d/plugins/openvswitch-cfg-update