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- BuildingPackagesTutorial


Packaging Tutorial for Xandros 3.0

Kasablanca 0.4.0.2

--Andrew

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 Kasablanca FTP client. 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:

C/C++ Development Tools
Debian Development Tools
libqt3-mt-dev
kdelibs4-dev
  • Note that the last two will need to be installed from the "Expert" section.

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

http://download.berlios.de/kasablanca/kasablanca-0.4.0.2.tar.gz

I like to have a "Downloads" directory in my Home, and each time I download a source "tar ball" I create a new directory in Downloads with the same name as the application. So for this project I placed the kasablanca-0.4.0.2.tar.gz file into:

/home/andrew/Downloads/kasablanca-0.4.0.2, as show below:

Debianize the Source

Next we need to extract the source tar ball. To do this right click on the file in Xandros File Manager (XFM) and choose "Extract All" and click on "Save" in same directory. Now double click on the kasablanca-0.4.0.2 directory, and click on: Tools |Open Console Window. The current directory should be displayed as:

~/Downloads/kasablanca-0.4.0.2/kasablanca-0.4.0.2

Now copy/paste these commands:

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

You'll see something like this:

Maintainer name : Andrew
Email-Address : xandrosapps@new.rr.com.
Date : Tue, 22 Feb 2005 20:33:15 -0600
Package Name : kasablanca
Version : 0.4.0.2
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:

cd debian
rm *.ex
rm kasablanca.doc-base.EX
rm README.Debian
cd ..

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

Control

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

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

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

Change the the following lines as shown:

Section: unknown => Section: Internet
Architecture: any => Architecture: i386
Description: =>Description: KDE ftp application
=> A graphical ftp client for kde. among its features are support for ssl/tls encryption 
  (both commands and data using auth tls, not sftp), fxp (direct ftp to ftp transfer) 
  bookmarks, and queues.
  • Note: You MUST retain the space before the "long description"

Now save the file and close the editor.

Rules

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

dh_compress

Change the line to read: "dh_compress -X.docbook"

This keeps the help files from being compressed, if they were to be compressed they wouldn't be readable by the application (ie kasablanca).

Setup the Menu Entry

In XFM press the UP button once to get to the "~/Downloads/kasablanca-0.4.0.2/kasablanca-0.4.0.2" directory, and double click on the "src" directory. There are two files in this directory we need to edit: kasablanca.desktop and Makefile.in

kasablanca.desktop

Right click on the kasablanca.desktop file and choose Open With| Text Editor. Note that if this is the first time you've edited a .desktop file, you'll have to pick Text Editor from the "Open With" dialog by expanding the Accessories entry, then check the "Remember application association...." check box. Now add the following line to the bottom of the file:

Categories=Application;Network;

This will tell the system that this is a Network application, and to put it in the appropriate location in the launch menu. Save and close the file.

Makefile.in

Right click on the Makefile.in file and choose Open With | Text Editor. The line you'll need to edit is #410, you can go directly to it by pressing Ctrl+G and type in 410. (I normally find this line by using Edit| Find and searching for "kde_appsdir") The line looks like this:

shelldesktopdir =$(kde_appsdir)/Utilities

Just delete the "/Utilities" at the end so that it becomes: "shelldesktopdir = $(kde_appsdir)". Save and close the file.

Create the Package

Now we're actually going to create the debian package. Go back to the console window, and confirm that you're in the correct directory:

~/Downloads/kasablanca-0.4.0.2/kasablanca-0.4.0.2

Before we create the package we have to set some environment variables so things get installed where Xandros wants them (no need to include the # or anything after it):

   export kde_appsdir=/usr/share/applications
   #this tells the packaging application (dpkg) to put any .desktop files in /usr/share/applications, this is where Xandros looks for them

export kde_htmldir=/usr/share/doc/kde/HTML
# this makes the Help files go in the right place so that the HandBook will work.
# (Thanks to ea on the Xandros forums for this info)

Now we give the command that actually creates the package:

dpkg-buildpackage -rfakeroot

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

Summary

This is the general process for packaging a KDE application. My next tutorial will involve packaging a non-KDE application that will require more tweaking.

Until next time.......



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