Translate/√úbersetzung

Tuesday, 7 January 2014

How to create a Pisi Packages

Creating Package

This document is specifically about creating pspec.xml files. 
This document briefly explains different pieces of pspec.xml and explain them specifically.
If you want to make packages and be a Pisi Linux Package Maintainer please ask us .
You see as example a pspec.xml of the Pogo Audio Player.
If you used Pisi Linux you can build it from here:


With this simple command:

sudo pisi bi https://github.com/pisilinux/playground/raw/master/groni/pogo/pspec.xml

That was a very simple command and with this you can build a lot of Packages from the Github

Creating pspec.xml

You first need to create a pspec.xml file under the package named directory.
See Package Naming Guideline.

Creating Empty pspec.xml File

In order to create an empty pspec.xml file, you only need to run the below command under package named directory.
cd package-name
vi pspec.xml 
or you can use PisiYaP or Pisido
This is the empty pspec.xml
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
    <Name></Name>
    <Homepage>http://</Homepage>
    <Packager>
        <Name></Name>
        <Email></Email>
    </Packager>
    <ExcludeArch></ExcludeArch>
    <License>GPLv2</License>
    <Icon></Icon>
    <IsA></IsA>
    <Summary></Summary>
    <Description></Description>
    <Archive sha1sum="" type="">http://</Archive>
    <BuildDependencies>
        <Dependency></Dependency>
    </BuildDependencies>
    <Patches>
        <Patch level=""></Patch>
    </Patches>
</Source>

<Package>
    <Name></Name>
     <PartOf></PartOf>
     <BuildType></BuildType>
     <BuildFlags>
        <Flag></Flag>
    </BuildFlags>
    <RuntimeDependencies>
        <AnyDependency>
            <Dependency></Dependency>
        </AnyDependency>
        <Dependency versionFrom=""></Dependency>
    </RuntimeDependencies>
     <Conflicts>
        <Package versionTo=""></Package>
        <Package releaseTo=""></Package>
    </Conflicts>
    <Replaces>
        <Package></Package>
        <Package></Package>
    </Replaces>
    <Files>
        <Path fileType="config">/etc</Path>
        <Path fileType="executable">/usr/bin</Path>
        <Path fileType="header">/usr/include</Path>
        <Path fileType="library">/usr/lib</Path>
        <Path fileType="localedata">/usr/share/locale</Path>
        <Path fileType="man">/usr/share/man</Path>
        <Path fileType="doc">/usr/share/doc</Path>
        <Path fileType="data">/usr/share</Path>
    </Files>
    <AdditionalFiles>
        <AdditionalFile owner="root" permission="0644" target=""></AdditionalFile>
    </AdditionalFiles>
    <Provides>
        <COMAR script=""></COMAR>
    </Provides>
</Package>

<History>
    <Update release="" type="">
        <Date>YYYY-MM-DD</Date>
        <Version></Version>
        <Comment>First release.</Comment>
        <Requires>
            <Action>reverseDependencyUpdate</Action>
            <Action package="">reverseDependencyUpdate</Action>
            <Action package="">systemRestart</Action>
            <Action package="">serviceRestart</Action>
        </Requires>
        <Name></Name>
        <Email></Email>
    </Update>
</History>
</PISI>




An example pspec.xml file for pogo audio player package:
<?xml version="1.0" ?>

<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">

<PISI>

    <Source>

        <Name>pogo</Name>

        <Homepage>https://launchpad.net/pogo</Homepage>

        <Packager>

            <Name>Pisi Linux Community</Name>

            <Email>admins@pisilinux.org</Email>

        </Packager>

        <License>GPLv2</License>

        <IsA>app:gui</IsA>

      <Summary>Probably the simplest and fastest audio player for Linux.</Summary>

 <Description>Pogo's elementary-inspired design uses the screen-space very efficiently. It is especially well-suited for people who organize their music by albums on the harddrive. Pogo is a fork of Decibel Audio Player.</Description>

<Archive sha1sum="a44435264d4f32ca6540f4482885ca47977fc2bb" type="targz">https://launchpad.net/pogo/trunk/0.8.2/+download/pogo-0.8.2.tar.gz</Archive>

    </Source>



    <Package>

        <Name>pogo</Name>

        <RuntimeDependencies>

            <Dependency>python</Dependency>

            <Dependency>python-gtk</Dependency>

            <Dependency>gst-python</Dependency>

            <Dependency>python-mutagen</Dependency>

            <Dependency>python-imaging</Dependency>

            <Dependency>notify-python</Dependency>

            <Dependency>gst-plugins-base</Dependency>

            <Dependency>gst-plugins-good</Dependency>

        </RuntimeDependencies>

        <Files>

            <Path fileType="executable">/usr/bin</Path>

            <Path fileType="data">/usr/share</Path>

            <Path fileType="localedata">/usr/share/locale</Path>

            <Path fileType="man">/usr/share/man</Path>

            <Path fileType="doc">/usr/share/doc</Path>

        </Files>

    </Package>



    <History>

        <Update release="1">

            <Date>2013-12-22</Date>

            <Version>0.8.2</Version>

            <Comment>First release</Comment>

            <Name>Stefan Gronewold(groni)</Name>

            <Email>groni@pisilinux.org</Email>

        </Update>

    </History>

</PISI>

Different pspec.xml File Tags

  1. <Source>: This main tag is needed in order to give information about the source of the package.
    1. <Name>: The name of the package is added here. It must follow the Package Naming Guideline. This should be match with the <Name> part of <Package> tag.
    2. <Homepage>: The project page of the package is added here.
    3. <Packager>: The packager name is added <Name>, and email is added to <Email> part.
    4. <ExcludeArch>: When a package could not be compiled for a specific architecture it should be added to pspec.xml file with this tag. You can see different architecture types, look <!– ExcludeArch –> part of pisi-spec.rng file.
    5. <License>: The package license type is added here. See Licensing Guidelines. You can see different license type used, look <!– License –> part of pisi-spec.rng file.
    6. <Icon>: If a package has a gui part, the icon name should be added this part.
    7. <IsA>: This tag is used in order to give the types of the software which the the package includes. One then more IsA type can be used, if it is relevant. You can see different IsA types, look <!– IsA –> part of pisi-spec.rng file.
      Different IsA types used for Pisi Linux packages:
  • app
  • app:console
  • app:gui
  • app:web
  • library
  • service
  • data
  • kernel
  • driver
  • locale
  • locale:aa
  • locale:af
  • locale:am
  • locale:an
  • locale:ar
  • locale:as
  • locale:ast
  • locale:az
  • locale:be
  • locale:ber
  • locale:bg
  • locale:bn
  • locale:bn_IN
  • locale:bo
  • locale:br
  • locale:bs
  • locale:byn
  • locale:ca
  • locale:ca@valencia
  • locale:crh
  • locale:cs
  • locale:csb
  • locale:cy
  • locale:da
  • locale:de
  • locale:dz
  • locale:el
  • locale:en
  • locale:en_CA
  • locale:en_GB
  • locale:eo
  • locale:es
  • locale:et
  • locale:eu
  • locale:fa
  • locale:fi
  • locale:fil
  • locale:fo
  • locale:fr
  • locale:fur
  1. <Summary>: The summary part of the package is added here.
  2. <Description>: The description of the package is added here.
  3. <Archive>: The package source code link, archive type and SHA-1 hashes.
    sha1sum: This attribute is for sha1sum value
    type: This attribute is for archive type. You can see different archive types, look <!– attlist.Archive –> part of pisi-spec.rng file. These are the different archive types used for Pisi Linux:
targz
  • tarbz2
  • tarlzma
  • tarxz
  • tarZ
  • tar
  • zip
  • gz
  • gzip
  • bz2
  • bzip2
  • lzma
  • xz
  • binary
The download link includes between <Archive> tag and the mirrors can also be used.

    1. <BuildDependencies>: This part is used in order to list packages which is required for building (compiling) the package. These dependencies can not be automatically find. So you should try to compile the pacakge in a proper system and you need to include everything needed to build the program. The packages for development environment are not needed to add as a build dependency. You can see the list of packages that will be ignored from here. You need to add all dependencies in a different <Dependency> tag. You can also specify minimum versions or releases of the package. See link for details. You can see different strict dependency types, look <!– attlist.VersionReleaseToFrom –>part of pisi-spec.rng file.
    2. <Patches>: The list of patches added here. Each patch should be added with <Patch> tag and added in the order that they applied. You can see different patch attributes, look<!– attlist.Patch –> part of pisi-spec.rng file.
    The level parameter is needed in order to apply the patch properly. It specifies depth differences of the patch and the file that the patch will be applied.
  1. <Package>: This main tag is needed in order to give package information when it runs on the system.
    1. <Name>: The name of the package is added here. It must follow the Package Naming Guideline. This should be match with the <Name> part of <Source> tag.
    2. <PartOf> If a source contains more than one package, each package can belong to different components. This compenent can be given between <PartOf> tag.
    3. <BuildType> One more than packages can be created from same source, if one of these packages needs a special architecture to build, it should be added with <BuildType> tag. This value can be “32bit” or “64bit”.
    4. <BuildFlags> You can see different build flags types, look <!– Flag –> part of pisi-spec.rng file.
      noDebug flag is used to disable building of a debug package for this package tag.
      noDelta flag is used to disable building of delta packages automatically. It doesn’t change the behaviour of “pisi delta” command.
    5. <BuildDependencies> One more than packages can be created from same source, if one of these packages needs a special dependency to build, it should be added with <BuildDependencies> tag.
    6. <RuntimeDependencies>: This part is used in order to list packages which is required when the program runs. In order to find runtime dependencies please see. You need to add all dependencies in a different <Dependency> tag. You can also specify minimum versions or releases of the package. You can see different strict dependency types, look <!– attlist.VersionReleaseToFrom –> part of pisi-spec.rng file.
    7. <AnyDependency>: This part is used when the package can have more than one dependency for a specific work.
    8. <Conflicts>: This part is used for the packages that conflict with the prapared package.
    9. <Replaces>: The packages that will be replaced with this package, will be added to this part.
    10. <Files>: This part is needed to specify the paths of different file types in the system. All file paths will be used with <Path fileType=”“> tag.
      These are the different file types used for Pisi Linux:
      • config: This is used for the configuration files and those are placed under “/etc” path.
      • executable: This is used for the executable files and those are placed under “/usr/bin” path.
      • header: This is used for header files and those are placed under “/usr/include” path.
      • library: This is used for library files and those are placed under “/usr/lib” path.
      • localedata:” This is used for localisation files and those are placed under “/usr/share/locale” path.
      • man: This is used for manual files and those are placed under /usr/share/man path.
      • doc: This is used for documentation files and those are placed under “/usr/share/doc” path. 
      • data: This is used for shared data files and those are placed under “/usr/share” path.
      • info: This is used for information files and those are placed under “/user/share/info” path.
    11. <AdditionalFiles>: This is used for files that does not exist in the source code and that will directly be installed to the system with the package. So we should give the file path, permission, group and owner for this file.
      target: This attribute is used to specify the file path and name
      permission: This attribute is used for giving file permissions.
      owner: This attribute is used to specify file owner.
      group: This attribute is used to specify file group. The “groups” command will list the groups of the current owner.
      Each file should be added like the below format:
      <AdditionalFile owner="mpd" group="audio" permission="0640" target="/etc/mpd.conf">mpd.conf</AdditionalFile>
      The files is included under files directory of the pisi package.
    12. <Provides>: This part is used for COMAR scripts. There ara two types of scripts used. And these files should be appeared in this part.
  2. <History>: This main tag is needed in order to give information about packaging change history.
    1. <Update>: This part is unclude some other sub tags. It also consists some attributes:
      release: The release number of the change should be gived here.
      type: The type of the change should be gived there. There are two types used for Pardus. For critical changes “critical”, for security changes “security” value are used. You can see different update types, look <!– attlist.Update –> part of pisi-spec.rng file.
    2. <Date>: This part is used for adding the time that the change done. The format should be “YYYY-MM-DD”
    3. <Version>: The version of the package should be written there.
    4. <Comment>: The description of the change should be added here.
    5. <Requires>: There are three type actions can be applied for the package. You can see different require types, look <!– Requires –> part of pisi-spec.rng file.
      • reverseDependencyUpdate: This action should be used, when the package are installed, the packages that are dependent to this package should be updated:
        <Action package="module-fglrx-userspace">reverseDependencyUpdate</Action>
        <Action>reverseDependencyUpdate</Action>
      • systemRestart: This action should be used, when the package are installed, system needs restart:
        <Action package="module-pae-nvidia-current">systemRestart</Action>
        <Action>systemRestart</Action>
      • serviceRestart: This action should be used, when the package are installed, a specific service needs to restart:
        <Action package="dhcp">serviceRestart</Action>
        <Action>systemRestart</Action>
    6. <Name>: The name of the package maintainer that make the change should be added here.
    7. <Email>: The email of the package maintainer that make the change should be added here.

Creating translations.xml

The translations.xml is included in the pisi package source and it is needed for the translations of summary and descriptions. All of the packages should include this file.
This is an empty translations.xml file:
<PISI>
    <Source>
        <Name></Name>
        <Summary xml:lang=""></Summary>
        <Description xml:lang=""></Description>
    </Source>
</PISI>
This is an example translations.xml file:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>pogo</Name>
        <Summary xml:lang="en">Probably the simplest and fastest audio player for Linux.</Summary>
        <Description xml:lang="en">Pogo's elementary-inspired design uses the screen-space very efficiently. It is especially well-suited for people who organize their music by albums on the harddrive. The main interface components are a directory tree and a playlist that groups albums in an innovative way.Supported file formats include Ogg Vorbis, MP3, FLAC, Musepack, Wavpack, and MPEG-4 AAC. Pogo is a fork of Decibel Audio Player.</Description>
    </Source>
</PISI>

Different translations.xml File Tags


  1. <Name>: The name of the package should be added here.
  2. <Summary>: The translation of the summary should be added there. The language type should be gived as a value of “xml:lang” attribute.
  3. <Description>: The translation of the description should be added there. The language type should be gived as a value of “xml:lang” attribute.