diff --git a/Makefile.in b/Makefile.in index 681242a35..dee2729d2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -251,7 +251,6 @@ clean-liblinear: -cd $(LIBLINEARDIR) && $(MAKE) clean clean-zenmap: - -cd $(ZENMAPDIR) && $(PYTHON) setup.py clean --all rm -f $(ZENMAPDIR)/zenmapCore/__init__.pyc rm -f $(ZENMAPDIR)/zenmapCore/Version.pyc rm -f $(ZENMAPDIR)/zenmapCore/Name.pyc @@ -361,15 +360,12 @@ tests/%: tests/%.cc $(OBJS) # local installation. DEFAULT_PYTHON_PATH = /usr/bin/env python3 -build-zenmap: $(ZENMAPDIR)/setup.py $(ZENMAPDIR)/zenmapCore/Version.py -# When DESTDIR is defined, assume we're building an executable -# distribution rather than a local installation and force a generic -# Python interpreter location. - cd $(ZENMAPDIR) && $(PYTHON) setup.py build $(if $(DESTDIR),--executable "$(DEFAULT_PYTHON_PATH)") +build-zenmap: $(ZENMAPDIR)/pyproject.toml $(ZENMAPDIR)/zenmapCore/Version.py + $(PYTHON) -m build $(ZENMAPDIR) -install-zenmap: $(ZENMAPDIR)/setup.py +install-zenmap: $(ZENMAPDIR)/pyproject.toml $(INSTALL) -d $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 - cd $(ZENMAPDIR) && $(PYTHON) setup.py --quiet install --prefix "$(prefix)" --force $(if $(DESTDIR),--root "$(DESTDIR)") + $(PYTHON) -m pip install $(ZENMAPDIR) $(if $(DESTDIR),--root "$(DESTDIR)") $(INSTALL) -c -m 644 docs/zenmap.1 $(DESTDIR)$(mandir)/man1/ # Create a symlink from nmapfe to zenmap if nmapfe doesn't exist or is # already a link. @@ -426,7 +422,7 @@ uninstall-nmap: rm -rf $(DESTDIR)$(nmapdatadir) uninstall-zenmap: - cd $(ZENMAPDIR) && $(PYTHON) setup.py uninstall + $(PYTHON) -m pip uninstall $(ZENMAPDIR) rm -f $(DESTDIR)$(mandir)/man1/zenmap.1 # Uninstall nmapfe only if it's a symlink. if [ -L $(DESTDIR)$(bindir)/nmapfe ]; then \ diff --git a/macosx/Makefile b/macosx/Makefile index a9e732708..db8277f3d 100644 --- a/macosx/Makefile +++ b/macosx/Makefile @@ -72,7 +72,7 @@ $(IMAGE_NAME): tool-checks $(IMAGE_STAGING_DIR)/$(PKG_NAME) # Check the created disk image for the sizes, backgrounds and icons presence and positions ./check_test.sh $(README_FILE) $(LICENSE_FILE) $(3RD_P_LIC_FILE) $(LICENSES_FILE) -tool-checks: have-$(CC) have-jhbuild have-gtk-mac-bundler +tool-checks: have-jhbuild have-gtk-mac-bundler have-%: which $* diff --git a/zenmap/README b/zenmap/README index fc5bddf9b..da41e0606 100644 --- a/zenmap/README +++ b/zenmap/README @@ -47,7 +47,7 @@ Default (source) Installation Zenmap is packaged using Python setuptools. To install Zenmap independently of Nmap, enter the zenmap subdirectory and run - python setup.py install + python3 -m pip install . Links: diff --git a/zenmap/install_scripts/macosx/make-bundle.sh b/zenmap/install_scripts/macosx/make-bundle.sh index d866d603c..21a4b755e 100755 --- a/zenmap/install_scripts/macosx/make-bundle.sh +++ b/zenmap/install_scripts/macosx/make-bundle.sh @@ -25,7 +25,7 @@ $CC $CPPFLAGS $CFLAGS $LDFLAGS -L$PREFIX/lib `python3-config --cflags --ldflags ~/gtk-mac-bundler/examples/python-launcher.c echo "Installing Zenmap to local system" -python3 setup.py install vanilla --prefix "$PREFIX" +python3 -m pip install --ignore-installed --target "$PREFIX/lib/python-3.11/site-packages" . echo "Generating dependencies" # Have to run this with ~/gtk/inst/python3 or deps have wrong paths @@ -79,8 +79,7 @@ python -m compileall "$PYTHONLIB"/site-packages #|| true echo "Stripping unoptimized Python libraries" echo "Building using setuptools" -python3 setup.py build --executable "/usr/bin/env python3" -python3 setup.py install vanilla --prefix "$BASE/Resources" +python3 -m pip install --ignore-installed --target "$BASE/Resources/lib/python-3.11/site-packages" . echo "Renaming main Zenmap executable." mv $BASE/MacOS/$APP_NAME $BASE/MacOS/zenmap.bin diff --git a/zenmap/install_scripts/macosx/zenmap.bundle b/zenmap/install_scripts/macosx/zenmap.bundle index dff4c318b..08fff60f0 100644 --- a/zenmap/install_scripts/macosx/zenmap.bundle +++ b/zenmap/install_scripts/macosx/zenmap.bundle @@ -1,6 +1,6 @@ + ]> diff --git a/zenmap/install_scripts/windows/PKGBUILD b/zenmap/install_scripts/windows/PKGBUILD index 69a6eaf38..da3b87e00 100644 --- a/zenmap/install_scripts/windows/PKGBUILD +++ b/zenmap/install_scripts/windows/PKGBUILD @@ -25,8 +25,8 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools") package() { cd "${NMAP_DIR}/zenmap" - ${MINGW_PREFIX}/bin/python setup.py build + #${MINGW_PREFIX}/bin/python -m pip build MSYS2_ARG_CONV_EXCL="--prefix=" \ - ${MINGW_PREFIX}/bin/python setup.py install vanilla --prefix=${MINGW_PREFIX} --root="${pkgdir}" --optimize=1 + ${MINGW_PREFIX}/bin/python -m pip install --prefix=${MINGW_PREFIX} --root="${pkgdir}" --optimize=1 install -Dm644 install_scripts/unix/zenmap.desktop "${pkgdir}${MINGW_PREFIX}/share/applications/zenmap.desktop" }