Skip to content

Fix: Makefile.am: add python wheel target and .spec Recommends bash-completion #1792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -55,33 +55,40 @@ install-data-hook:
mkdir -p $(DESTDIR)$(datadir)/@PACKAGE@/; \
for d in $$(cat data-manifest); do \
install -D -m $$(test -x $$d && echo 0755 || echo 0644) $$d $(DESTDIR)$(datadir)/@PACKAGE@/$$d; done; \
rm -rf $(DESTDIR)$(datadir)/@PACKAGE@/tests; \
mv $(DESTDIR)$(datadir)/@PACKAGE@/test $(DESTDIR)$(datadir)/@PACKAGE@/tests; \
cp test/testcases/xmlonly.sh $(DESTDIR)$(datadir)/@PACKAGE@/tests/testcases/configbasic-xml.filter
mkdir -p $(DESTDIR)$(datadir)/bash-completion/completions/; \
$(INSTALL) -D -m 0755 contrib/bash_completion.sh $(DESTDIR)$(datadir)/bash-completion/completions/crm; \
if [ -d $(DESTDIR)$(firewalld_servicedir) ]; then \
install -D -m 0644 $(srcdir)/$(firewalld_service_DATA) $(DESTDIR)$(firewalld_servicedir)/$(firewalld_service_DATA); \
fi

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

all-local: $(builddir)/dist/crmsh-$(VERSION)-py3-none-any.whl $(builddir)/build

python_prefix = --prefix=$(prefix)

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

uninstall-local:
rm -rf $(crmconfdir)
rm -rf $(docdir)
rm -rf $(DESTDIR)$(CRM_CACHE_DIR)
rm -rf $(DESTDIR)/${localstatedir}/log/crmsh
rm -rf $(DESTDIR)$(pkgpythondir)
python3 -m pip uninstall --yes @PACKAGE@
rm -rf $(DESTDIR)${localstatedir}/log/crmsh

uninstall-hook:
@echo "Removing installed data files..."
rm -rf $(DESTDIR)$(datadir)/@PACKAGE@
rm -f $(DESTDIR)$(datadir)/bash-completion/completions/crm
rm -f $(DESTDIR)$(firewalld_servicedir)/$(firewalld_service_DATA)
@echo "Uninstallation complete."

Expand Down
1 change: 1 addition & 0 deletions crmsh.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Requires: python3 >= 3.10
Requires: python3-PyYAML
Requires: python3-lxml
Requires: python3-packaging
Recommends: bash-completion
BuildRequires: python3-lxml
BuildRequires: python3-setuptools
BuildRequires: python3-pip
Expand Down