mirror of
https://github.com/nmap/nmap.git
synced 2026-02-02 19:49:11 +00:00
Re-override distutils's overriding of the Python interpreter path to be
"/usr/bin/env python" when DESTDIR is defined. This keeps from hardcoding a specific interpreter location when building for installation on another machine.
This commit is contained in:
13
Makefile.in
13
Makefile.in
@@ -195,8 +195,19 @@ $(ZENMAPDIR)/setup.py:
|
||||
$(ZENMAPDIR)/umitCore/Version.py $(ZENMAPDIR)/share/zenmap/config/zenmap_version: nmap.h
|
||||
cd $(ZENMAPDIR) && $(PYTHON) install_scripts/utils/version_update.py "$(NMAP_VERSION)"
|
||||
|
||||
# By default distutils rewrites installed scripts to hardcode the
|
||||
# location of the Python interpreter they were built with (something
|
||||
# like #!/usr/bin/python2.4). This is the wrong thing to do when
|
||||
# installing on a machine other than the one used to do the build. Use
|
||||
# this as the location of the interpreter whenever we're not doing a
|
||||
# local installation.
|
||||
DEFAULT_PYTHON_PATH = /usr/bin/env python
|
||||
|
||||
build-zenmap: $(ZENMAPDIR)/setup.py $(ZENMAPDIR)/umitCore/Version.py
|
||||
cd $(ZENMAPDIR) && $(PYTHON) setup.py build
|
||||
# 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)")
|
||||
|
||||
install-zenmap: $(ZENMAPDIR)/setup.py
|
||||
cd $(ZENMAPDIR) && $(PYTHON) setup.py install --prefix "$(prefix)" $(if $(DESTDIR),--root "$(DESTDIR)")
|
||||
|
||||
@@ -44,7 +44,7 @@ from Umit, an Nmap GUI created as part of the Google Summer of Code.
|
||||
|
||||
%build
|
||||
%configure --without-openssl PYTHON="%{__python}"
|
||||
make build-zenmap
|
||||
make build-zenmap DESTDIR=$RPM_BUILD_ROOT
|
||||
|
||||
%install
|
||||
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
Reference in New Issue
Block a user