-
Notifications
You must be signed in to change notification settings - Fork 371
Testing pull requests by TomSellers
If you are looking to build Nmap from GitHub and/or test pull requests you can use the instructions below. Note that they are not tailored towards those who will be modifying the code or creating pull requests themselves.
Note: The Nmap GitHub repository is a mirror of the official Nmap Subversion repository which is considered the 'source of truth' for the Nmap codebase.
Getting the code
- Clone the official repository
git clone [email protected]:nmap/nmap.git
- Change to the nmap directory
cd nmap
- Configure git to pull down PR information when you fetch a branch listing for the Nmap repo by adding the following line to the 'remote "origin"' section of .git/config:
fetch = +refs/pull//head:refs/remotes/origin/pr/
It should look something like this:
[remote "origin"] url = [email protected]:nmap/nmap.git fetch = +refs/heads/:refs/remotes/origin/ fetch = +refs/pull//head:refs/remotes/origin/pr/
- Update your branch listing
git fetch --all
- Check out the pull request you are interested in: git checkout origin/pr/<PR_number> git checkout origin/pr/977
Building the code
- Install any build dependencies. On Ubuntu I use the following:
sudo apt-get install build-essential autoconf libssl-dev
- To build nmap make sure you are in the top level nmap source directory and run the following:
./configure --without-zenmap make clean sudo make install
- As a matter of precaution I generally insruct Nmap to rebuild the script database after a fresh build/installation.
sudo nmap --script-updatedb
As a general reference for building Nmap from the official Subversion repository I created instructions at the link below. This page includes a variation of the script that I use to enure I have a clean environment as well as to copy any custom scripts that I might be working on.