Building From Source

From MediaWiki
Jump to navigationJump to search

Preparing The Build Machine

You will need to install Fedora Core 6 (the i386 variant) onto your development system.

If you want to build a 64 bit variant (x86_64) of the NST, you will need to download the x86_64 variant of Fedora Core 6. While the i386 variant will run on both 32 bit and 64 bit machines, the x86_64 variant will only run on 64 bit machines. Most, if not all, 64 bit AMD processors and the Intel Core 2 series should be compatible with the x86_64 variant.

If you don't want to use physical hardware, you can use a Virtual Machine (even running under Windows) to do your NST development under. We have found that either VMWare Server (our preference) or VMWare Player from VMware can be used (even if you want to build a x86_64 version of the NST). We have also found that Virtual PC can be used.

Getting the NST Source Code

There are several ways to acquire the source code for NST developement (one can find an entire section related to this in the NST FAQ).

For our purposes we will choose the anonymous CVS approach. This permits one to build a current snapshot of the NST distribution as it is being developed.

The following demonstrates how one can create a: nst sub-directory on a Fedora Core 6 based system, and then populate it with the current NST source code (NOTE: Just press the Enter key when prompted for the password as there is no password required for anonymous access):

Checking Out The Current Source Code
[root@localhost ~]# mkdir $HOME/nst
[root@localhost ~]# cd $HOME/nst
[root@localhost nst]# CVSROOT=":pserver:anonymous@nst.cvs.sourceforge.net:/cvsroot/nst"
[root@localhost nst]# export CVSROOT
[root@localhost nst]# cvs login
Logging in to :pserver:anonymous@nst.cvs.sourceforge.net:2401/cvsroot/nst
CVS password:
[root@localhost nst]# cvs co .

   ... You should see file names streaming by in your
       console window - it may take several moments to
       download all of the source files ...

[root@localhost nst]#

As time goes on, you may want to update your source files (the NST developers check in new code quite frequently). Use the following commands:

Updating The Source Code
[root@localhost ~]# cd $HOME/nst
[root@localhost nst]# CVSROOT=":pserver:anonymous@nst.cvs.sourceforge.net:/cvsroot/nst"
[root@localhost nst]# export CVSROOT
[root@localhost nst]# cvs update -Pd

   ... You should see directory names streaming by in your
       console window as CVS searches for updated files ...

[root@localhost nst]#

As setting the CVSROOT variable can be quite tedious, it is recommended that you include its definition in your: "~/.bashrc" file. Add the following lines to the end of: "~/.bashrc".

CVSROOT=":pserver:anonymous@nst.cvs.sourceforge.net:/cvsroot/nst"; export CVSROOT;

Configuring The System

After downloading the source code, you will need to run the: configure command from the top level directory. Before doing so, here are a couple of things to note:

  • Before configuring the system, it is recommend that one run: "yum update" to make sure the latest kernel and package updates are installed.
  • Sun's Java Run Time Environment (JRE) is used when building the NST. The configure script will attempt to download and install it automatically (if it isn't found on your development system). If the script is unable to automatically install it, you will need to download and install the JRE from: [1] (get the appropriate RPM version).
  • You will probably need to run the configure multiple times the first time you setup your development system (as you will most likely be missing some packages).
  • If configure determines that there are missing packages, it will indicate the yum command which you need to run in order to add the necessary packages to your system (or at least indicate which packages need to be added).

Here's an example of what one might go through when trying to initially configure a development system (NOTE: In this example, yum found that the current packages installed on the system were up to date):

Initial System Configuration
[root@localhost ~]# cd $HOME/nst
[root@localhost nst]# yum update
Loading "installonlyn" plugin
Setting up Update Process
Setting up repositories
core                      100% |=========================| 1.1 kB    00:00
updates                   100% |=========================| 1.2 kB    00:00
extras                    100% |=========================| 1.1 kB    00:00
Reading repository metadata in from local files
primary.xml.gz            100% |=========================| 1.6 MB    00:11
extras    : ################################################## 5097/5097
No Packages marked for Update/Obsoletion
[root@localhost nst]# ./configure
***ERROR*** unable to find executable program 'docbook2html' on system
***ERROR*** unable to find executable program 'docbook2pdf' on system
***ERROR*** unable to find executable program 'make' on system
***ERROR*** unable to find executable program 'mkzftree' on system
***ERROR*** unable to find executable program 'ncftpput' on system
***ERROR*** unable to find executable program 'pear' on system
***ERROR*** unable to find executable program 'rpmbuild' on system
***ERROR*** unable to find executable program 'svn' on system
  Try the following to add the missing packages:

    yum install  docbook-utils docbook-utils-pdf make zisofs-tools ncftp php-pear rpm-build subversion
[root@localhost nst]# yum install docbook-utils docbook-utils-pdf make zisofs-tools ncftp php-pear rpm-build subversion

   ... Lot's of yum output as it figures out package dependencies,
       then you will be prompted. Enter 'y' when you see:

Transaction Summary
=============================================================================
Install     34 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 63 M
Is this ok [y/N]: y

   ... A lot more output from yum as it downloads and installs packages ...


Installed: docbook-utils.noarch 0:0.6.14-8.fc6 docbook-utils-pdf.noarch 0:0.6.14-8.fc6 make.i386 1:3.81-1.1 ncftp.i386 2:3.2.0-2.fc6 php-pear.noarch 1:1.4.9-4 rpm-build.i386 0:4.4.2-33.fc6 subversion.i386 0:1.4.3-2.fc6 zisofs-tools.i386 0:1.0.6-3.2.2
Dependency Installed: apr.i386 0:1.2.7-10 apr-util.i386 0:1.2.8-1.fc6 curl.i386
0:7.15.5-1.fc6 dialog.i386 0:1.0.20051107-1.2.2 docbook-style-dsssl.noarch 
0:1.79-4.1 elfutils.i386 0:0.128-2.fc6 elfutils-libs.i386 0:0.128-2.fc6 
elinks.i386 0:0.11.1-5.2 gd.i386 0:2.0.33-11.fc6 gmp.i386 0:4.1.4-9.fc6 
httpd.i386 0:2.2.4-2.1.fc6 jadetex.noarch 0:3.12-13.1.1 netpbm.i386
0:10.35-8.1.fc6 netpbm-progs.i386 0:10.35-8.1.fc6 patch.i386 0:2.5.4-29.2.2 perl-SGMLSpm.noarch 0:1.03ii-16.2.1 perl-URI.noarch 0:1.35-3 php.i386 0:5.1.6-3.6.fc6 
php-cli.i386 0:5.1.6-3.6.fc6 php-common.i386 0:5.1.6-3.6.fc6
postgresql-ibs.i386 0:8.1.9-1.fc6 psutils.i386 0:1.17-26.1 tetex.i386
0:3.0-34.fc6 tetex-dvips.i386 0:3.0-34.fc6 tetex-fonts.i386 0:3.0-34.fc6
tetex-latex.i386 0:3.0-34.fc6
Complete!

[root@localhost nst]# ./configure

Checking for DocBook XSL                                   [FAILED]
***ERROR*** You are missing the "docbook-style-xsl" package
[root@localhost nst]# yum install docbook-style-xsl

   ... Output from yum as package is installed ...

[root@localhost nst]# ./configure

  ... Lots of output as configure finally completes
      NOTE: If you have not yet installed the JRE
      from Sun, it will download and start the install
      process for you (you will need to accept the license
      in this case) ...


Use "make" to build src/nst-1.6.0.iso.gz, or "make help" to see
additional targets.

NOTE: You may want to run "make package-update" to update MANY of the
packages needed for the NST. You can then run "make package-check" to
see what is left to do by hand (there are many helper scripts under
"src/bin" to aid in the package install/update process).
[root@localhost nst]#


It took some effort, but at this point you should have a fully configured development system and ready to proceed to the next step.

Remember to re-run the configure script anytime you update your CVS source code (it should run much more quickly and without any interaction once you've gone through the initial system setup).


Installing Packages

At this point you might be tempted to run: "make" and produce a bootable ISO image. However, you would be missing MANY of the extra packages which are typically included in a NST distribution.

To get "most" of the extra packages installed onto your development system, you can use the: "make package-update" command as shown below (NOTE: This may take hours to complete):

Installing the Extra Packages
[root@localhost ~]# cd $HOME/nst
[root@localhost nst]# make package-update

   ... First a check will be made for the RPM packages which
       can be installed or updated via yum (you will need to
       answer yes if any packages are found ...

   ... After the yum installation of RPM packages completes,
       most of the packages defined in the include/data/packages.tsv
       (or include/data/packages.x86_64.tsv) file will be
       installed using custom scripts (some will be binary installs
       and some will build from source) ...

[root@localhost nst]#

Unfortunately, installation of all of the extra packages is not fully updated, so you will need to install some of the packages by hand (helper scripts have been provided to facilitate this). To see what packages still need to be installed, use the following command:

Installing the Extra Packages
[root@localhost ~]# cd $HOME/nst
[root@localhost nst]# make package-check

  
[root@localhost nst]#

Installing Packages

Building a ISO Image

Tweaking The Configure/Build Process

The Magic "${HOME}/.nst" Directory

"${HOME}/.nst/configure.sh"

"${HOME}/.nst/disable.txt"

"${HOME}/.nst/post_install.sh"