These days, Battle for Wesnoth is the only computer game I play. The developers have released new major version, Wesnoth 1.8, last April. Unfortunately, there aren’t any packages from Fedora 12,operating system I mainly use.

After hesitating, I finally decided to take the problem into my own hands. That is, compiling Wesnoth myself. Compiling from source seems the only way to get the latest major version in Fedora. Generally programs compiled from source are rather hard to maintain, so I decided to repackage Wesnoth for upcoming Fedora 13, which has the latest Wesnoth version, for Fedora 12. The prerequisites for building Wesnoth 1.8 from source are available for Fedora 12. So it should be easy to “backport” Wesnoth 1.8 from Fedora 13. I will outline the steps here if anybody want to do the same thing.

Before you begin, you have to install the rpm tools.
yum install rpmdevtools
This also installs additional necessary packages, if any. Next step is to prepare building environment. Run rpmdev-setuptree as a normal user, which will create necessary files and directories. We won’t package Wesnoth from tarball here, so I find it is not really necessary to fully follow the Fedora packaging guide

Now we need the source rpm package for Wesnoth. We also need to install the packages needed for building Wesnoth, which is detailed in the specs file in the SRPM package. We have to extract the SRPM package (without installing) to see it, but I will list it here.

The necessary packages are:

  • SDL_image-devel
  • SDL_mixer-devel
  • BSDL_net-devel
  • SDL_ttf-devel
  • freetype-devel
  • libpng-devel
  • fribidi-devel
  • python-devel
  • desktop-file-utils
  • gettext
  • boost-devel
  • pango-devel
  • lua-devel
  • autoconf
  • automake

You can install those using yum. After all necessary packages are installed, we simply rebuild the rpm packages. In my case, this means issuing this command, still as normal user:
rpmbuild --rebuild wesnoth-1.8.1-2.fc13.src.rpm

This will build the Wesnoth rpm packages in ~/rpmbuild/RPMS/i686 and ~/rpmbuild/RPMS/noarch. If you are using AMD64 architecture, the path will be different, of course. To play Wesnoth you only need to install wesnoth and wesnoth-data packages.

Advertisements