Skip to content

Commit 3924dbf

Browse files
authored
Fix: Makefile.am: add python wheel target and .spec Recommends bash-completion (#1792)
Makefile.am: - add target to build Python wheel - fix an error when install tests - fix uninstall-local target with Python3 pip uninstall - install bash-completion crmsh.spec.in: - Recommends bash-completion
2 parents b3ef1be + 3f53d6e commit 3924dbf

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

Makefile.am

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,33 +55,40 @@ install-data-hook:
5555
mkdir -p $(DESTDIR)$(datadir)/@PACKAGE@/; \
5656
for d in $$(cat data-manifest); do \
5757
install -D -m $$(test -x $$d && echo 0755 || echo 0644) $$d $(DESTDIR)$(datadir)/@PACKAGE@/$$d; done; \
58+
rm -rf $(DESTDIR)$(datadir)/@PACKAGE@/tests; \
5859
mv $(DESTDIR)$(datadir)/@PACKAGE@/test $(DESTDIR)$(datadir)/@PACKAGE@/tests; \
5960
cp test/testcases/xmlonly.sh $(DESTDIR)$(datadir)/@PACKAGE@/tests/testcases/configbasic-xml.filter
61+
mkdir -p $(DESTDIR)$(datadir)/bash-completion/completions/; \
62+
$(INSTALL) -D -m 0755 contrib/bash_completion.sh $(DESTDIR)$(datadir)/bash-completion/completions/crm; \
6063
if [ -d $(DESTDIR)$(firewalld_servicedir) ]; then \
6164
install -D -m 0644 $(srcdir)/$(firewalld_service_DATA) $(DESTDIR)$(firewalld_servicedir)/$(firewalld_service_DATA); \
6265
fi
6366

64-
# Python module installation
65-
all-local:
67+
# Build Python wheel
68+
$(builddir)/dist/crmsh-$(VERSION)-py3-none-any.whl $(builddir)/build:
6669
cd $(srcdir); python3 -m build --outdir $(shell readlink -f $(builddir))/dist --wheel --sdist --verbose
6770

71+
all-local: $(builddir)/dist/crmsh-$(VERSION)-py3-none-any.whl $(builddir)/build
72+
6873
python_prefix = --prefix=$(prefix)
6974

75+
# Python module installation
7076
install-exec-local:
71-
$(INSTALL) -d -m 770 $(DESTDIR)/${localstatedir}/log/crmsh
77+
$(INSTALL) -d -m 770 $(DESTDIR)${localstatedir}/log/crmsh
7278
python3 -m pip install --prefix=$(prefix) $(shell readlink -f $(builddir))/dist/*.whl
7379
$(INSTALL) -d -m 770 $(DESTDIR)$(CRM_CACHE_DIR)
7480

7581
uninstall-local:
7682
rm -rf $(crmconfdir)
7783
rm -rf $(docdir)
7884
rm -rf $(DESTDIR)$(CRM_CACHE_DIR)
79-
rm -rf $(DESTDIR)/${localstatedir}/log/crmsh
80-
rm -rf $(DESTDIR)$(pkgpythondir)
85+
python3 -m pip uninstall --yes @PACKAGE@
86+
rm -rf $(DESTDIR)${localstatedir}/log/crmsh
8187

8288
uninstall-hook:
8389
@echo "Removing installed data files..."
8490
rm -rf $(DESTDIR)$(datadir)/@PACKAGE@
91+
rm -f $(DESTDIR)$(datadir)/bash-completion/completions/crm
8592
rm -f $(DESTDIR)$(firewalld_servicedir)/$(firewalld_service_DATA)
8693
@echo "Uninstallation complete."
8794

crmsh.spec.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Requires: python3 >= 3.10
5959
Requires: python3-PyYAML
6060
Requires: python3-lxml
6161
Requires: python3-packaging
62+
Recommends: bash-completion
6263
BuildRequires: python3-lxml
6364
BuildRequires: python3-setuptools
6465
BuildRequires: python3-pip

0 commit comments

Comments
 (0)