This write-up is very much based on the installation notes for Ubuntu 10.04. HowTo:Ubuntu_10.04. Thanks to the contributors to that write-up, and to the Xastir developers. There are essentially two differences between this HowTo and the one for 10.04.
1) The development package name for libcurl changed to 'libcurl4-openssl-dev'. 2) The proj and geotiff libraries from the Ubuntu repositories are specified instead of PPA/launchpad versions.
This set of notes provides instructions for building Xastir from CVS on Ubuntu 10.10, 11.04 or 11.10 with all supported libraries enabled. It assumes the user already has a working installation of Ubuntu 10.10/11.04/11.10, either on a physical machine or a virtual machine. Installation of Ubuntu itself is not covered here. Internet connectivity is also assumed.
If you already installed the binary version
Note: the description below on what to do if you already installed the binary version is verbatim from the HowTo for Ubuntu 6.10 and 7.04. Although it should still apply, I have not tried installing the binary version in 10.10/11.04/11.10 and then removing it using this procedure.
If you installed a binary version of xastir using the "apt-get install xastir" option (or using Synaptic), you'll have a somewhat outdated version, and it will have installed into /usr instead of /usr/local. The source install described on this page will install into /usr/local, so you'll want to remove your binary install first before following these directions.
If you did a lot of map configuration with the binary install, all of your maps will be in /usr/share/xastir/maps. You'll need to copy those to a safe place before removing the binary install:
mkdir /tmp/maps cp -r /usr/share/xastir/maps/* /tmp/maps
Then remove the binary package:
sudo apt-get remove xastir
You can then follow the instructions below to re-install xastir to /usr/local from sources. Once you're done, copy your maps back to the new installation directory:
sudo cp -r /tmp/maps/* /usr/local/share/xastir/maps
Then you need to edit your ~/.xastir/config/xastir.cnf file to change all occurances of "/usr/share" to "/usr/local/share"
You'll be back in business with a more easily updated xastir.
Shortcut: Build Script
KC0TFB originally prepared a build script that obtains all the build dependencies and performs all the actions described herein, with the exception of installing GDAL. Read below to determine if you want GDAL support; most users won't need it.
The script was modifed by K5DAT to update the libcurl development package name as well support Ubuntu 11.10.
Retrieve the updated script with
You may need to make it executable by issuing the following command:
chmod +x ubuntu-xastir-cvsbuild.sh
Examine the script with your favorite editor and be sure you understand what it does before executing it. It is provided for your convenience, however without warranty of any kind.
Preparing the system
I didn't have to do anything to the repository settings as the newer versions of Ubuntu already have the universe and multiverse repositories configured.
First, make sure you have a working Ubuntu 10.10 installation. Also check that you can access the Internet. As always, you should also have a complete backup of your system.
I recommend updating your installed packages to the latest versions first. This can be done using APT:
sudo apt-get update sudo apt-get upgrade
If there was a kernel upgrade or something you may want to reboot your system before proceeding.
Start installing packages
- Get the basic set of build tools:
sudo apt-get install build-essential
- Get the libraries essential for building xastir:
sudo apt-get install cvs autoconf automake xorg-dev imagemagick gv libxp-dev lesstif2-dev libcurl4-openssl-dev
The packages above are required for the most basic minimum build of xastir. gv is not strictly required, but if you don't install it you will be unable to print. Note that the imagemagick package is not the one that gives you on-line map support, it's the one that provides the "convert" utility needed to create the postscript that gv will use to print. This package and gv are both required to be able to print from xastir even with minimal map support.
- Get additional libraries that will help for extra features:
sudo apt-get install gpsman gpsmanshp libpcre3-dev proj libproj-dev libdb4.8-dev python-dev libax25-dev shapelib libshp-dev festival festival-dev libmagickcore-dev libgeotiff-dev
If you prefer GraphicsMagick to ImageMagick (many do), you can modify the two installation lines above:
sudo apt-get install cvs autoconf automake xorg-dev graphicsmagick gv libxp-dev lesstif2-dev libcurl4-openssl-dev sudo apt-get install gpsman gpsmanshp libpcre3-dev proj libproj-dev libdb4.8-dev python-dev libax25-dev shapelib libshp-dev festival festival-dev libgraphicsmagick1-dev libgeotiff-dev
This is an acceptable modification as long as you're not using other software that absolutely requires ImageMagick --- the two dev packages conflict unnecessarily, and therefore GraphicsMagick is not an option if you are using software other than Xastir that mandates ImageMagick.
Note: ImageMagick and GraphicsMagick may no longer conflict in Ubuntu 11.04.
Get XASTIR source code From the "bleeding edge" CVS repository
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.
- Prepare your .cvsrc if you don't have one
ls -l ~/.cvsrc
If the ls command shows that you already have a .cvsrc file in your home directory, skip this next step.
Create a .cvsrc file in a text editor:
Enter these commands in the text file:
cvs -z3 update -P -d status -v diff -u
Save and exit your text editor.
- Get the source code per README.CVS or Notes:CVS:
You can make different choices here for where you want to store your code. I'm putting it in a src directory under my home directory:
mkdir ~/src cd ~/src cvs -d:pserver:email@example.com:/cvsroot/xastir login cvs -d:pserver:firstname.lastname@example.org:/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
This is an entirely optional install, and is pretty much unnecessary. Very few users will ever have need of it, as Xastir's use of GDAL is limited to only a small handful of unusual map types. It is recommended that the casual user skip this step.
- Download the GDAL source
As of this writing, the latest GDAL source can be downloaded like this:
cd ~/src wget http://download.osgeo.org/gdal/gdal-1.8.1.tar.gz
- Unpack GDAL
tar zxvf gdal-1.8.1.tar.gz cd gdal-1.8.1
- Build and install GDAL:
./configure make sudo make install sudo ldconfig
Note: the GDAL 'make' step seems to take a while to complete
You've now got all the libraries in place and can build the fully enabled code.
- Configure the code:
cd ~/src/xastir mkdir build cd build ../configure CPPFLAGS="-I/usr/include/geotiff"
You should be rewarded with a list of features that all say "yes" after them. If you followed all the steps above, that should look like this:
xastir 1.9.9 has been configured to use the following options and external libraries:
ShapeLib (Vector maps) ................. : yes
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 (wget)
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) .......... : yes GPSMan/gpsmanshp (GPS downloads) ....... : yes
- Build the code:
make sudo make install
If you intend to use Kernel AX.25 networking, you should also set the installed Xastir binary to be SUID root:
sudo chmod u+s /usr/local/bin/xastir
- Enjoy! You now have a fully functional xastir with all features enabled. You can launch it like this:
The first time Xastir is run it'll pop up a dialog box asking you to set some station parameters.
The developers are always adding new features to Xastir and fixing bugs. You'll likely want to update your Xastir semi-regularly. Fortunately for you, you don't have to repeat all of the above steps each time. Updating is actually very simple:
cd ~/src/xastir cvs update ./bootstrap.sh cd build ../configure make sudo make install && sudo chmod u+s /usr/local/bin/xastir
Or there is a script that will run the commands for you:
cd ~/src/xastir ./update-xastir
You have to start the festival server by hand in a shell window before starting xastir.
festival --server &
Clicking File->Configure->Speech in xastir, I could get it to talk just by clicking the "Test" button in the dialog.