diff --git a/Makefile.in b/Makefile.in index 8beb314d3..73e876f4d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,5 +1,6 @@ # Extract the version string from nmap.h. export NMAP_VERSION := $(shell grep '^\#[ \t]*define[ \t]\+NMAP_VERSION' nmap.h | sed -e 's/.*"\(.*\)".*/\1/' -e 'q') +export NMAP_UPDATE_CHANNEL := $(shell grep '^\#[ \t]*define[ \t]\+NMAP_UPDATE_CHANNEL' nmap.h | sed -e 's/.*"\(.*\)".*/\1/' -e 'q') NMAP_NAME= Nmap NMAP_URL= http://nmap.org NMAP_PLATFORM=@host@ @@ -151,6 +152,7 @@ lua_build: $(LIBLUADIR)/Makefile liblinear_build: $(LIBLINEARDIR)/Makefile @echo Compiling liblinear; cd $(LIBLINEARDIR) && $(MAKE) liblinear.a CC="$(CC)" CXX="$(CXX)" CFLAGS="$(CFLAGS)" +build-nmap-update: nmap-update/default_channel.h #$(LIBPCAPDIR)/Makefile: # @echo Configuring libpcap; cd $(LIBPCAPDIR); ./configure @@ -285,6 +287,10 @@ $(NPINGDIR)/nping.h: nmap.h $(ZENMAPDIR)/zenmapCore/Version.py $(ZENMAPDIR)/share/zenmap/config/zenmap_version: nmap.h cd $(ZENMAPDIR) && $(PYTHON) install_scripts/utils/version_update.py "$(NMAP_VERSION)" +nmap-update/default_channel.h: nmap.h + sed -e 's/^#[ \t]*define[ \t]\+DEFAULT_CHANNEL[ \t]\+\(".*"\)/#define DEFAULT_CHANNEL "$(NMAP_UPDATE_CHANNEL)"/' $@ > $@.tmp + mv -f $@.tmp $@ + # 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 diff --git a/nmap-update/default_channel.h b/nmap-update/default_channel.h new file mode 100644 index 000000000..89632f001 --- /dev/null +++ b/nmap-update/default_channel.h @@ -0,0 +1 @@ +#define DEFAULT_CHANNEL "5.61TEST2" diff --git a/nmap-update/nmap-update.c b/nmap-update/nmap-update.c index 9112ead8a..5aeab1bf2 100644 --- a/nmap-update/nmap-update.c +++ b/nmap-update/nmap-update.c @@ -37,7 +37,7 @@ #include #endif -#define NMAP_VERSION "5.61TEST2" +#include "default_channel.h" #ifdef WIN32 #define PATHSEP "\\" @@ -48,7 +48,7 @@ static const char *SVN_REPO = "https://svn.nmap.org"; static const char *SVN_DIR = "/updates"; -static const char *DEFAULT_CHANNELS[] = { NMAP_VERSION }; +static const char *DEFAULT_CHANNELS[] = { DEFAULT_CHANNEL }; /* Internal error handling. */ @@ -658,7 +658,7 @@ static void usage(FILE *fp) fprintf(fp, "\ Usage: %s [-d INSTALL_DIR] [CHANNEL...]\n\ Updates system-independent Nmap files. By default the new files are installed to\n\ -%s. Each CHANNEL is a version number like \"" NMAP_VERSION "\".\n\ +%s. Each CHANNEL is a version number like \"" DEFAULT_CHANNEL "\".\n\ \n\ -d DIR install files to DIR (default %s).\n\ -h, --help show this help.\n\