From XastirWiki
Jump to: navigation, search

This HowTo provides a step by step procedure for installing XASTIR from source using the CVS repository. Downloading the source from CVS provides the most up to date version available.

This write-up covers in detail the procedure that applies to PCLinuxOS 2010.

Preparing the system

A shell script is available near the bottom of this write-up that automates the entire process of syncing with repositories, fetching and installing libraries as well as Xastir itself. See the link below:

If you prefer a manual installation, which provides more options, continue on here.

It is usually best to do the following at a command line in order to make sure you are in sync with the repositories.

 <enter your root password here>
 apt-get update

Optionally you can upgrade any existing packages that are installed by issuing...

 apt-get upgrade

Add Libraries

1. Still in root mode in the terminal, issue the following command to load the first set of libraries:

 apt-get install automake cvs liblesstif-devel GraphicsMagick gv xfontsel libxpm-devel

2. Next issue the following command to load additional packages supporting a fairly decent set of features:

 apt-get install libcurl-devel pcre libpcre0-devel proj-devel libdb4.8-devel libax25_0-devel GraphicsMagick-devel

3. If you want support for Geotiff maps, issue the following command:

 apt-get install geotiff-devel

4. Another very optional feature is text to speech, which can be had via festival:

 apt-get install festival-devel festvox-kallpc16k

5. Finally for advanced users who want to leverage the limited GDAL support:

 apt-get install gdal-devel

Note: PCLinuxOS does not appear to have either shapelib, gpsman, or gpsmanshp in its repositories. Shapelib, however, is available internally to Xastir.

6. If you need gpsman, an RPM package can be retrieved as follows (assuming your terminal is still in root mode):


Then install the rpm back in root mode

 <enter your root password here>
 rpm -i gpsman-6.4-2.noarch.rpm

The next section is taken mostly from one of the HowTo's for Ubuntu as the procedure for retrieving the XASTIR source code is the same.

Make sure you have exited out of root mode in the terminal before going on to the next steps.

Get XASTIR source code

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, you might have to change the "cd" and "mkdir" commands to suit your taste. I like to keep my projects separated rather rigidly into directories, and the steps below reflect my personal style. This does tend to make rather deep directory trees, but makes clean-up easy because everything's separate. Your mileage may vary.

  • Prepare your .cvsrc if you don't have one (I prefer to do this in my home directory.)
 ls -l ~/.cvsrc
 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


  mkdir src
  mkdir src/XASTIR
  cd src/XASTIR
  cvs login
  cvs co xastir

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

  • Run bootstrap to generate and configure:
  cd 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:

 cd ~/src/XASTIR
 mkdir build1
 cd build1

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:
   ShapeLib (Vector maps) ................. : yes (internal)
   GraphicsMagick/ImageMagick (Raster maps) : yes (GraphicsMagick)
   pcre (Shapefile customization) ......... : yes
   dbfawk (Shapefile customization) ....... : yes
   rtree indexing (Shapefile speedups) .... : yes
   map caching (Raster map speedups) ...... : yes
   internet map retrieval ................. : yes (libcurl)
   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) .......... : yes
   GPSMan/gpsmanshp (GPS downloads) ....... : yes
 xastir will be installed in /usr/local/bin.

Note: it is not necessary to load all of the libraries in order to exactly match the list above.

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


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

Note: in the December 2010 version of PCLOS, you may need to change directories back to where you were before entering the su command, which would be ~/src/XASTIR/build1 if you followed the recommendation above.

Next 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 &

Shell Script

The shell script below will automatically fetch and install Xastir and all of its dependencies for you. It installs everything except GDAL. Copy/paste the text below into a new file named and save it. At the command line in the same directory where you saved it, enter the following commands:

 (enter your root password when prompted)
 chmod +x

Then execute the script with


The shell script text is immediately below

 # Build script for Xastir from CVS for PCLinuxOS 2010
 # May 26, 2010
 if ! grep -q "PCLinuxOS release 2010" /etc/release; then
   echo "This script applies only to PCLinuxOS 2010."
   exit 1
 # check if user is in root mode and abort if yes
 if [[ $UID -eq 0 ]]; then
    echo "This script must NOT be run as root."
    exit 1
 # Fetch the gpsman rpm since it is not in the repositories
 wget  || exit 1
 # install gpsman, refresh repositories and grab dependencies
 echo -e "\nEnter your root password when prompted...\n"
 su -c "rpm -i gpsman-6.4-2.noarch.rpm && apt-get update && apt-get -y install automake cvs liblesstif-devel GraphicsMagick gv xfontsel libcurl-devel pcre libpcre0-devel proj-devel libdb4.8-devel libax25_0-devel GraphicsMagick-devel geotiff-devel festival-devel festvox-kallpc16k libxpm-devel || exit 1"
 # create a .cvsrc if one does not exist.
 [ -f ~/.cvsrc ] || echo -e "cvs -z3\nupdate -P -d\nstatus -v\ndiff -u" > ~/.cvsrc
 # create directories for source code, etc.
 mkdir -p ~/src ; cd ~/src || exit 1
 mkdir XASTIR ; cd XASTIR || exit 1
 # retrieve Xastir from CVS
 echo -e "\nHit <ENTER> when prompted for a password...\n"
 cvs login
 cvs co xastir || exit 1
 # execute the bootstrap shell script
 cd xastir
 cd ..
 # create a build directory and configure
 mkdir build1; cd build1 || exit 1
 ../xastir/configure || exit 1
 # compile and install
 make || exit 1
 echo -e "\nEnter your root password when prompted...\n"
 su -c "make install"