Making Pisi Packages

From PardusWiki
(Difference between revisions)
Jump to: navigation, search
Line 38: Line 38:
  
 
As one can see, pisi installs package to /var/pisi/paket_adi/install while it produces  .pisi file. Pisi behaves this directory as it were root system. By examining this directory one can monitor which files go to which directory.
 
As one can see, pisi installs package to /var/pisi/paket_adi/install while it produces  .pisi file. Pisi behaves this directory as it were root system. By examining this directory one can monitor which files go to which directory.
 +
 +
 +
 +
==Pardus SVN Repository==
 +
 +
Pardus SVN repository is a kind of library that you can examine pardus projects and the source files of pisi packages that developers made. You can check how developers made pisi packages for similiar packages that you want to make a pisi package for. You can access this repository from [http://svn.pardus.org.tr/ here]. At that site, there is pisi source files of pisi packages. All answers to "how" questions that new beginners ask actually can be found in source files avaible at Pardus SVN repository. 
 +
 +
 +
 
= PiSi Package Building =
 
= PiSi Package Building =
  
Line 129: Line 138:
  
 
[[de:Pisi_Pakete]]
 
[[de:Pisi_Pakete]]
 +
[[tr:Pardus:PiSi_paketi_yapımı]]

Revision as of 22:15, 5 May 2009

Contents


PİSİ (Packages Installed Successfully as Intended) is a binary package management system which have been developed within Pardus project. PİSİ has more function than just installing/uninstalling packages. For example, it is possible to regain old package setup atomatically. Packages need to be processed as pisi packages and presented as binary packages for using them as pisi packages. For detailed information you can look at Pardus official site


Basics

Package: A program, document or any kind of data for installing to system

Source file: A file that includes files which belongs to package and generally presented as archive files and generally downloadable via internet. Programs generally uses files that are archived as .tar.gz files. Archived files need to include program's non-compiled source code, data that program needs and documents.

Compiling: Operation that needs to be done to make exectuable binary files of programs that is written in compilable programing language like C,C++.

Dependency: Other packages that program uses while it is running or compiling.

Integrity code: This code is being used to verify that any downloaded data has been succesfully downloaded without getting damaged. Sites generally put integrity codes obtained by md5 or sha algorithms for source files. Verifing is done by compraing this code and the code obtained from downloaded data.


Packager's point of view

Adding package to pisi system is more than just making a pisi package. It is a process including gathering information about the package you want to make pisi package of, testing and debugging your pisi package, keeping up with newer versions. A user should start building pisi packages only if user thinks s/he can follow this process. Pisi packages are like the children of the packager and hets replenished with every single debugging and version change. However, unsupervised packages can't live long in the linux world which is growing rapidly. People shouldn't make pisi packages as many as they can, but should make pisi packages as many as they can keep track of. And also don't forget to share your packages from the internet as Linux world is one of the best examples of colloective working. By doing so, you can also find other users who can help you with debugging and keeping track of your package.


Packaging Mechanism

This mechanism is a mechanism that makes binary packages that pisi uses by using source codes. If we omit technical details, process is like following:

As one can see, pisi installs package to /var/pisi/paket_adi/install while it produces .pisi file. Pisi behaves this directory as it were root system. By examining this directory one can monitor which files go to which directory.


Pardus SVN Repository

Pardus SVN repository is a kind of library that you can examine pardus projects and the source files of pisi packages that developers made. You can check how developers made pisi packages for similiar packages that you want to make a pisi package for. You can access this repository from here. At that site, there is pisi source files of pisi packages. All answers to "how" questions that new beginners ask actually can be found in source files avaible at Pardus SVN repository.


PiSi Package Building

Structure of a PiSi 1.1 Package

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
$ unzip knazar-0.2-3-3.pisi -d apackage
Archive:  knazar-0.2-3-3.pisi
  inflating: apackage/metadata.xml
  inflating: apackage/files.xml
  inflating: apackage/install.tar.lzma
$ cd apackage
$ ls
files.xml  install.tar.lzma  metadata.xml
$ lzma -d install.tar.lzma install.tar
$ tar xvf install.tar

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/devel/desktop/kde/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/devel/desktop/kde/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/devel/desktop/kde/knazar/pspec.xml

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

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