From XastirWiki
Jump to: navigation, search

This HowTo provides a step by step procedure for installing XASTIR from source either via the CVS repository or by downloading a source code package from sourceforge. Downloading the source code from CVS allows the user to stay on the "bleeding edge" if he so chooses.

This write-up covers in detail the procedure that applies to Sabayon 3.5 as installed from the 32 bit DVD. I hope the 64 bit version is the same, but I have not tried it out. Users of other versions of Sabayon can use this procedure as a high level guide, but there could be variances in terms of which packages are installed by default. I'll try to provide some tips for installing in other versions.

Preparing the system

Update Portage Tree and Overlays

If you haven't done so already, open a terminal, login as root by typing su and your root password. To update your portage tree, type the following command at the terminal:

 emerge --sync

It may take a little time to complete.

Next (if not already done recently) update your overlays by entering the following command:

 layman -S

Add Libraries

I installed Sabayon 3.5 from the DVD, and because I chose the KDE desktop, I de-selected other window managers such as Gnome, XFCE, etc. Although the installer gave me the opportunity to de-select other items, I did not bother to do so because saving disk space was not an issue. As a result, I am confident that I did not de-select any libraries/applications that XASTIR could use.

Note: adding libraries in this section involves typing commands in the linux terminal in root mode as was done in the previous section.

1. Upgrade OpenMotif

The installed version of openMotif from the CD is version 2.3.0-r3 There is an upgrade available, and it is required because version 2.3.0 has a bug that affects Xastir. To upgrade openMotif, type the following in the terminal:

 emerge -u openmotif

2. Install Additional Libraries

Next install libraries that were not already installed via the DVD. Below are the commands that need to be issued from the terminal one at at time. After each command, the applicable package will be downloaded and built from source, and some of them may take some time.

 emerge gv
 emerge proj
 emerge libax25
 emerge libgeotiff

At this point you can type exit to get out of root mode in the terminal.

The next section is taken mostly from the HowTo for Ubuntu 6.10/7.04 because the procedure for retrieving the XASTIR source code is essentially the same.

Get XASTIR source code

From a development snapshot or stable release

If you want to save a bit of time, the easiest way to get the Xastir source code is from one of the "tarballs" available for download at the Xastir sourceforge site (see [http://www.xastir.org/ for a link to download the source code). If you prefer to get the latest and greatest source code from CVS, skip to the next section.

Next in order to be consistent with the steps below, create directories inside your home directory via the following commands (you should not be in root mode when you do this)

 mkdir src
 mkdir src/XASTIR

If you haven't downloaded the tarball already, download it into the ~/src/XASTIR directory (or move it there if you already downloaded it) and extract it there. Extraction is easy with either the KDE, Gnome or XFCE desktops - navigate to the tar.gz file via Konqueror, Nautilus, or Thunar, right click, and select "extract here". Extracting the tarball will result in a new directory being created underneath ~/src/XASTIR. Rename the new directory to xastir (all lower case) in order to be consistent with the naming used below. Then skip to the section labeled Build Xastir.

From the "bleeding edge" CVS repository

If you really want the latest developments of xastir immediately upon their being made, CVS is the approach for you. In this method, you get your source code directly from the "repository" that the developers use to work on the software. See Notes:CVS for details. Here's the step-by-step method for getting it this way.

In the steps below originally from the Ubuntu guide, the author separates build directories, and I like that approach, so it is repeated here. You can, of course, change the "cd" and "mkdir" commands to suit your taste.

  • Prepare your .cvsrc if you don't have one (I prefer to do this in my home directory.)
 ls -l ~/.cvsrc
 # DO NOT DO THE STEPS BELOW IF THE COMMAND ABOVE SHOWS THAT YOU ALREADY HAVE ONE
 cat > ~/.cvsrc
 cvs -z3
 update -P -d
 status -v
 diff -u
 type control-D to finish creating the file
  • Get the source code per README.CVS or Notes:CVS:

You can make different choices here for where you want to store your code. The example puts it in a tree under the home directory:

  mkdir src
  mkdir src/XASTIR
  cd src/XASTIR
  cvs -d:pserver:anonymous@xastir.cvs.sourceforge.net:/cvsroot/xastir login
  cvs -d:pserver:anonymous@xastir.cvs.sourceforge.net:/cvsroot/xastir co xastir

The "login" line will result in a prompt for a password. Simply hit "Enter" here, as there is no password.

The last command could take a while to finish if you're on a slow link, as there are a lot of files to download.

  • Run bootstrap to generate Makefile.am and configure:
  cd xastir
  ./bootstrap.sh

Build XASTIR

It is recommended to build the code in a separate directory from the source code so as to keep the source code tree clean at all times: (the name of the directory in the example uses a date of 10-31-08 - future builds can be labeled with future dates)

 cd ~/src/XASTIR
 mkdir build-103108
 cd build-103108
 ../xastir/configure

Among other text, the following list will be displayed after running configure: If all of the libraries above have been installed, the output will look like what is shown below.

options and external libraries:

 MINIMUM OPTIONS:
   ShapeLib (Vector maps) ................. : yes (internal)
 
 RECOMMENDED OPTIONS:
   GraphicsMagick/ImageMagick (Raster maps) : yes (ImageMagick)
   pcre (Shapefile customization) ......... : yes
   dbfawk (Shapefile customization) ....... : yes
   rtree indexing (Shapefile speedups) .... : yes
   map caching (Raster map speedups) ...... : yes
   internet map retrieval ................. : yes (libcurl)
 
 FOR THE ADVENTUROUS:
   AX25 (Linux Kernel I/O Drivers) ........ : yes
   libproj (USGS Topos & Aerial Photos) ... : yes
   GeoTiff (USGS Topos & Aerial Photos) ... : yes
   Festival (Text-to-speech) .............. : yes
   GDAL/OGR (Obtuse map formats) .......... : no
   GPSMan/gpsmanshp (GPS downloads) ....... : no

Note: I purposely did not install GDAL, and I did not find gpsman or gpsmanshp in the Sabayon/Gentoo repositories. If you really need GDAL, it is indeed in the repositories as follows:

 *  sci-libs/gdal
       Latest version available: 1.5.3
       Latest version installed: [ Not Installed ]
       Size of files: 6,049 kB
       Homepage:      http://www.gdal.org/
       Description:   GDAL is a translator library for raster geospatial data formats (includes   OGR support)
       License:       MIT

Noting the package above, it should only be a matter of using the command emerge gdal to install it, but keep in mind that I have not tried this as of this writing.

After configure finishes (assuming with no errors), type the following:

 make

After the build completes and assuming no errors, give yourself root privileges by typing in su and then your root password when prompted, then type...

 make install

Next type exit in order to get back to your normal user account (in other words, exit out of root mode)

That's it, at a command line, type the following to launch XASTIR:

 xastir &

Other Versions of Sabayon

There is another version of Sabayon that is still labeled version 3.5, but it is a "Pod" version, which is distributed as a live CD as opposed to a live DVD. It comes with XFCE as the only window manager, and, of course, the installation medium has many fewer applications and libraries on it. There are also older versions of Sabayon, some of which are light versions, that may not install as many apps and libraries by default. In order to compile Xastir on the lighter versions of Sabayon, it may be necessary to install additional libraries.

It is easy to search for packages - especially if you already know the names. The following package names in addition to the ones above should be checked if you are using a lightweight version of Sabayon.

 gcc, cvs, automake, autoconf, xorg-x11, imagemagick, libxp, wget, curl, libpcre, db

Searching is done via the following command at at terminal in root mode:

 emerge -s packagename
 for example, emerge -s gcc

Also available if the above strikes out, the command below, which searches for the package name or whatever keyword you enter in the desciption of the package:

 emerge -S packagename (or keyword)

If the package is found, the system will display whether it is already installed or not. If it is not installed, simply type emerge packagename in order to install it.