Pisi Package

From PardusWiki
(Difference between revisions)
Jump to: navigation, search
m (actions.py)
(Structure of a PiSi 1.1 Package)
 
(7 intermediate revisions by 3 users not shown)
Line 5: Line 5:
  
 
A pisi package is essentially a zipped file. Let's download one and examine it:
 
A pisi package is essentially a zipped file. Let's download one and examine it:
  $ wget http://paketler.pardus.org.tr/pardus-2007/knazar-0.2-3-3.pisi
+
  $ wget http://packages.pardus.org.tr/pardus-2009/knazar-1.1-10-4.pisi
  $ unzip knazar-0.2-3-3.pisi -d apackage
+
  $ unzip knazar-1.1-10-4.pisi -d apackage
  Archive:  knazar-0.2-3-3.pisi
+
  Archive:  knazar-1.1-10-4.pis
 
   inflating: apackage/metadata.xml
 
   inflating: apackage/metadata.xml
 
   inflating: apackage/files.xml
 
   inflating: apackage/files.xml
Line 19: Line 19:
 
*install.tar.lzma contains compressed files that we can extract with those commands
 
*install.tar.lzma contains compressed files that we can extract with those commands
  
  $ lzma -d install.tar.lzma install.tar
+
  $ tar xvf install.tar.lzma
$ tar xvf install.tar
+
  
 
== Building a PiSi Package ==
 
== Building a PiSi Package ==
Line 34: Line 33:
 
In other words, one source package may generate multiple binary packages. Pisi is very flexible :)
 
In other words, one source package may generate multiple binary packages. Pisi is very flexible :)
  
Let's look at our example here: http://svn.pardus.org.tr/pardus/2008/devel/desktop/kde/knazar/pspec.xml
+
Let's look at our example here: http://svn.pardus.org.tr/pardus/2009/stable/desktop/kde/addon/knazar/pspec.xml
  
 
As you can see in the example,
 
As you can see in the example,
Line 76: Line 75:
 
This file contains python codes that would compile and install the source package into a specific InstallDIR (in our example it is /var/pisi/knazar-0.2-3-3/install/)
 
This file contains python codes that would compile and install the source package into a specific InstallDIR (in our example it is /var/pisi/knazar-0.2-3-3/install/)
  
http://svn.pardus.org.tr/pardus/2008/devel/desktop/kde/knazar/actions.py
+
http://svn.pardus.org.tr/pardus/2009/stable/desktop/kde/addon/knazar/actions.py
  
 
In this file, we use [[Actions API|actionsapi]] that comes with pisi. [[Actions API]] has all functions for us to compile and install our package.
 
In this file, we use [[Actions API|actionsapi]] that comes with pisi. [[Actions API]] has all functions for us to compile and install our package.
Line 86: Line 85:
 
  sudo pisi build pspec.xml
 
  sudo pisi build pspec.xml
 
in the console. To compile my example you may type:
 
in the console. To compile my example you may type:
  sudo pisi bi http://svn.pardus.org.tr/pardus/2008/devel/desktop/kde/knazar/pspec.xml
+
  sudo pisi bi http://svn.pardus.org.tr/pardus/2009/stable/desktop/kde/addon/knazar/knazar/pspec.xml
  
 
Finally, you can examine other official pisi source packages here: http://svn.pardus.org.tr/pardus/
 
Finally, you can examine other official pisi source packages here: http://svn.pardus.org.tr/pardus/
  
 
[[de:Pisi_Pakete]]
 
[[de:Pisi_Pakete]]

Latest revision as of 11:28, 9 February 2011

Contents

PiSi Package Building

This article tells only the basics of pisi package building. For a detailed version see: Making Pisi Packages

Structure of a PiSi 1.1 Package

A pisi package is essentially a zipped file. Let's download one and examine it:

$ wget http://packages.pardus.org.tr/pardus-2009/knazar-1.1-10-4.pisi
$ unzip knazar-1.1-10-4.pisi -d apackage
Archive:  knazar-1.1-10-4.pis
  inflating: apackage/metadata.xml
  inflating: apackage/files.xml
  inflating: apackage/install.tar.lzma
$ cd apackage
$ ls
files.xml  install.tar.lzma  metadata.xml
$ tar xvf install.tar.lzma

Building a PiSi Package

In order to build a pisi package we need to prepare at least two files by hand: pspec.xml and actions.py

pspec.xml

This file is an XML file containing at least 3 child nodes: Source, Package, History

There can be multiple Package nodes in here.

In other words, one source package may generate multiple binary packages. Pisi is very flexible :)

Let's look at our example here: http://svn.pardus.org.tr/pardus/2009/stable/desktop/kde/addon/knazar/pspec.xml

As you can see in the example,

You may want to examine the dtd file for pisi here: http://www.pardus.org.tr/projeler/pisi/pisi-spec.dtd

Installation of Additional Files from the Files Of the Source Tree

The Package may contain the AdditionalFiles tag, which can be used to copy files from the files subdirectory of your source tree into the .pisi.

E.g., suppose I have a structure like so:

myproject/
myproject/files/somefile.config
myproject/actions.py
myproject/pspec.xml

Then, (one of) the Package(s) can have the following:

   <Package>
       <Name>myproject</Name>
       <Summary>Core of MyProject.</Summary>
       <RuntimeDependencies>
           <Dependency>some-lib</Dependency>
       </RuntimeDependencies>
       <Files>
           <Path fileType="executable">/usr/bin</Path>
       </Files>
       <AdditionalFiles>
           <AdditionalFile target="/etc/path/to/install" permission="0644"                                 
                           owner="root">somefile.config</AdditionalFile>
       </AdditionalFiles>
   </Package>

actions.py

This file contains python codes that would compile and install the source package into a specific InstallDIR (in our example it is /var/pisi/knazar-0.2-3-3/install/)

http://svn.pardus.org.tr/pardus/2009/stable/desktop/kde/addon/knazar/actions.py

In this file, we use actionsapi that comes with pisi. Actions API has all functions for us to compile and install our package.

If you know python, you may want to have a look at sources here: http://svn.pardus.org.tr/uludag/trunk/pisi/pisi/actionsapi/


After preparing pspec.xml and actions.py you can easily form a pisi package by typing:

sudo pisi build pspec.xml

in the console. To compile my example you may type:

sudo pisi bi http://svn.pardus.org.tr/pardus/2009/stable/desktop/kde/addon/knazar/knazar/pspec.xml

Finally, you can examine other official pisi source packages here: http://svn.pardus.org.tr/pardus/

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox
In other languages