Help: Buildscripts

Here you will find a simple 'step-by-step' guide for how to use a buildscript.


Install an application using a buildscript

Let's see how to install an application by using a buildscript. For this we will try to build a game: toppler.

Download the required buildscript for toppler from here. Open a shell and 'cd' into the directory that contains the downloaded buildscript. Unpack the buildscript with:

tar xjf slp_toppler*.tar.bz2

Then 'cd' into the newly created 'toppler'-directory. You should see a list of two files that are required to build the package:

toppler.slackpack
slack-desc

If you are connected to the internet then all you have to do now is to start the build by using following command:

sh toppler.slackpack

The script will try to download the sources needed to build the package from the projects website. If you do not have a working internet connection, then you have to download the sources manually. In that case you must download the source-version that matches the version of the slackpack-file. For this 'How-to' we will need the version 1.1.1
The package is now going to be created. Depending on your processor this could take some minutes.

After the package has been build you can install toppler by using the command:

installpkg toppler*.tgz

or

upgradepkg --install-new toppler*.tgz

Congratulations! You have just installed your first package using a buildscript!

If compiling of a package fails then check the logfiles found in the current directory. Those logfiles should include all information about what went wrong. If you get a "package xyz not found" in config logfile then check the Buildscript Archive for the missing dependency.


Upgrade a package yourself

Now let's assume you want to build the latest version of this game. As of 2006-04-01 this is version 1.1.2a. Open the file 'toppler.slackpack' with an editor of your choice (e.g. kwrite, joe, mcedit) and edit the line starting with 'PACKAGE_VERSION' and set the version to 1.1.2 (not 1.1.2a!).

PACKAGE_VERSION=1.1.2

Since this is a bugfix-release and the author of this source-package did some mistake on the naming-scheme we have to apply a small fix to the build script. Scroll down until you find this line in your script:

PACKAGE_SOURCE=$PACKAGE_NAME_ARCHIVE-$PACKAGE_VERSION...

This line specifies the name of the source-code-package. Since the author named the source-code-archive (version 1.1.2a) different to the version of the package (1.1.2) we have to edit this line to match the following fix (insert \a next to $PACKAGE_VERSION):

PACKAGE_SOURCE=$PACKAGE_NAME_ARCHIVE-$PACKAGE_VERSION\a...

That's it!

Start the buildscript by using the 'sh toppler.slackpack'-command again but now add "-u" to the command because we will use a new source package we have to update the 'MD5SUM' which is a hash to check the source package for errors. The script will download the new version of the source package now and then start building the updated version. After this is done you can update the installed version of toppler using this command:

upgradepkg toppler-1.1.2-i486-1.tgz

Congratulations! You have just updated your installed toppler-package!

Here you can see all steps that were required to build the toppler-package:

Screenshot 1 The build process of toppler

Toppler in action... Have fun!

Screenshot 2 Play the game Toppler

xhtml CSS