Tomahawk Computers Stay legal with Tomahawk Computers


Tomahawk Package Management System HOWTO


Introduction

Tomahawk Desktop has its own package management system. In Tomahawk Desktop, packages are installed by normal users called package users rather than the super user (root).

To install new packages, remove installed packages, inquire information related to installed packages, etc. require one to understand how to use the Tomahawk Desktop package management system.

IMPORTANT: Tomahawk Desktop is based on, what we call, "FreeBSD sources". That is, it does NOT based on the standard FreeBSD distribution. Therefore, on Tomahawk Desktop, DO NOT use package management utilities related to the FreeBSD. On Tomahawk Desktop, there is NO port system, all new software has to be installed according to the Tomahawk Desktop package management system.

In Unix, when you install a package under a normal user, the user id of files installed by that package is assigned as belong that normal user. You can scan your system, for an example by the Unix command find and list all files belongs to that user. Normal users in Unix cannot overwrite a file installed by another user or cannot delete a file installed by another user in a sticky directory. These are the two fundamental participles used in the Tomahawk Desktop package management system.

In Tomahawk Desktop, there is technically no such thing as a file belong to one package was accidently overwritten or deleted by another package as it is common when you install packages under super user (root).


Advantage of the Tomahawk Desktop package management system

1. You can use any configuration method that is appropriate for your package, eg. ./configure, scons, cmake, etc. and build (eg. make or gmake) and install (make install or gmake install or manual install) the package, it is guaranteed in Tomahawk Desktop it does not affect any other package, it does not remove or overwrite any file belong to any other package. So that, by installing a new package in Tomahawk Desktop, it does not destabilize the Tomahawk Desktop.

2. Irrespective for your installation method, it is guaranteed in Tomahawk Desktop that all files installed by a package can be uninstalled, nothing is left behind.

3. You can stay in the cutting edge of the technology as you can download, compile and install a package immediately after its release or you can install a development snapshot via svn or git. You don't have to wait until somebody one day release a port for what you want to install.

4. It is trivial in Tomahawk Desktop to make an archive of a package for binary distribution.

5. Tomahawk Desktop package management system is a developer friendly package management system. There may not be any more easier package management system than the Tomahawk Desktop package management system in the Unix world.


What is a package user?

A package user is a normal user with the user id range from 6000 to 65532 with the exception that there is no password is assigned, therefore, cannot be used to log in to the Tomahawk Desktop.

A package user is used in Tomahawk Desktop to install a package. Example, the GCC compiler suite is installed under the gcc package user.


How to list existing package users?

listpkg -u

To get a sorted list, run, listpkg -us

NOTE: Most of the Tomahawk Desktop package management system utilities do not require for you to run under super user, you can run them as normal users and also recommended as a good practice to run them under normal users.

To see other options of the listpkg, just run listpkg --help or without any option.


How to list all existing packages?

listpkg -a

To get a sorted list, run, listpkg -as

The format is: pkgname|pkgversion|pkgusername

Example:

listpkg -a | grep gcc

GCC|4.2.1|gcc


How many packages installed?

listpkg -a | wc -l


How to display package description?

listpkg --pkgsdesc [pkgusername]

Example:

listpkg --pkgsdesc gcc

NOTE: The package username, gcc, is optional if you are already log in as the gcc package user.


How to log in as a package user?

Become root first: su -l

Now log in as package user: su -l pkgusername

Eg: su -l gcc


How to list package contents?

listpkg [pkgusername]

Eg: listpkg libtheora

If you are already log in as libtheora, just type listpkg.

Become root first: su -l

Now log in as package user: su -l libtheora

List package contents: listpkg

List package contents - sorted: listpkg -s


How to list dependencies of a given package?

List dependencies - packages (sorted): listpkg -dps [pkgusername]

Eg: listpkg -dps flac

This shows the package flac depend on what other packages.

If you need to see what exact files that flac depend on:

listpkg -ds flac


How to list what depend on a given package?

List what depend on - packages (sorted): listpkg -Dps [pkgusername]

Eg: listpkg -Dps qt

This shows what other packages depend on qt package.


What is an install directory?

Install directory is an any directory group owned by the install group, group writeable and sticky.

All package users are by default members of the install group, therefore, package users can install files into install directories.

Package users cannot install files into a directory which is not group writeable by the install group.

An install directory must be sticky to make sure package users cannot remove files do not belong to them.

mkinstalldir can be used to make a directory or a directory tree to make an install directory or directories.

Eg: mkinstalldir -r /usr/lib/

Make the /usr/lib and all directories below /usr/lib, are install directories.


How to add or introduce a new package user?

addpkguser pkg-username "short-description"

Eg: addpkguser pitivi "PiTiVi movie editor"

Note: This automatically log in as the package user after adding a new package user, so that you can download the package, compile and install.

To see other options of the addpkguser, just run addpkguser --help or without any option.


How to download, compile and install a new package?

1. addpkguser pkg-username "short-description"

2. Using wget, svn or git download the new package.

3. Unpack if necessary

4. cd package source directory

5. Apply patches if necessary.

6. ./configure or whatever applicable

7. gamke (for GNU make) or make (BSD make)

8. gmake install or make install

9. Register the package.


How to register a new package?

pkgregister -f -N pkgname -V 1.0.0 -D << "EOF"
pkgname-1.0.0

Package long description.

For more info: website

EOF

Note, above -V 1.0.0 is the version of the package as an example, you need to change 1.0.0 for the correct version of your package.

To see options of the pkgregister, run pkgregister --help.


How to uninstall a package?

1. Log in as package user.

2. uninstallpkg -f

NOTE: The uninstallpkg does not remove the package user from the system, it only removes all files and directories installed by the package.

To see other options of the uninstallpkg, run uninstallpkg --help or without any option.


How to remove a package user?

rmpkguser pkgusername

NOTE: The rmpkguser removes the package user from system.


How to create an archive of a package?

listpkg pkgusername > pkgusername.list

tar -n -cjf pkgusername.tar.bz2 -T pkgusername.list

rm pkgusername.list


What are the contents of the Tomahawk Desktop package management system?

listpkg -s pkgmgt


Complete example - Installation of kdelibs

addpkguser kdelibs "kdelibs"

wget http://download.kde.org/unstable/4.3.80/src/kdelibs-4.3.80.tar.bz2

tar -xjf kdelibs-4.3.80.tar.bz2
cd kdelibs-4.3.80

mkdir -v ../build
cd ../build

cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DSYSCONF_INSTALL_DIR=/etc \
-DLIB_INSTALL_DIR=/usr/lib \
-DCMAKE_BUILD_TYPE=Release \
-DLIB_SUFFIX= \
../kdelibs-4.3.80

gmake >& kdelibs-make.log
gmake install >& kdelibs-install.log

mv -v *.log ~

Register kdelibs
----------------

pkgregister -f -N "kdelibs" -V 4.3.80 -D << "EOF"
kdelibs-4.3.80

This is version 4.4 of the KDE libraries.

This package includes libraries that are central to the development and execution of a KDE program, as well as internationalization files for these libraries, misc HTML documentation, theme modules, and regression tests.

License: The libraries themselves have been covered (since Saturday, June 21st, 1997) by the GNU Library General Public License (LGPL). Any other programs (such as the examples) are covered by the GNU General Public License (GPL).

For more info: http://kde.org/

EOF

cd ..
rm -rf kdelibs-4.3.80
exit

Home| About| Contacts| Support
Copyright © 2010 Tomahawk Computers All rights reserved