Method 3 - The Way of a [Peaceful] Ubuntu Warrior
Method 2 is based on building software packages in (almost) Debian way. We would try to do this with as little effort as possible, so the packages won't be Ubuntu-wise anyway, but we can call them Ubuntu-friendly ;-). If you want to learn how to produce a real Ubuntu package, check this links: "Howto make debian standard debs from scratch", "How to create a Debian Package" and "Create your own Debian/Ubuntu (*.deb) package". You may want to ask: why to build the packages?! Well, first they provide an easy way to check if you have the software installed or not. And it's much easier to upgrade them. More, the hardest and most time-consuming part needs to be done once, you will be able to use the files produced later for upgrades so lets begin.
You need to create a temporary directory for binary versions of the additional packages. Unfortunately you probably have to prepare the whole directory for all 3 packages.
$cd ~
$mkdir tmp_ns_inst
$cd tmp_ns_inst
$mkdir -p otcl-1.13/DEBIAN otcl-1.13/usr/local/bin otcl-1.13/usr/local/lib otcl-1.13/usr/local/include
$mkdir -p tclcl-1.19/DEBIAN tclcl-1.19/usr/local/bin tclcl-1.19/usr/local/lib tclcl-1.19/usr/local/include
$mkdir -p ns-2.33/DEBIAN ns-2.33/usr/local/bin ns-2.33/usr/local/lib ns-2.33/usr/local/include
Now it's building time - the whole process looks similar to the one presented in previous section, the only thing you need to do is to choose target directory for binaries. Well there is one more thing different - you need to perform all the steps for ns-2 in the last, separate stage. So let's go:
$cd
$autoconf
$./configure --prefix=~/tmp_ns_inst/otcl-1.13/usr/local
$make
$make install
$cd ..
$cd tclcl-1.19
$autoconf
$./configure --prefix=~/tmp_ns_inst/tclcl-1.19/usr/local
$make
$make install
Here comes the hard part. You need to create configuration files to pack the binaries into .deb packages which you want to install in the last step. At this stage we need to 2 files - one for otcl and one for tclcl. The files should be called 'control' and placed in the DEBIAN subdirectories of the binary folders (i.e. otcl/DEBIAN/control). The two listings below are 'my' proposals of the control files for otcl and tclcl respectively.
Package: otcl
Version: 1.13
Section: development
Priority: optional
Architecture: all
Essential: no
Depends: tcl8.4, tk8.4
Pre-Depends:
Recommends: tcl8.4-dev | tk8.4-dev | tclcl | otcl-dev
Suggests: tclcl
Installed-Size: 438
Maintainer: Your name here < email@some.host.com >
Conflicts:
Replaces:
Provides: otcl
Description: OTcl, short for MIT Object Tcl, is an extension to Tcl/Tk for object-oriented programming. Check http://bmrc.berkeley.edu/research/cmt/cmtdoc/otcl/ for more information.
Package: tclcl
Version: 1.19
Section: development
Priority: optional
Architecture: all
Essential: no
Depends: otcl
Pre-Depends: tcl8.4, tk8.4
Recommends: tcl8.4-dev | tk8.4-dev | tclcl-dev
Suggests:
Installed-Size: 438
Maintainer: Your name here < email@some.host.com >
Conflicts:
Replaces:
Provides: tclcl
Description: TclCL (Tcl with classes) is a Tcl/C++ interface used by Mash, vic, vat, rtp_play, ns, and nam. It provides a layer of C++ glue over OTcl.
Now you need to build the the packages.
$cd ~/tmp_ns_inst
$dpkg-deb --build otcl-1.13
$dpkg-deb --build tclcl-1.19
Now you are free to install them:
$sudo dpkg -i otcl-1.13.deb tclcl-1.19.deb
It's time for ns-2 now. Prepare the DEBIAN/control file for it...
Package: ns
Version: 2.33
Section: development
Priority: optional
Architecture: all
Essential: no
Depends: otcl tclcl
Pre-Depends: tcl8.4, tk8.4
Recommends: tcl8.4-dev | tk8.4-dev | tclcl-dev
Suggests: nam
Installed-Size: 438
Maintainer: Your name here < email@some.host.com >
Conflicts:
Replaces:
Provides: ns-2
Description: The Network Simulator - ns-2.
And perform all the necessary steps:
$cd
$cd ns-2.33
$autoconf
$./configure --prefix=~/tmp_ns_inst/ns-2.33/usr/local
$make
$make install
$cd ~/tmp_ns_inst
$dpkg-deb --build ns-2.33
Check the last paragraph of method 1. If you are sure you want a single system-wide ns-2 run:
$sudo dpkg -i ns-2.33.deb
Hope this helps.