2. Basic Usage

2.1. Installing

2.1.1. The easy way

To install a package with Spm you just have to use the '--install' (or '-I') option. You must provide either the package name or the URL of a remote file.

To specify the destination directory you can use the '--prefix' (or '-p') option. So for exemple to install a package to /opt :

spm -I package_file --prefix=/opt

2.1.2. Using package option

A package may have specific options. You can use these options. Just add them to the spm line.

For exemple to install Spm with Spm :

./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --with-system-boost &&
        make &&
        make install

will become

spm -I spm-0.7.0.tar.bz2 --prefix=/usr --localstatedir=/var --sysconfdir=/etc --with-system-boost

To known which options you can use for a package, you can use the '--testFile' option :

spm --testFile spm-0.7.0.tar.bz2

2.1.3. Categoryzing packages

Each installed package can be attached to a category. Spm already provides a minimal set of category :

  • Games
  • Library
  • System
  • Developement
  • Multimedia
  • Network
  • Servers
  • Utilities

Categorys are hierachized. A category may have some sub categorys. But a category can only have one top category.

Level of category are separed with a '/'. Each category have a name and a full name. The name is the one provided when you create the category. The full name is the path to the category. If a category has no top category, the name and the full name are equal. Full name must be unique.

You can add a category with the '--addCategory' option (or '-c'). You will have to provide the name of this new category. You can also provides the name of the top category with the '--topCategory' option.

Exemple, adding a 'Graphical' category to 'Library' :

spm --addCategory Graphical --topCategory=Library

So 'Graphical' is the name of the new category, 'Library/Graphical' is the full name of the new category.

The category of package must be set at installation time. This is done with the --category' option. You must provide the full name of the category.

Exemple :

spm -I mypackage-1.0.0.tar.gz --prefix=/usr --category='Library/Graphical'

2.2. Listing categorys and installed packages

To list installed packages, you can use the '--list' (or '-l') option :

spm --list

To list categorys, you can use the '--listCategorys' (or '-lc') option :

spm --listCategorys

2.3. Getting informations about installed packages

To get informations about a package you can use the '--information' (or '-i') option. You must gave the name of the package.

spm --info toto

You can also see the files installed by a package with the '--files' option (or '-f') :

spm --files toto