ArchLUG Kwiki - www.archlug.org

Download the RSS XML Feed for this site

Download the RSS XML Feed for this site

Subscribe to this channel with Amphetadesk

Subscribe to this channel with RadioUserland

Add to Google

Xandros- BuildingPackagesTutorial2


Packaging Tutorial for Xandros 3.0 Part II

Globulation 2

--Andrew (Recovered by archive.org from an article on DesktopOS.com)

Purpose

In this document I will walk you through the process of creating a Debian package for Xandros 3.0. When completed this package will install the Real- Time Strategy (RTS) game, Globulation 2. The information here was gleaned from the Debian New Maintainers' Guide: http://www.debian.org/doc/maint-guide/.

Preparation

First we must make sure we have the correct tools installed to create the package. Open Xandros Networks and enable the "Debian unsupported site" under Edit |Set Application Sources, and click on OK to let it update. Now search for and install each of the following:

Debian Development Tools

libspeex-dev
libsdl1.2-dev
libsdl-image1.2-dev
libsdl-net1.2-dev
libsdl-ttf2.0-dev
libvorbis-dev
  • Note that with the exception of "Debian Development Tools", you'll have to click on "Expert" to install these packages

Now we need to download the source "tarball", it's located here:

http://epfl.ysagoon.com/~glob2/data/glob2-0.8.12.tar.gz

As we did in Part I we'll put the tarball in:

/home/andrew/Downloads/glob2-0.812

Open Xandros File Manager (XFM), and navigate to the above directory. Now extract the tarball: Right Click on it then choose "Extract All", and save to the current directory.

Prepare the menu entry Now we need to take a step that wasn't necessary with the kasablanca package we made in the Part I. The developers of Globulation 2 chose not to include a .desktop file, or an icon for the menu entry. So we'll have to make the .desktop file, and find a suitable icon for the menu entry.

The .desktop file

Open the Text Editor (Launch |Applications |Accessories), and paste in the following:

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Globulation 2
GenericName=
Comment=
Icon=/usr/share/icons/hicolor/48x48/apps/glob2.png
Exec=glob2
Terminal=false
MimeType=
Hidden=false
InitialPreference=
Categories=Game;StrategyGame

Then save the file to the source directory:

/home/andrew/Downloads/glob2-0.812/glob2-0.8.12

giving it the name "glob2.desktop".

The menu icon

I searched the web for a nice globulation icon, but couldn't find anything really good. I ended up using this one:

http://www.happypenguin.org/images/thumbs/globulation2.png

Whatever picture file you choose, make sure it's in .png or .xpm format (this document assumes png). We'll save it in the source directory as: glob2.png

Recreate the tarball

Since we've changed the contents of the source directory we'll need to recreate the source tarball (otherwise dh_make will complain). First thing to do is delete the "glob2-0.8.12.tar.gz" file, on my system it's located here:

/home/andrew/Downloads/glob2-0.812/glob2-0.8.12

Now Right Click on the "glob2-0.8.12" directory and click on: "Create TGZ archive". When it's finished Right Click on the .tgz file and choose "Rename", and name it: glob2-0.8.12.tar.gz

Debianize the Source:

In XFM double click the "glob2-0.8.12" directory, then goto "Tools |Open Console Window. The current directory should be displayed as:

~/Downloads/glob2-0.812/glob2-0.8.12$

Now copy/paste these commands:

export DEBFULLNAME="yourname*"
dh_make -s -e your@email-address.com* -c GPL -f ../glob2-0.8.12.tar.gz

You'll see something like this:

Maintainer name : Andrew
Email-Address : xandrosapps@new.rr.com
Date : Sat, 26 Mar 2005 21:53:06 -0600
Package Name : glob2
Version : 0.8.12
Type of Package : Single
Hit to confirm:

Just press Enter.

Customize the debian files

In XFM enter the newly created "debian" directory, and you'll see a plethora of configuration files (if you want to learn what all these files do you can read the Debian New Maintainers' Guide ) we will only be using a select number of these files, so lets delete the ones we wont be using. In the console window type (or paste) these lines:

rm debian/*.ex
rm debian/README.Debian
rm debian/glob2.doc-base.EX

There are three files we'll need to edit; the control file, the the rules file, and dirs file.

The control File

In XFM right click on the control file and goto Open With |Text Editor. It'll look something like this:

Source: glob2
Section: unknown
Priority: optional
Maintainer: Andrew <xandrosapps@new.rr.com>
Build-Depends: debhelper (>= 4.0.0)
Standards-Version: 3.6.1

Package: glob2
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description:

Change the the following lines as shown:

Section: unknown => Section: Games
Architecture: any => Architecture: i386
Description: => Real-Time Strategy (RTS) game
=> Globulation 2 is a Real-Time Strategy (RTS) game, which minimizes micro-management by automatically assigning tasks to units. The player chooses the number of units he wants to assign to various tasks, and the units will do their best to satisfy the requests. This allows the user to manage more units and focus on strategies rather than individual units' jobs. Glob2 is Free Software, licensed and distributed under the GNU General Public License.
  • Note: You MUST retain the space before the "long description"

The rules File

Right Click the rules file and choose Open With| Text Editor. Scroll down until you see this line:

$(MAKE) install DESTDIR=$(CURDIR)/debian/glob2

Now paste the following in directly below that line:

install -D -o 0 -g 0 -m 644 glob2.desktop debian/glob2/usr/share/applications/glob2.desktop
install -D -o 0 -g 0 -m 644 glob2.png debian/glob2/usr/share/icons/hicolor/48x48/apps/glob2.png

Save and close the file.

The dirs File

Right Click the dirs file and choose Open With| Text Editor. Paste these two lines in the bottom of that file:

usr/share/icons/hicolor/48x48/apps
usr/share/applications
  • Note, after you paste these lines in press "Enter" to add a new line to the end of the file.

Save and close the file.

Create the Package

You may remember in Part I there were some environment variables we had to set before making the package. With Globulation 2, we don't need to as we're installing the .desktop file manually.

In the console window, paste:

dpkg-buildpackage -rfakeroot

When It's done, just double click on the glob2_0.8.12-1_i386.deb file, and choose to install it using Xandros Networks.

Happy gaming! :D



Valid XHTML 1.0! Valid CSS!
InterTran (www.tranexp.com)
InterTran (www.tranexp.com)

Please MOVE AND HOLD your MOUSE CURSOR over any WORD in the translated web page in order to see a pop-up window with ALTERNATIVE TRANSLATIONS. Translations provided by: www.tranexp.com