Source Code

From MediaWiki
Revision as of 11:08, 30 October 2010 by Paul Blankenbaker (talk | contribs) (Created page with '= How Can I Get The Source? = Each time a Network Security Toolkit ISO is released, a ''tar.gz'' file containing the source code used to build it is also released. You can downl…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

How Can I Get The Source?

Each time a Network Security Toolkit ISO is released, a tar.gz file containing the source code used to build it is also released. You can download this from: http://sourceforge.net/projects/nst/files.

How Can I Get The Current Source?

The current Network Security Toolkit source code is kept in the trunk branch in a Subversion repository at SourceForge. The URL for the Network Security Toolkit project at SourceForge is http://sourceforge.net/projects/nst. You may browse the source code online at http://nst.svn.sourceforge.net/nst/.

You can checkout the current version of the source code with the following set of Subversion commands (just press the Enter key when prompted for a password):

tortilla-e:tmp pkb$ SVNROOT=https://nst.svn.sourceforge.net/svnroot/nst
tortilla-e:tmp pkb$ svn ls $SVNROOT
maintenance/
releases/
trunk/
tortilla-e:tmp pkb$ svn co $SVNROOT/trunk trunk

... long list of source files being downloaded from Subversion ...

tortilla-e:tmp pkb$ 

The above commands will check out the current source code into the trunk directory on your local system.

We are constantly updating the source files making up the NST. To bring your check out area up to date, use the following command:

tortilla-e:tmp pkb$ svn update trunk

... list of updated source files being downloaded from Subversion ...

tortilla-e:tmp pkb$ 

How Do I Checkout a Specific Version?

The trunk branch of the NST Subversion repository is used for maintaining the current release and/or working on the next release of the NST system. The releases branch contains snapshots of the source tree at the time of a release. The maintenance branch contains updates to releases which are based on older versions of Fedora (for example, the maintenance/2.11.0 branch contains the updates we did for the 2.11.0 release of the NST).

The following demonstrates how to check out the 2.13.0 releases branch:

tortilla-e:tmp pkb$ SVNROOT=https://nst.svn.sourceforge.net/svnroot/nst
tortilla-e:tmp pkb$ svn ls $SVNROOT/releases
2.13.0/
tortilla-e:tmp pkb$ svn co $SVNROOT/releases/2.13.0 2.13.0

... long list of source files being downloaded from Subversion ...

tortilla-e:tmp pkb$  

The following demonstrates how to check out the 2.11.0 maintenance branch:

tortilla-e:tmp pkb$ SVNROOT=https://nst.svn.sourceforge.net/svnroot/nst
tortilla-e:tmp pkb$ svn ls $SVNROOT/maintenance
2.11.0/
2.12.0/
tortilla-e:tmp pkb$ svn co $SVNROOT/releases/2.11.0 2.11.0

... long list of source files being downloaded from Subversion ...

tortilla-e:tmp pkb$ 

How Do I View Differences Across Branches?

The following demonstrates how to view the differences between the file "configure" in the trunk branch to the version of "configure" in the release/2.13.0 branch:

tortilla-e:tmp pkb$ SVNROOT=https://nst.svn.sourceforge.net/svnroot/nst
tortilla-e:tmp pkb$ svn diff $SVNROOT/trunk/configure $SVNROOT/releases/2.13.0/configure
Index: configure
===================================================================
--- configure	(.../trunk/configure)	(revision 1498)
+++ configure	(.../releases/2.13.0/configure)	(revision 1498)
@@ -718,23 +718,10 @@
 
 #
 # Translate RELEASE to corresponding CVS tag
-
-#
-# Try to get information from SVN information
-#
-
-# Default values if not using svn checkout
-SVNREVISION=0;
-SVNROOT="https://nst.svn.sourceforge.net/svnroot/nst";
-
-eval $( (cd "${SRCDIR}" && svn info 2>/dev/null) | awk -- '
-$1 == "URL:" { printf("SVNROOT=\"%s\"\n", $2); }
-$1 == "Revision:" { printf("SVNREVISION=\"%s\"\n", $2); }
-');
-
+SVNROOT="$(${DIRNAME} "$(${DIRNAME} "$(${SVN} info configure | ${AWK} -- '$1 == "URL:" { print $2; }')")")";
 SVNBRANCH="$(${BASENAME} ${SVNROOT})";
 SVNHOST="$(echo "${SVNROOT}" | ${SED} -e 's,https://\([^/]*\).*,\1,')";
-ENV_LIST="${ENV_LIST} SVNROOT SVNBRANCH SVNHOST SVNREVISION";
+ENV_LIST="${ENV_LIST} SVNROOT SVNBRANCH SVNHOST";
 
 #
 # If done as root, sudo isn't needed
@@ -1576,7 +1563,6 @@
 @define("svnHost","${SVNHOST}")
 @define("svnRoot","${SVNROOT}")
 @define("svnBranch","${SVNBRANCH}")
-@define("svnRevision","${SVNREVISION}")

 @define("nstRpmVersion","${NST_RPM_VERSION}")
 @define("nstRpmRelease","${NST_RPM_RELEASE}")
tortilla-e:tmp pkb$ 

How Do I Build The Network Security Toolkit From The Source?

Building the NST is a long process and will require a bit of determination. We have tried our best to make it a "./configure; make process, but getting your development system setup takes a bit of effort. For details on how to under take this adventure, refer to: "HowTo Build NST 2.13.0".

During the build of the NST many packages are downloaded from the Internet. It is a constant battle to keep our URLs and build scripts up to date. While the current source tree (the trunk branch) should always build, do not expect any of the older branches to build without some considerable effort on your part. Most of the older branches are not actively maintained. If you really want to build a older branch, be prepared to track down older versions of software packages and to make edits to the build scripts.