Install-Debian

== Official Debian packages ==
A number of Freeciv packages are included in Debian. Try
 apt-cache search freeciv
To install Freeciv with the GTK+ client, install the freeciv-server and freeciv-client-gtk packages. For example, using apt-get:
 apt-get install freeciv-server freeciv-client-gtk
The version in Debian stable will usually not be the latest, and if you want to join a multiplayer game it may not be compatible with the server, but backports may have something more recent.
== Unofficial Debian packages ==
The unofficial backport repository http://playdeb.net/ may also be worth a look.
== Compiling from upstream source ==
First, obtain the most recent version of the Freeciv source code from the Download section. You will need to use either tar, bzip2 (or a combination of both) or unzip to decompress the source depending on the version you download. For example, to decompress the "freeciv-2.4.3.tar.bz2" archive you would use the following command.
 tar -zxvf freeciv-2.4.3.tar.bz2
This will create a "freeciv-2.4.3" directory wherever you placed the archived source code. Now, enter the freeciv code directory and configure the source for compile by running
 ./configure
The configure program will determine information about your system that will be needed to compile the Freeciv source. If at any point it fails, it is likely that you are missing dependencies for Freeciv. In this case see the next section for the required dependencies and their packages. There are also various options you can pass, such as which client you would prefer to compile and many others. You can find more information on the various options available by passing the --help flag when running configure or reading the INSTALL file included in the source.
After it has finished creating the Makefile, you are free to begin the compile process. Simply use the command
 make
and the process will begin. The length it will take to compile depends on your machine. After it has finished, you can find the compiled binaries at client/freeciv-gtk2 and server/freeciv-server.
You can now run Freeciv if you choose; you may also choose to "install" Freeciv to allow global use of the binaries or perhaps to use Internationalization while playing. Simply pass the command
 make install
to do this. You should be able to simply type freeciv-gtk2 when you want to run the client now. The default path for the install is /usr/local.
There is no easy "uninstall" step (this is what package managers are for).
=== Debian dependency packages ===
To compile Freeciv from source, you will probably require some development packages (*-dev).
A good start would be to install the packages needed to rebuild the official Debian packages. This may be overkill, but is quite likely to have all you need.
 sudo apt-get build-dep freeciv
In order for the above command to work, it is necessary to have appropriate deb-src lines in /etc/apt/sources.list. On Ubuntu, if these are not present by default, they can be added by starting "Software & Updates" and enabling "Source code" on the "Ubuntu Software" tab.
If you're building a newer version than has been packaged, it may have a few dependencies that the Debian version doesn't know about, which you'll have to install by hand. To find out such dependencies, doc/README.packaging should help. In the section listing differences to previous version all new dependencies should be mentioned. Though at the time of writing this, for checking new dependencies in trunk compared to 2.4 that Debian ships, you would need to check all of (S2_4 to) S2_5, (S2_5 to) S2_6, and (S2_6 to) trunk README.packaging files.
Here for reference are some of the packages you might need. (This list will likely not be either complete or up-to-date, but should give you some idea of the sorts of packages you're looking for).
* zlib1g-dev
* libreadline5-dev (or another readline library - optional)
To compile the GTK2 client you will also need the following libraries:
* libgtk2.0-dev
To compile the SDL client you will also need the following libraries:
* libsdl1.2-dev
* libsdl-image1.2-dev
* libfreetype6-dev
(There are almost certainly other requirements that have been forgotten here.)
Category:Installing