The actions.py for Pisi Linux with a example of a actions.py

This is possibly the most complex part of package construction. Here you give PiSi the instructions how to build the software. Usually/very often Linux Software is installed with the three commands :

./configure You will find “configure“                                                  in the section              setup

make You will find “make“                                                                in the section               build

sudo make install You will find “make install“                                in the section               install

Example of actions.py :

#!/usr/bin/python

# -*- coding: utf-8 -*-

#

# Licensed under the GNU General Public License, version 3.

# See the file http://www.gnu.org/licenses/gpl.txt

from pisi.actionsapi import get

from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools

WorkDir="softwarename-" + get.srcVersion()

def setup():
    autotools.configure()

def build():
    autotools.make()

def install():
    autotools.rawInstall("DESTDIR=%s" % get.installDIR())

    pisitools.dodoc('COPYING', 'AUTHORS', 'ChangeLog', 'README')

For a more complete overview of the functions and possibilities, have a look into the Wikisite of Actions_API :

http://pisilinux.github.io/developer.pisilinux.io/guides/packaging/actionsapi/index.html

Actions API has a modular structure that makes the packaging process easier for the packager.

To use these functions, they must be defined in the actions.py :

from pisi.actionsapi import cmaketools
from pisi.actionsapi import get
from pisi.actionsapi import pisitools

 

The major modules of the Actions API are :

  • Autotools : Standard functions for building and installing applications.
  • Cmaketools : Functions for building the applications that are configured with cmake.
  • Pisitools : Fundamentally used for moving files from work directory to install directory, the functions included in pisitools are convenient for most operations i.e. symlinking, file manipulation via sed, deleting files or directories.
  • Shelltools : Functions for specific operations. Apart from pisitools, shelltools are capable of operating in absolute paths instead of relative paths. Granting the packager the ability to operate in the darkest corners of the file system, shelltools have to be used responsibly.
  • Libtools : Pre-build and post-build operations for configuring libraries.
  • Get : Functions for getting information about environment variables or packages needed at building and installation stages.
  • Kde : Functions for configuring, building and installing KDE applications.
  • Perlmodules : Functions for installing perl modules.
  • Pythonmodules : Functions for installing python modules.
  • Scons : Counterpart of autotools for the new generation of building tools, scons. See also : http://pisilinux.github.io/developer.pisilinux.io/guides/packaging/actionsapi/index.html
WorkDir="softwarename-" + get.srcVersion()

WorkDir gives PiSi the name of the folder in the packed file of the source. Pisi will use the same WorkDir-name in /var/pisi/ for building and constructing. WorkDir is depending on the choosen name in the sourcefile.

It is very common to use the name of the software. And with “+srcVersion()“ PiSi will detect the version of the Source given in pspec.xml.

(<Archive> and history). The green excample will result the following WorkDir: /var/pisi/softwarename-0.1-1/

If you do some testing and compile several times a package, it is not a bad idea to delete the folder in /var/pisi/XXX

Also possible options : WorkDir=”.”

WorkDir=”packagename”

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s