Skip to content

Commit 772451b

Browse files
committed
Dev: Makefile: Use modern tools python build and pip instead of setup.py
to build and install the package.
1 parent 81da3f0 commit 772451b

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

Makefile.am

+4-11
Original file line numberDiff line numberDiff line change
@@ -57,27 +57,19 @@ install-data-hook:
5757

5858
# Python module installation
5959
all-local:
60-
(cd $(srcdir); $(PYTHON) setup.py build \
61-
--build-base $(shell readlink -f $(builddir))/build \
62-
--verbose)
60+
cd $(srcdir); python3 -m build --outdir $(shell readlink -f $(builddir))/dist --wheel --sdist --verbose
6361

6462
python_prefix = --prefix=$(prefix)
6563

6664
install-exec-local:
6765
$(INSTALL) -d -m 770 $(DESTDIR)/${localstatedir}/log/crmsh
68-
-mkdir -p $(DESTDIR)$(pkgpythondir)
69-
$(PYTHON) $(srcdir)/setup.py install \
70-
--root $(DESTDIR)/ \
71-
$(python_prefix) \
72-
--record $(DESTDIR)$(pkgpythondir)/install_files.txt \
73-
--verbose
66+
python3 -m pip install --prefix=$(prefix) $(shell readlink -f $(builddir))/dist/*.whl
7467
$(INSTALL) -d -m 770 $(DESTDIR)$(CRM_CACHE_DIR)
7568

7669
uninstall-local:
7770
rm -rf $(crmconfdir)
7871
rm -rf $(docdir)
7972
rm -rf $(DESTDIR)$(CRM_CACHE_DIR)
80-
cat $(DESTDIR)$(pkgpythondir)/install_files.txt 2>/dev/null | xargs -r -i rm -rf $(DESTDIR)/{}
8173
rm -rf $(DESTDIR)/${localstatedir}/log/crmsh
8274
rm -rf $(DESTDIR)$(pkgpythondir)
8375

@@ -88,7 +80,8 @@ uninstall-hook:
8880

8981
clean-local:
9082
@echo "Removing intermediate python build files..."
91-
(cd $(srcdir); $(PYTHON) setup.py clean --all)
83+
rm -rf $(builddir)/dist
84+
rm -rf $(builddir)/build
9285
@echo "Removing complete."
9386

9487
dist-clean-local: clean-local

0 commit comments

Comments
 (0)