Convert pvc-client-cli into a proper Python module
Also fixes up the Debian packaging such that this works how I would want, with proper module installation while leaving everything else untouched. Finally implements automatic installation and removal of the BASH completion for the PVC command.
This commit is contained in:
3
debian/pvc-client-cli.install
vendored
3
debian/pvc-client-cli.install
vendored
@ -1,3 +0,0 @@
|
||||
client-cli/pvc.py usr/share/pvc
|
||||
client-cli/cli_lib usr/share/pvc
|
||||
client-cli/scripts usr/share/pvc
|
||||
|
6
debian/pvc-client-cli.postinst
vendored
6
debian/pvc-client-cli.postinst
vendored
@ -1,4 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Install client binary to /usr/bin via symlink
|
||||
ln -s /usr/share/pvc/pvc.py /usr/bin/pvc
|
||||
# Generate the bash completion configuration
|
||||
if [ -d /etc/bash_completion.d ]; then
|
||||
_PVC_COMPLETE=source_bash pvc > /etc/bash_completion.d/pvc
|
||||
fi
|
||||
|
6
debian/pvc-client-cli.prerm
vendored
6
debian/pvc-client-cli.prerm
vendored
@ -1,4 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Remove client binary symlink
|
||||
rm -f /usr/bin/pvc
|
||||
# Remove the bash completion
|
||||
if [ -f /etc/bash_completion.d/pvc ]; then
|
||||
rm -f /etc/bash_completion.d/pvc
|
||||
fi
|
||||
|
12
debian/rules
vendored
12
debian/rules
vendored
@ -1,13 +1,19 @@
|
||||
#!/usr/bin/make -f
|
||||
# See debhelper(7) (uncomment to enable)
|
||||
# output every command that modifies files on the build system.
|
||||
#export DH_VERBOSE = 1
|
||||
export DH_VERBOSE = 1
|
||||
|
||||
%:
|
||||
dh $@
|
||||
dh $@ --with python3
|
||||
|
||||
override_dh_python3:
|
||||
cd $(CURDIR)/client-cli; pybuild --system=distutils --dest-dir=../debian/pvc-client-cli/
|
||||
mkdir -p debian/pvc-client-cli/usr/lib/python3
|
||||
mv debian/pvc-client-cli/usr/lib/python3*/* debian/pvc-client-cli/usr/lib/python3/
|
||||
rm -r $(CURDIR)/client-cli/.pybuild $(CURDIR)/client-cli/pvc.egg-info
|
||||
|
||||
override_dh_auto_clean:
|
||||
find . -name "__pycache__" -exec rm -r {} \; || true
|
||||
find . -name "__pycache__" -o -name ".pybuild" -exec rm -r {} \; || true
|
||||
|
||||
# If you need to rebuild the Sphinx documentation
|
||||
# Add spinxdoc to the dh --with line
|
||||
|
Reference in New Issue
Block a user