code:
#!/usr/bin/env python3
#
# Main fork Pisi: Copyright (C) 2005 - 2011, Tubitak/UEKAE
#
# Copyright (C) 2016 - 2018, Suleyman POYRAZ (AquilaNipalensis)
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.
#

import errno
import traceback
import signal
import sys
import traceback

import inary
import inary.cli
import inary.context as ctx
import inary.db
import inary.errors
import inary.util
from inary.cli import inarycli

import gettext
gettext.bindtextdomain('inary', "/usr/share/locale")
gettext.textdomain('inary')
__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext

def sig_handler(sig, frame):
    if sig == signal.SIGTERM:
        exit()

def exit():
    inary.util.noecho(False)
    sys.exit(1)

def handle_exception(exception, value, tb):
    signal.signal(signal.SIGINT, signal.SIG_IGN)  # disable further interrupts
    ui = inary.cli.CLI()  # make a temporary UI
    show_traceback = False

    if isinstance(value, inary.errors.Error):
        ui.error(_("Program terminated."))
    elif isinstance(value, KeyboardInterrupt):
        ui.error(_("\nKeyboard Interrupt [Ctrl-C]: Exiting..."))
        exit()
    elif isinstance(value, EOFError):
        ui.error(_("\nKeyboard Interrupt [Ctrl-D]: Exiting..."))
        exit()
    elif isinstance(value, inary.errors.Exception):
        show_traceback = True
        ui.error(_("\nUnhandled internal exception.\n"
                   "Please file a bug report to <http://bugs.sulin.org>."))
    elif isinstance(value, IOError) and value.errno == errno.EPIPE:
        # Ignore broken pipe errors
        sys.exit(0)
    else:
        # For any other exception (possibly Python exceptions) show
        # the traceback!
        show_traceback = ctx.get_option('debug')
        ui.error(_("System error. Program terminated."))

    if show_traceback:
        ui.error("{}: {}".format(exception, str(value)))
    else:
        msg = str(value)
        if msg:
            ui.error(msg)

    ui.info(_("Please use 'inary help' for general help."))

    if show_traceback:
        ui.info(_("\nTraceback:"))
        traceback.print_tb(tb)
    elif not isinstance(value, inary.errors.Error):
        ui.info(_("Use --debug to see a traceback."))

    exit()

# This is blocking WSL bash to supply stability of packages
# created by packagers.
def blc_wsl():
    """Dont allow fucking WSL"""
    f=open("/proc/version","r").readline()
    if (("Microsoft" in f) or ("WSL" in f)):
        print(_("Using inary in WSL environment is not allowed."))
        exit()

if __name__ == "__main__":
    blc_wsl()
    inary.util.noecho(True)
    sys.excepthook = handle_exception

    signal.signal(signal.SIGTERM, sig_handler)

    cli = inary.cli.inarycli.InaryCLI()
    if cli.command.name[1] in "rdb sf".split():
        ctx.filesdb = inary.db.filesdb.FilesDB()
    cli.run_command()
    inary.util.noecho(False)

path: inary-cli


code:
<!-- Document Type Declaration file for INARY pspec.xml files -->
<!-- http://www.sulin.org.tr/projeler/inary/ -->

<!ELEMENT INARY (Source,Package+,History)>

<!-- Source Section -->

<!ELEMENT Source (
	#PCDATA |
	Name |
	Homepage |
	Icon |
	Rfp |
	Packager |
	ExcludeArch |
	License |
	IsA |
	PartOf |
	Summary |
	Description |
	Archive |
	AdditionalFiles |
	Patches |
	BuildDependencies
)*>

<!ELEMENT Name (#PCDATA)>

<!ELEMENT Homepage (#PCDATA)>

<!ELEMENT Icon (#PCDATA)>

<!ELEMENT Rfp (#PCDATA)>

<!ELEMENT Packager (Name, Email)>
<!ELEMENT Email (#PCDATA)>

<!ELEMENT ExcludeArch (#PCDATA)>

<!ELEMENT License (#PCDATA)>

<!ELEMENT IsA (#PCDATA)>

<!ELEMENT PartOf (#PCDATA)>

<!ELEMENT Summary (#PCDATA)>
<!ATTLIST Summary xml:lang CDATA #IMPLIED>

<!ELEMENT Description (#PCDATA)>
<!ATTLIST Description xml:lang CDATA #IMPLIED>

<!ELEMENT Archive (#PCDATA)>
<!ATTLIST Archive sha1sum CDATA #REQUIRED>
<!-- NOTE: we can limit possible types here to the ones that inary know -->
<!ATTLIST Archive type CDATA #REQUIRED>
<!ATTLIST Archive target CDATA #IMPLIED>

<!ELEMENT BuildFlags (Flag*)>

<!ELEMENT Flag (#PCDATA)>

<!ELEMENT BuildType (#PCDATA)>

<!ELEMENT BuildDependencies (Dependency*)>

<!ELEMENT Dependency (#PCDATA)>
<!ATTLIST Dependency versionFrom CDATA #IMPLIED>
<!ATTLIST Dependency versionTo CDATA #IMPLIED>
<!ATTLIST Dependency version CDATA #IMPLIED>
<!ATTLIST Dependency releaseFrom CDATA #IMPLIED>
<!ATTLIST Dependency releaseTo CDATA #IMPLIED>
<!ATTLIST Dependency release CDATA #IMPLIED>
<!ATTLIST Dependency type CDATA #IMPLIED>

<!ELEMENT Patches (Patch*)>

<!ELEMENT Patch (#PCDATA)>
<!ATTLIST Patch compressionType CDATA #IMPLIED>
<!ATTLIST Patch level CDATA #IMPLIED>
<!ATTLIST Patch target CDATA #IMPLIED>
<!ATTLIST Patch reverse CDATA #IMPLIED>

<!-- Package Section -->

<!ELEMENT Package (
	#PCDATA |
	Name |
	License |
	Icon |
	Rfp |
	IsA |
	PartOf |
	Summary |
	Description |
	BuildFlags |
	BuildType |
	BuildDependencies |
	RuntimeDependencies |
	Files |
	Conflicts |
	Replaces |
	AdditionalFiles |
	Provides
)*>

<!ELEMENT Provides (SCOM)+>
<!ELEMENT SCOM (#PCDATA)>
<!ATTLIST SCOM script CDATA #IMPLIED>
<!ATTLIST SCOM name CDATA #IMPLIED>

<!ELEMENT Conflicts (Package)+>
<!-- we have a problem here, this Package tag only contains a package name
while dtd treats this as another Package section, who said dtd doesnt
suck anyway -->
<!ATTLIST Package versionFrom CDATA #IMPLIED>
<!ATTLIST Package versionTo CDATA #IMPLIED>
<!ATTLIST Package version CDATA #IMPLIED>
<!ATTLIST Package releaseFrom CDATA #IMPLIED>
<!ATTLIST Package releaseTo CDATA #IMPLIED>
<!ATTLIST Package release CDATA #IMPLIED>

<!ELEMENT Replaces (Package)+>

<!ELEMENT AdditionalFiles (AdditionalFile+)>
<!ELEMENT AdditionalFile (#PCDATA)>
<!ATTLIST AdditionalFile target CDATA #REQUIRED>
<!ATTLIST AdditionalFile permission CDATA #IMPLIED>
<!ATTLIST AdditionalFile owner CDATA #IMPLIED>

<!ELEMENT RuntimeDependencies (Dependency*)>

<!ELEMENT Files (Path)+>

<!ELEMENT Path (#PCDATA)>
<!-- NOTE: is this list correct? -->
<!ATTLIST Path fileType
	(executable|library|data|config|doc|man|info|localedata|header)
	#REQUIRED>
<!ATTLIST Path permanent (false|true) #IMPLIED>
<!ATTLIST Path replace (false|true) #IMPLIED>

<!-- History Section -->

<!ELEMENT History (Update+)>

<!ELEMENT Update (#PCDATA | Date | Version | Comment | Type | Requires | Name | Email)*>
<!ATTLIST Update release CDATA #REQUIRED>
<!ATTLIST Update type (critical|security) #IMPLIED>

<!ELEMENT Date (#PCDATA)>
<!ELEMENT Version (#PCDATA)>
<!ELEMENT Comment (#PCDATA)>

<!ELEMENT Type (#PCDATA)>
<!ATTLIST Type package CDATA #IMPLIED>

<!ELEMENT Requires (Action+)>

<!ELEMENT Action (#PCDATA)>
<!ATTLIST Action package CDATA #IMPLIED>
<!ATTLIST Action target CDATA #IMPLIED>

repo_name: SulinOS/inary

license: mit


code:
<?xml version="1.0" encoding="UTF-8"?>
<!-- RELAX NG schema file for INARY pspec.xml files -->
<!-- http://www.pardus.org.tr/projeler/inary/ -->

<grammar xmlns="http://relaxng.org/ns/structure/1.0">

    <!-- Start Document -->
    <start>
        <ref name="INARY"/>
    </start>

    <!-- INARY Section -->
    <define name="INARY">
        <element name="INARY">
            <ref name="Source"/>
            <oneOrMore>
                <ref name="Package"/>
            </oneOrMore>
            <ref name="History"/>
        </element>
    </define>

    <!-- Source Section -->
    <define name="Source">
        <element name="Source">
            <ref name="Name"/>
            <ref name="Homepage"/>
            <ref name="Packager"/>
            <zeroOrMore>
                <ref name="ExcludeArch"/>
            </zeroOrMore>
            <oneOrMore>
                <ref name="License"/>
            </oneOrMore>
            <optional>
                <ref name="Icon"/>
            </optional>
            <optional>
                <ref name="RFP"/>
            </optional>
            <zeroOrMore>
                <ref name="IsA"/>
            </zeroOrMore>
            <optional>
                <ref name="PartOf"/>
            </optional>
            <oneOrMore>
                <ref name="Summary"/>
            </oneOrMore>
            <zeroOrMore>
                <!-- FIXME: should be oneOrMore -->
                <ref name="Description"/>
            </zeroOrMore>
            <optional>
                <ref name="Archive"/>
            </optional>
            <optional>
                <ref name="AdditionalFiles"/>
            </optional>
            <optional>
                <ref name="BuildDependencies"/>
            </optional>
            <optional>
                <ref name="Patches"/>
            </optional>
        </element>
    </define>

    <!-- Package Section -->
    <define name="Package">
        <element name="Package">
            <ref name="Name"/>
            <optional>
                <ref name="License"/>
            </optional>
            <optional>
                <ref name="Icon"/>
            </optional>
            <optional>
                <ref name="Rfp"/>
            </optional>
            <zeroOrMore>
                <ref name="IsA"/>
            </zeroOrMore>
            <optional>
                <ref name="PartOf"/>
            </optional>
            <zeroOrMore>
                <ref name="Summary"/>
            </zeroOrMore>
            <zeroOrMore>
                <ref name="Description"/>
            </zeroOrMore>
            <optional>
                <ref name="BuildFlags"/>
            </optional>
            <optional>
                <ref name="BuildType"/>
            </optional>
            <optional>
                <ref name="BuildDependencies"/>
            </optional>
            <optional>
                <ref name="RuntimeDependencies"/>
            </optional>
            <optional>
                <ref name="Conflicts"/>
            </optional>
            <optional>
                <ref name="Replaces"/>
            </optional>
            <ref name="Files"/>
            <optional>
                <ref name="AdditionalFiles"/>
            </optional>
            <optional>
                <ref name="Provides"/>
            </optional>
        </element>
    </define>

    <!-- History Section -->
    <define name="History">
        <element name="History">
            <oneOrMore>
                <ref name="Update"/>
            </oneOrMore>
        </element>
    </define>

    <!-- Name -->
    <define name="Name">
        <element name="Name">
            <data type="string" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
                <param name="pattern">[0-9a-zA-Z\-_+]*</param>
                <param name="maxLength">255</param>
            </data>
        </element>
    </define>

    <!-- Homepage -->
    <define name="Homepage">
        <element name="Homepage">
            <text/>
        </element>
    </define>

    <!-- Icon -->
    <define name="Icon">
        <element name="Icon">
            <text/>
        </element>
    </define>

    <!-- Rfp -->
    <define name="RFP">
        <element name="RFP">
            <text/>
        </element>
    </define>

    <!-- Packager -->
    <define name="Packager">
        <element name="Packager">
            <ref name="Packager.Name"/>
            <ref name="Email"/>
        </element>
    </define>

    <!-- Packager.Name -->
    <define name="Packager.Name">
        <element name="Name">
            <data type="string" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
                <param name="maxLength">255</param>
            </data>
        </element>
    </define>

    <!-- Email -->
    <define name="Email">
        <element name="Email">
            <text/>
        </element>
    </define>

    <!-- ExcludeArch -->
    <define name="ExcludeArch">
        <element name="ExcludeArch">
            <choice>
                <value>i686</value>
                <value>x86_64</value>
                <value>armv7l</value>
                <value>armv7h</value>
            </choice>
        </element>
    </define>

    <!-- License -->
    <define name="License">
        <element name="License">
            <choice>
                <value>3DFX</value>
                <value>3proxy</value>
                <value>3ware</value>
                <value>4F</value>
                <value>4Suite</value>
                <value>7plus</value>
                <value>9wm</value>
                <value>ACME</value>
                <value>ACML</value>
                <value>AECA</value>
                <value>AFL-2.0</value>
                <value>AFL-2.1</value>
                <value>AFL-3.0</value>
                <value>AFTERSTEP</value>
                <value>AGPLv3</value>
                <value>AGREP</value>
                <value>AICCU</value>
                <value>ALMWorks-1.2</value>
                <value>AMD</value>
                <value>AMPAS</value>
                <value>AMS</value>
                <value>ANTLR</value>
                <value>APL-1.0</value>
                <value>APSL-2</value>
                <value>ATI</value>
                <value>ATOK</value>
                <value>ATT</value>
                <value>AURA</value>
                <value>AVASYSPL</value>
                <value>Adaptec</value>
                <value>Adobe</value>
                <value>Adobe-SourceCode</value>
                <value>AdobeFlash-9.0.31.0</value>
                <value>Aladdin</value>
                <value>Allegro</value>
                <value>Apache-1.1</value>
                <value>Apache-2.0</value>
                <value>Apple</value>
                <value>Arkkra</value>
                <value>Army-EULA</value>
                <value>Arphic</value>
                <value>Artistic</value>
                <value>Artistic-2</value>
                <value>Atheros</value>
                <value>Atmel</value>
                <value>AvP</value>
                <value>BAEKMUK</value>
                <value>BCS</value>
                <value>BEER-WARE</value>
                <value>BL</value>
                <value>BSD</value>
                <value>BSD-2</value>
                <value>BSD-3</value>
                <value>BWidget</value>
                <value>BZIP2</value>
                <value>Babylon</value>
                <value>BitTorrent</value>
                <value>BitstreamVera</value>
                <value>Blitz-Artistic</value>
                <value>Boost-1.0</value>
                <value>C3</value>
                <value>CAOSL</value>
                <value>CAPS</value>
                <value>CAVER</value>
                <value>CCPL-Attribution-2.0</value>
                <value>CCPL-Attribution-3.0</value>
                <value>CCPL-Attribution-NonCommercial-NoDerivs-2.0</value>
                <value>CCPL-Attribution-NonCommercial-NoDerivs-2.5</value>
                <value>CCPL-Attribution-NonCommercial-NoDerivs-3.0</value>
                <value>CCPL-Attribution-ShareAlike-2.0</value>
                <value>CCPL-Attribution-ShareAlike-2.5</value>
                <value>CCPL-Attribution-ShareAlike-3.0</value>
                <value>CCPL-Attribution-ShareAlike-NonCommercial-2.5</value>
                <value>CCPL-Attribution-ShareAlike-NonCommercial-3.0</value>
                <value>CCPL-ShareAlike-1.0</value>
                <value>CDDL</value>
                <value>CDDL-Schily</value>
                <value>CDF</value>
                <value>CGL</value>
                <value>CMASS-M3</value>
                <value>CMake</value>
                <value>CNRI</value>
                <value>CNRI-QUIXOTE-2.4</value>
                <value>CPL-0.5</value>
                <value>CPL-1.0</value>
                <value>CRACKLIB</value>
                <value>CRULP</value>
                <value>CROSSOVER</value>
                <value>CS-1.0</value>
                <value>Caldera</value>
                <value>CeCILL-2</value>
                <value>CeCILL-B</value>
                <value>Cenon</value>
                <value>Ciphire</value>
                <value>Clarified-Artistic</value>
                <value>Conexant</value>
                <value>Conexant-firmware</value>
                <value>COR-Entertainment-LLC</value>
                <value>CyberNeko-1.0</value>
                <value>D1X</value>
                <value>DB</value>
                <value>DCC</value>
                <value>DEC-M3</value>
                <value>DES</value>
                <value>DMD</value>
                <value>DNS2GO</value>
                <value>DOOM3</value>
                <value>DSL</value>
                <value>DSNIFF</value>
                <value>DUMB-0.9.2</value>
                <value>EAPL</value>
                <value>ECWPL</value>
                <value>EDB</value>
                <value>EPL</value>
                <value>EPL-1.0</value>
                <value>EPSON</value>
                <value>ETQW</value>
                <value>ElementTree</value>
                <value>Elm</value>
                <value>Emacs</value>
                <value>Exolab</value>
                <value>F-PROT</value>
                <value>FDL-1.1</value>
                <value>FDL-1.2</value>
                <value>FDL-1.3</value>
                <value>FESTIVAL</value>
                <value>FIPL-1.0</value>
                <value>FLEX</value>
                <value>FLTK</value>
                <value>FML-1</value>
                <value>FTL</value>
                <value>FVWM</value>
                <value>FastCGI</value>
                <value>FreeArt</value>
                <value>Frodo</value>
                <value>GAlib</value>
                <value>GDLS</value>
                <value>GLX</value>
                <value>GMGPL</value>
                <value>GPLv1</value>
                <value>GPLv2</value>
                <value>GPLv2+</value>
                <value>GPLv2-with-MySQL-FLOSS-exception</value>
                <value>GPLv2-with-exceptions</value>
                <value>GPLv2-with-linking-exception</value>
                <value>GPLv3</value>
                <value>GPLv3+</value>
                <value>GFDLv1</value>
                <value>HBRL</value>
                <value>HKSCS</value>
                <value>HPL</value>
                <value>HYDRA</value>
                <value>Hauppauge-Firmware</value>
                <value>HyperSpec</value>
                <value>IBM</value>
                <value>IBM-ILNWP</value>
                <value>IBM-J1.4</value>
                <value>IBM-J1.5</value>
                <value>IBM-J1.6</value>
                <value>ICE</value>
                <value>IDPL-1</value>
                <value>IPL-1</value>
                <value>IRPDL</value>
                <value>ISC</value>
                <value>ITS4</value>
                <value>Info-ZIP</value>
                <value>Inform</value>
                <value>Intel</value>
                <value>Intel-SDP</value>
                <value>Interbase-1.0</value>
                <value>Introversion</value>
                <value>IRDL</value>
                <value>JDOM</value>
                <value>JNIC</value>
                <value>JPython</value>
                <value>JamesClark</value>
                <value>JasPer</value>
                <value>KQEMU</value>
                <value>KenMacLeod</value>
                <value>Kermit</value>
                <value>LDP</value>
                <value>LDP-1a</value>
                <value>LFS</value>
                <value>LGPLv2</value>
                <value>LGPLv2+</value>
                <value>LGPLv2.1</value>
                <value>LGPLv2.1-FPC</value>
                <value>LGPLv2.1-UUST</value>
                <value>LGPLv2.1-linking-exception</value>
                <value>LGPLv3</value>
                <value>LGPLv3+</value>
                <value>LIBGLOSS</value>
                <value>LICENSE-BITSTREAM</value>
                <value>LLGPL-2.1</value>
                <value>LOKI-EULA</value>
                <value>LPPL-1.2</value>
                <value>LPPL-1.3</value>
                <value>LPPL-1.3b</value>
                <value>LPPL-1.3c</value>
                <value>LRCTF</value>
                <value>MARBLEBLAST</value>
                <value>MBROLA</value>
                <value>MILO</value>
                <value>MIT</value>
                <value>MOTIF</value>
                <value>MPEG4</value>
                <value>MPL-1.0</value>
                <value>MPL-1.1</value>
                <value>MSF-1.2</value>
                <value>MSjdbcEULA</value>
                <value>MSttfEULA</value>
                <value>Macromedia</value>
                <value>MakeIndex</value>
                <value>Memonix</value>
                <value>MonetDBPL-1.1</value>
                <value>MonkeysAudio</value>
                <value>Moria</value>
                <value>Mozart</value>
                <value>NCSA</value>
                <value>NCSA-HDF</value>
                <value>NEWLIB</value>
                <value>NPL-1.1</value>
                <value>NVIDIA</value>
                <value>NWL</value>
                <value>NWN-EULA</value>
                <value>Nero</value>
                <value>Nessus-EULA</value>
                <value>NewArtisans</value>
                <value>No-Problem-Bugroff</value>
                <value>Norvig</value>
                <value>OFL</value>
                <value>OFL-1.1</value>
                <value>OGL-1.0a</value>
                <value>OGTSL</value>
                <value>OPENLDAP</value>
                <value>OPERA-9.0</value>
                <value>OPL</value>
                <value>ORIONSERVER</value>
                <value>OSGPLv0.0</value>
                <value>OSI-Approved</value>
                <value>OSIRIS</value>
                <value>OSL-1.1</value>
                <value>OSL-2.0</value>
                <value>OSML-1.0</value>
                <value>OTN</value>
                <value>Omni</value>
                <value>OpenSoftware</value>
                <value>OpenSymphony-1.1</value>
                <value>OracleDB</value>
                <value>PAM</value>
                <value>PBZIP2</value>
                <value>PDB</value>
                <value>PDFLite</value>
                <value>PEL</value>
                <value>PHP</value>
                <value>PHP-2.02</value>
                <value>PHP-3</value>
                <value>PHP-3.01</value>
                <value>PICO</value>
                <value>PLAN9</value>
                <value>PLDSPv2</value>
                <value>POMPOM</value>
                <value>POSTGRESQL</value>
                <value>PSF-2.2</value>
                <value>PSF-2.3</value>
                <value>PSF-2.4</value>
                <value>PSTT</value>
                <value>PUEL</value>
                <value>PYTHON</value>
                <value>Palm-SDK</value>
                <value>Panda3D</value>
                <value>Pando-EULA</value>
                <value>Parallels</value>
                <value>PathfinderPL-1.1</value>
                <value>PicoContainer</value>
                <value>PlaneShift</value>
                <value>PoseidonCommon.pdf</value>
                <value>Princeton</value>
                <value>Q2EULA</value>
                <value>Q3AEULA</value>
                <value>Qhull</value>
                <value>QPL</value>
                <value>QPL-1.0</value>
                <value>QUAKE4</value>
                <value>RAR</value>
                <value>RDist</value>
                <value>REALbasic</value>
                <value>RSA-MD2</value>
                <value>RSA-MD4</value>
                <value>RSA-MD5</value>
                <value>RSA-PKCS11</value>
                <value>RTCW</value>
                <value>RTCW-ETEULA</value>
                <value>Racer</value>
                <value>Resounding</value>
                <value>RiceBSD</value>
                <value>Roadrunner</value>
                <value>Royalty-Free</value>
                <value>Ruby</value>
                <value>SGI-B</value>
                <value>SGI-B-1.1</value>
                <value>SGMLUG</value>
                <value>SIFT</value>
                <value>SIL-freeware</value>
                <value>SNNS-4.2</value>
                <value>SOPLA-2.3</value>
                <value>SPL</value>
                <value>SVFL</value>
                <value>Scintilla</value>
                <value>Sendmail</value>
                <value>Sendmail-Open-Source</value>
                <value>SixXS</value>
                <value>Sleepycat</value>
                <value>Smart-Link</value>
                <value>Smokin-Guns-1.0</value>
                <value>SpeedTouch-USB-Firmware</value>
                <value>Spice-1.1</value>
                <value>Spread-1.0</value>
                <value>Stanford</value>
                <value>Stuffit</value>
                <value>Subversion</value>
                <value>Sudo</value>
                <value>THINKTANKS</value>
                <value>TeX</value>
                <value>Tinker</value>
                <value>UCAR-Unidata</value>
                <value>UCL</value>
                <value>VGBA</value>
                <value>VIGRA</value>
                <value>VOSTROM</value>
                <value>VPL-1.0</value>
                <value>ValveSDK</value>
                <value>ValveServer</value>
                <value>Volano</value>
                <value>W3C</value>
                <value>W3C-document</value>
                <value>WANPIPE</value>
                <value>WRI-EULA</value>
                <value>WTFPL-2</value>
                <value>WarpPipe</value>
                <value>WebMO</value>
                <value>Werken-1.1.1.1</value>
                <value>WordNet-1.6</value>
                <value>X11</value>
                <value>XAnim</value>
                <value>XCIN</value>
                <value>Xdebug</value>
                <value>XeTeX</value>
                <value>Ximian-logos</value>
                <value>YAZ</value>
                <value>ZBL</value>
                <value>ZLIB</value>
                <value>ZORK</value>
                <value>ZPL</value>
                <value>ZPLv2.0</value>
                <value>ZSH</value>
                <value>ZendFramework-1.1</value>
                <value>aczoom</value>
                <value>adobe-ps</value>
                <value>adom</value>
                <value>aewm</value>
                <value>amiwm</value>
                <value>anubis</value>
                <value>appres</value>
                <value>aquafont</value>
                <value>arj</value>
                <value>as-is</value>
                <value>astrolog</value>
                <value>astromenace</value>
                <value>atheros-hal</value>
                <value>bakoma</value>
                <value>bass</value>
                <value>bdftopcf</value>
                <value>bea.ri.jsr173</value>
                <value>beforelight</value>
                <value>bestcrypt</value>
                <value>bigreqsproto</value>
                <value>bioapi</value>
                <value>bitmap</value>
                <value>blackshades</value>
                <value>bonnie</value>
                <value>bungie-marathon</value>
                <value>cadsoft</value>
                <value>canada-med</value>
                <value>ccc-beta</value>
                <value>ccp4</value>
                <value>cdegroot</value>
                <value>cedega</value>
                <value>charm</value>
                <value>chasen</value>
                <value>chntpw</value>
                <value>circlemud</value>
                <value>cisco</value>
                <value>cisco-vpn-client</value>
                <value>clibpdf</value>
                <value>clustalw</value>
                <value>cmigemo</value>
                <value>cns</value>
                <value>codehaus-classworlds</value>
                <value>codehaus-groovy</value>
                <value>colt</value>
                <value>compaq-sdla</value>
                <value>compositeproto</value>
                <value>cos</value>
                <value>crafty</value>
                <value>crazney</value>
                <value>cryptopp</value>
                <value>damageproto</value>
                <value>dbgphp</value>
                <value>descent2-data</value>
                <value>dgen-sdl</value>
                <value>distributed.net</value>
                <value>dlj-1.1</value>
                <value>dmxproto</value>
                <value>dom4j</value>
                <value>dvibook</value>
                <value>eGenixPublic</value>
                <value>eGenixPublic-1.1</value>
                <value>editres</value>
                <value>egressor</value>
                <value>encodings</value>
                <value>eternal_lands</value>
                <value>evieext</value>
                <value>fixesproto</value>
                <value>fmod</value>
                <value>folding-at-home</value>
                <value>font-adobe-100dpi</value>
                <value>font-adobe-75dpi</value>
                <value>font-adobe-utopia-100dpi</value>
                <value>font-adobe-utopia-75dpi</value>
                <value>font-adobe-utopia-type1</value>
                <value>font-alias</value>
                <value>font-arabic-misc</value>
                <value>font-bh-100dpi</value>
                <value>font-bh-75dpi</value>
                <value>font-bh-lucidatypewriter-100dpi</value>
                <value>font-bh-lucidatypewriter-75dpi</value>
                <value>font-bh-ttf</value>
                <value>font-bh-type1</value>
                <value>font-bitstream-100dpi</value>
                <value>font-bitstream-75dpi</value>
                <value>font-bitstream-speedo</value>
                <value>font-bitstream-type1</value>
                <value>font-cronyx-cyrillic</value>
                <value>font-cursor-misc</value>
                <value>font-daewoo-misc</value>
                <value>font-dec-misc</value>
                <value>font-ibm-type1</value>
                <value>font-isas-misc</value>
                <value>font-jis-misc</value>
                <value>font-micro-misc</value>
                <value>font-misc-cyrillic</value>
                <value>font-misc-ethiopic</value>
                <value>font-misc-meltho</value>
                <value>font-misc-misc</value>
                <value>font-mutt-misc</value>
                <value>font-schumacher-misc</value>
                <value>font-screen-cyrillic</value>
                <value>font-sony-misc</value>
                <value>font-sun-misc</value>
                <value>font-util</value>
                <value>font-winitzki-cyrillic</value>
                <value>font-xfree86-type1</value>
                <value>fontcacheproto</value>
                <value>fontconfig</value>
                <value>fontsproto</value>
                <value>fonttosfnt</value>
                <value>fping</value>
                <value>free-noncomm</value>
                <value>freedist</value>
                <value>freemarker</value>
                <value>freetts</value>
                <value>fslsfonts</value>
                <value>fstobdf</value>
                <value>galaxyhack</value>
                <value>gamess</value>
                <value>gccmakedep</value>
                <value>gips_iLBClicense.pdf</value>
                <value>glest-data</value>
                <value>glimpse</value>
                <value>glproto</value>
                <value>glut</value>
                <value>gnuplot</value>
                <value>google-picasa</value>
                <value>googleearth</value>
                <value>grass-ipafonts</value>
                <value>guild</value>
                <value>hp-value</value>
                <value>hylafax</value>
                <value>hyperic</value>
                <value>iASL</value>
                <value>iceauth</value>
                <value>ico</value>
                <value>icu</value>
                <value>imagemagick</value>
                <value>imake</value>
                <value>informix-jdbc</value>
                <value>inmon-sflow</value>
                <value>inputproto</value>
                <value>ipadic</value>
                <value>ipw2100-fw</value>
                <value>ipw2200-fw</value>
                <value>ipw3945</value>
                <value>isc-dhcp</value>
                <value>iwlwifi-ucode</value>
                <value>ixp4xx</value>
                <value>jardinains</value>
                <value>jaxen</value>
                <value>jcraft</value>
                <value>jdepend</value>
                <value>jlex</value>
                <value>jrockit</value>
                <value>kbproto</value>
                <value>kinterbasdb</value>
                <value>knights-demo</value>
                <value>kvirc</value>
                <value>lbxproxy</value>
                <value>less</value>
                <value>levee</value>
                <value>lha</value>
                <value>libFS</value>
                <value>libICE</value>
                <value>libSM</value>
                <value>libX11</value>
                <value>libXScrnSaver</value>
                <value>libXTrap</value>
                <value>libXau</value>
                <value>libXaw</value>
                <value>libXcomposite</value>
                <value>libXcursor</value>
                <value>libXdamage</value>
                <value>libXdmcp</value>
                <value>libXevie</value>
                <value>libXext</value>
                <value>libXfixes</value>
                <value>libXfont</value>
                <value>libXfontcache</value>
                <value>libXft</value>
                <value>libXi</value>
                <value>libXinerama</value>
                <value>libXmu</value>
                <value>libXp</value>
                <value>libXpm</value>
                <value>libXprintAppUtil</value>
                <value>libXprintUtil</value>
                <value>libXrandr</value>
                <value>libXrender</value>
                <value>libXres</value>
                <value>libXt</value>
                <value>libXtst</value>
                <value>libXv</value>
                <value>libXvMC</value>
                <value>libXxf86dga</value>
                <value>libXxf86misc</value>
                <value>libXxf86vm</value>
                <value>libdmx</value>
                <value>libdomainkeys-1.1</value>
                <value>libdrm</value>
                <value>libf2c</value>
                <value>libffi</value>
                <value>libfontenc</value>
                <value>liblbxutil</value>
                <value>liboldX</value>
                <value>libxkbfile</value>
                <value>libxkbui</value>
                <value>lisp2wish</value>
                <value>listres</value>
                <value>lndir</value>
                <value>lsof</value>
                <value>luit</value>
                <value>maestro</value>
                <value>makedepend</value>
                <value>mammoth</value>
                <value>mapm</value>
                <value>marginalhacks</value>
                <value>maui</value>
                <value>maya-5.0</value>
                <value>mayadoc-5.0</value>
                <value>mekanix</value>
                <value>meme</value>
                <value>mindterm</value>
                <value>mkcfm</value>
                <value>mkfontdir</value>
                <value>mkfontscale</value>
                <value>mmix</value>
                <value>molmol</value>
                <value>molscript</value>
                <value>mongrel</value>
                <value>mopac7</value>
                <value>mplus-fonts</value>
                <value>mserv</value>
                <value>mupad</value>
                <value>mx4j</value>
                <value>myspell-en_CA-JRossBeresford</value>
                <value>myspell-en_CA-KevinAtkinson</value>
                <value>myspell-et_EE-IEL</value>
                <value>myspell-hyph_sk_SK-TiborBako</value>
                <value>myspell-ispell-GeoffKuenning</value>
                <value>myspell-lt_LT-AlbertasAgejevas</value>
                <value>myspell-ru_RU-ALexanderLebedev</value>
                <value>myspell-th_cs_CZ-PavelRychlySmrz</value>
                <value>namd</value>
                <value>nemerle</value>
                <value>nethack</value>
                <value>netlogo</value>
                <value>netperf</value>
                <value>newton</value>
                <value>nhc98</value>
                <value>nomachine</value>
                <value>oclock</value>
                <value>openafs-krb5</value>
                <value>openafs-krb5-a</value>
                <value>openknights</value>
                <value>openmarket</value>
                <value>openpbs</value>
                <value>openspml</value>
                <value>openssl</value>
                <value>oracle-jdbc</value>
                <value>otter</value>
                <value>paraview</value>
                <value>penguzzle</value>
                <value>perforce</value>
                <value>petrify</value>
                <value>pgasync</value>
                <value>phrack</value>
                <value>pixman</value>
                <value>pkcrack</value>
                <value>pmd</value>
                <value>point2play</value>
                <value>postal2</value>
                <value>poster</value>
                <value>povlegal-3.1g</value>
                <value>povlegal-3.5</value>
                <value>povlegal-3.6</value>
                <value>printproto</value>
                <value>proxymngr</value>
                <value>public-domain</value>
                <value>pymol</value>
                <value>pysqlite</value>
                <value>qeradiant</value>
                <value>qlogic-fibre-channel-firmware</value>
                <value>qpage</value>
                <value>qpopper</value>
                <value>quake1-demodata</value>
                <value>quake2-demodata</value>
                <value>queen</value>
                <value>qwt</value>
                <value>randrproto</value>
                <value>recordproto</value>
                <value>renderproto</value>
                <value>resourceproto</value>
                <value>rgb</value>
                <value>richardson</value>
                <value>ringtonetools</value>
                <value>rstart</value>
                <value>ruby-debug</value>
                <value>satan</value>
                <value>saxpath</value>
                <value>scilab</value>
                <value>scripts</value>
                <value>scrnsaverproto</value>
                <value>selfhtml</value>
                <value>sessreg</value>
                <value>setxkbmap</value>
                <value>shoutcast</value>
                <value>showfont</value>
                <value>simpserver-test</value>
                <value>singular</value>
                <value>sip</value>
                <value>skype-eula</value>
                <value>smproxy</value>
                <value>sparky</value>
                <value>ssh</value>
                <value>sslwrap</value>
                <value>staden</value>
                <value>stardock-images</value>
                <value>stix</value>
                <value>sun-asis-javamake</value>
                <value>sun-bcla-j2ee</value>
                <value>sun-bcla-j2ee-deployment</value>
                <value>sun-bcla-j2me</value>
                <value>sun-bcla-jai</value>
                <value>sun-bcla-java-vm</value>
                <value>sun-bcla-java-vm-1.4.2</value>
                <value>sun-bcla-jimi</value>
                <value>sun-bcla-jmf</value>
                <value>sun-bcla-jmi</value>
                <value>sun-bcla-jms</value>
                <value>sun-bcla-jsapi</value>
                <value>sun-bcla-jsr101</value>
                <value>sun-bcla-jta</value>
                <value>sun-bcla-jvmstat</value>
                <value>sun-csl</value>
                <value>sun-j2sl</value>
                <value>sun-j2sl-6</value>
                <value>sun-jdl</value>
                <value>sun-jrl</value>
                <value>sun-jsr67</value>
                <value>sun-jsr93</value>
                <value>sun-openlook</value>
                <value>sun-rpc</value>
                <value>swiss-prot</value>
                <value>szip</value>
                <value>t-coffee</value>
                <value>tacc</value>
                <value>tcp_wrappers_license</value>
                <value>tkMOO</value>
                <value>tlswrap</value>
                <value>trac</value>
                <value>trapproto</value>
                <value>trolltech_PUL-1.0</value>
                <value>truecrypt-collective-1.0</value>
                <value>ttf2pt1</value>
                <value>twm</value>
                <value>unRAR</value>
                <value>ut2003</value>
                <value>ut2003-demo</value>
                <value>util-macros</value>
                <value>ventrilo</value>
                <value>videoproto</value>
                <value>vienna-rna</value>
                <value>viewcvs</value>
                <value>viewres</value>
                <value>vim</value>
                <value>visual</value>
                <value>vlgothic</value>
                <value>vmd</value>
                <value>vmware</value>
                <value>vmware-console</value>
                <value>w3m</value>
                <value>werken.xpath</value>
                <value>whitehead</value>
                <value>wxWinFDL-3</value>
                <value>wxWinLL-3</value>
                <value>x11perf</value>
                <value>xauth</value>
                <value>xbacklight</value>
                <value>xbattle</value>
                <value>xbiff</value>
                <value>xbitmaps</value>
                <value>xboing</value>
                <value>xcalc</value>
                <value>xclipboard</value>
                <value>xclock</value>
                <value>xcmiscproto</value>
                <value>xcmsdb</value>
                <value>xconsole</value>
                <value>xcursor-themes</value>
                <value>xcursorgen</value>
                <value>xdbedizzy</value>
                <value>xditview</value>
                <value>xdm</value>
                <value>xdpyinfo</value>
                <value>xdriinfo</value>
                <value>xearth</value>
                <value>xedit</value>
                <value>xev</value>
                <value>xextproto</value>
                <value>xeyes</value>
                <value>xf86-input-acecad</value>
                <value>xf86-input-aiptek</value>
                <value>xf86-input-calcomp</value>
                <value>xf86-input-citron</value>
                <value>xf86-input-digitaledge</value>
                <value>xf86-input-dmc</value>
                <value>xf86-input-dynapro</value>
                <value>xf86-input-elo2300</value>
                <value>xf86-input-elographics</value>
                <value>xf86-input-evdev</value>
                <value>xf86-input-fpit</value>
                <value>xf86-input-hyperpen</value>
                <value>xf86-input-jamstudio</value>
                <value>xf86-input-joystick</value>
                <value>xf86-input-keyboard</value>
                <value>xf86-input-magellan</value>
                <value>xf86-input-magictouch</value>
                <value>xf86-input-microtouch</value>
                <value>xf86-input-mouse</value>
                <value>xf86-input-mutouch</value>
                <value>xf86-input-palmax</value>
                <value>xf86-input-penmount</value>
                <value>xf86-input-spaceorb</value>
                <value>xf86-input-summa</value>
                <value>xf86-input-tek4957</value>
                <value>xf86-input-ur98</value>
                <value>xf86-input-vmmouse</value>
                <value>xf86-input-void</value>
                <value>xf86-video-apm</value>
                <value>xf86-video-ark</value>
                <value>xf86-video-ati</value>
                <value>xf86-video-chips</value>
                <value>xf86-video-cirrus</value>
                <value>xf86-video-cyrix</value>
                <value>xf86-video-dummy</value>
                <value>xf86-video-fbdev</value>
                <value>xf86-video-geode</value>
                <value>xf86-video-glint</value>
                <value>xf86-video-i128</value>
                <value>xf86-video-i740</value>
                <value>xf86-video-i810</value>
                <value>xf86-video-impact</value>
                <value>xf86-video-imstt</value>
                <value>xf86-video-mga</value>
                <value>xf86-video-neomagic</value>
                <value>xf86-video-newport</value>
                <value>xf86-video-nsc</value>
                <value>xf86-video-nv</value>
                <value>xf86-video-rendition</value>
                <value>xf86-video-s3</value>
                <value>xf86-video-s3virge</value>
                <value>xf86-video-savage</value>
                <value>xf86-video-siliconmotion</value>
                <value>xf86-video-sis</value>
                <value>xf86-video-sisusb</value>
                <value>xf86-video-sunbw2</value>
                <value>xf86-video-suncg14</value>
                <value>xf86-video-suncg3</value>
                <value>xf86-video-suncg6</value>
                <value>xf86-video-sunffb</value>
                <value>xf86-video-sunleo</value>
                <value>xf86-video-suntcx</value>
                <value>xf86-video-tdfx</value>
                <value>xf86-video-tga</value>
                <value>xf86-video-trident</value>
                <value>xf86-video-tseng</value>
                <value>xf86-video-v4l</value>
                <value>xf86-video-vermilion</value>
                <value>xf86-video-vesa</value>
                <value>xf86-video-vga</value>
                <value>xf86-video-via</value>
                <value>xf86-video-vmware</value>
                <value>xf86-video-voodoo</value>
                <value>xf86-video-xgi</value>
                <value>xf86bigfontproto</value>
                <value>xf86dga</value>
                <value>xf86dgaproto</value>
                <value>xf86driproto</value>
                <value>xf86miscproto</value>
                <value>xf86rushproto</value>
                <value>xf86vidmodeproto</value>
                <value>xfd</value>
                <value>xfindproxy</value>
                <value>xfontsel</value>
                <value>xfs</value>
                <value>xfsinfo</value>
                <value>xfwp</value>
                <value>xgamma</value>
                <value>xgc</value>
                <value>xhost</value>
                <value>xineramaproto</value>
                <value>xinit</value>
                <value>xiph</value>
                <value>xkbcomp</value>
                <value>xkbdata</value>
                <value>xkbevd</value>
                <value>xkbprint</value>
                <value>xkbutils</value>
                <value>xkill</value>
                <value>xload</value>
                <value>xlogo</value>
                <value>xlsatoms</value>
                <value>xlsclients</value>
                <value>xlsfonts</value>
                <value>xmag</value>
                <value>xmame</value>
                <value>xman</value>
                <value>xmessage</value>
                <value>xmh</value>
                <value>xmlformat</value>
                <value>xmodmap</value>
                <value>xmore</value>
                <value>xorg-cf-files</value>
                <!-- FIXME: Remove following after 2007 - caglar10ur -->
                <value>xorg-data</value>
                <value>xorg-docs</value>
                <value>xorg-server</value>
                <value>xorg-sgml-doctools</value>
                <value>xphelloworld</value>
                <value>xplsprinters</value>
                <value>xpr</value>
                <value>xprehashprinterlist</value>
                <value>xprop</value>
                <value>xproto</value>
                <value>xproxymanagementprotocol</value>
                <value>xrandr</value>
                <value>xrdb</value>
                <value>xref.lisp</value>
                <value>xrefresh</value>
                <value>xrx</value>
                <value>xset</value>
                <value>xsetmode</value>
                <value>xsetpointer</value>
                <value>xsetroot</value>
                <value>xshipwars</value>
                <value>xsm</value>
                <value>xstdcmap</value>
                <value>xtrans</value>
                <value>xtrap</value>
                <value>xv</value>
                <value>xvidtune</value>
                <value>xvinfo</value>
                <value>xwd</value>
                <value>xwininfo</value>
                <value>xwud</value>
                <value>zend-optimizer</value>
                <value>zoo</value>
            </choice>
        </element>
    </define>

    <!-- IsA -->
    <define name="IsA">
        <element name="IsA">
            <choice>
                <value>app</value>
                <value>app:console</value>
                <value>app:gui</value>
                <value>app:web</value>
                <value>library</value>
                <value>service</value>
                <value>data</value>
                <value>data:doc</value>
                <value>data:font</value>
                <value>header</value>
                <value>kernel</value>
                <value>driver</value>
                <value>locale</value>
                <value>locale:aa</value>
                <value>locale:af</value>
                <value>locale:am</value>
                <value>locale:an</value>
                <value>locale:ar</value>
                <value>locale:as</value>
                <value>locale:ast</value>
                <value>locale:az</value>
                <value>locale:be</value>
                <value>locale:ber</value>
                <value>locale:bg</value>
                <value>locale:bn</value>
                <value>locale:bn_IN</value>
                <value>locale:bo</value>
                <value>locale:br</value>
                <value>locale:bs</value>
                <value>locale:byn</value>
                <value>locale:ca</value>
                <value>locale:ca@valencia</value>
                <value>locale:crh</value>
                <value>locale:cs</value>
                <value>locale:csb</value>
                <value>locale:cv</value>
                <value>locale:cy</value>
                <value>locale:da</value>
                <value>locale:de</value>
                <value>locale:dv</value>
                <value>locale:dz</value>
                <value>locale:el</value>
                <value>locale:en</value>
                <value>locale:en_CA</value>
                <value>locale:en_GB</value>
                <value>locale:eo</value>
                <value>locale:es</value>
                <value>locale:et</value>
                <value>locale:eu</value>
                <value>locale:fa</value>
                <value>locale:fi</value>
                <value>locale:fil</value>
                <value>locale:fo</value>
                <value>locale:fr</value>
                <value>locale:fur</value>
                <value>locale:fy</value>
                <value>locale:ga</value>
                <value>locale:gd</value>
                <value>locale:gez</value>
                <value>locale:gl</value>
                <value>locale:gu</value>
                <value>locale:gv</value>
                <value>locale:ha</value>
                <value>locale:he</value>
                <value>locale:hi</value>
                <value>locale:hne</value>
                <value>locale:hr</value>
                <value>locale:hsb</value>
                <value>locale:ht</value>
                <value>locale:hu</value>
                <value>locale:hy</value>
                <value>locale:id</value>
                <value>locale:ig</value>
                <value>locale:ik</value>
                <value>locale:is</value>
                <value>locale:it</value>
                <value>locale:iu</value>
                <value>locale:iw</value>
                <value>locale:ja</value>
                <value>locale:ka</value>
                <value>locale:kk</value>
                <value>locale:kl</value>
                <value>locale:km</value>
                <value>locale:kn</value>
                <value>locale:ko</value>
                <value>locale:kok</value>
                <value>locale:ks</value>
                <value>locale:ku</value>
                <value>locale:kw</value>
                <value>locale:ky</value>
                <value>locale:lg</value>
                <value>locale:li</value>
                <value>locale:lo</value>
                <value>locale:lt</value>
                <value>locale:lv</value>
                <value>locale:mai</value>
                <value>locale:mg</value>
                <value>locale:mi</value>
                <value>locale:mk</value>
                <value>locale:ml</value>
                <value>locale:mn</value>
                <value>locale:mr</value>
                <value>locale:ms</value>
                <value>locale:mt</value>
                <value>locale:my</value>
                <value>locale:nan</value>
                <value>locale:nb</value>
                <value>locale:nds</value>
                <value>locale:ne</value>
                <value>locale:nl</value>
                <value>locale:nn</value>
                <value>locale:no</value>
                <value>locale:nr</value>
                <value>locale:nso</value>
                <value>locale:oc</value>
                <value>locale:om</value>
                <value>locale:or</value>
                <value>locale:pa</value>
                <value>locale:pap</value>
                <value>locale:pl</value>
                <value>locale:ps</value>
                <value>locale:pt</value>
                <value>locale:pt_BR</value>
                <value>locale:ro</value>
                <value>locale:ru</value>
                <value>locale:rw</value>
                <value>locale:sa</value>
                <value>locale:sc</value>
                <value>locale:sd</value>
                <value>locale:se</value>
                <value>locale:shs</value>
                <value>locale:si</value>
                <value>locale:sid</value>
                <value>locale:sk</value>
                <value>locale:sl</value>
                <value>locale:so</value>
                <value>locale:sq</value>
                <value>locale:sr</value>
                <value>locale:sr@Latn</value>
                <value>locale:ss</value>
                <value>locale:st</value>
                <value>locale:sv</value>
                <value>locale:ta</value>
                <value>locale:te</value>
                <value>locale:tg</value>
                <value>locale:th</value>
                <value>locale:ti</value>
                <value>locale:tig</value>
                <value>locale:tk</value>
                <value>locale:tl</value>
                <value>locale:tn</value>
                <value>locale:tr</value>
                <value>locale:ts</value>
                <value>locale:tt</value>
                <value>locale:ug</value>
                <value>locale:uk</value>
                <value>locale:ur</value>
                <value>locale:uz</value>
                <value>locale:uz@cyrillic</value>
                <value>locale:ve</value>
                <value>locale:ven</value>
                <value>locale:vi</value>
                <value>locale:wa</value>
                <value>locale:wo</value>
                <value>locale:xh</value>
                <value>locale:yi</value>
                <value>locale:yo</value>
                <value>locale:zh</value>
                <value>locale:zh_CN</value>
                <value>locale:zh_HK</value>
                <value>locale:zh_TW</value>
                <value>locale:zu</value>
            </choice>
        </element>
    </define>

    <!-- PartOf -->
    <define name="PartOf">
        <element name="PartOf">
            <text/>
        </element>
    </define>

    <!-- Summary -->
    <define name="Summary">
        <element name="Summary">
            <ref name="attlist.Summary"/>
            <text/>
        </element>
    </define>
    <!-- attlist.Summary -->
    <define name="attlist.Summary" combine="interleave">
        <optional>
            <attribute name="xml:lang"/>
        </optional>
    </define>

    <!-- Description -->
    <define name="Description">
        <element name="Description">
            <ref name="attlist.Description"/>
            <text/>
        </element>
    </define>
    <!-- attlist.Description -->
    <define name="attlist.Description" combine="interleave">
        <optional>
            <attribute name="xml:lang"/>
        </optional>
    </define>

    <!-- Archive -->
    <define name="Archive">
        <element name="Archive">
            <ref name="attlist.Archive"/>
            <text/>
        </element>
    </define>
    <!-- attlist.Archive -->
    <define name="attlist.Archive" combine="interleave">
        <group>
            <attribute name="sha1sum"/>
            <optional>
                <attribute name="type">
                    <choice>
                        <value>targz</value>
                        <value>tarbz2</value>
                        <value>tarlzma</value>
                        <value>tarxz</value>
                        <value>tarZ</value>
                        <value>tar</value>
                        <value>zip</value>
                        <value>gz</value>
                        <value>gzip</value>
                        <value>bz2</value>
                        <value>bzip2</value>
                        <value>lzma</value>
                        <value>xz</value>
                        <value>7z</value>
                        <value>binary</value>
                    </choice>
                </attribute>
            </optional>
            <optional>
                <attribute name="target"/>
            </optional>
            <optional>
                <attribute name="save_as"/>
            </optional>
        </group>
    </define>

    <!-- BuildFlags -->
    <define name="BuildFlags">
        <element name="BuildFlags">
            <oneOrMore>
                <ref name="Flag"/>
            </oneOrMore>
        </element>
    </define>

    <!-- Flag -->
    <define name="Flag">
        <element name="Flag">
            <choice>
                <value>noDebug</value>
                <value>noDelta</value>
            </choice>
        </element>
    </define>

    <!-- BuildType -->
    <define name="BuildType">
        <element name="BuildType">
            <text/>
        </element>
    </define>

    <!-- BuildDependencies -->
    <define name="BuildDependencies">
        <element name="BuildDependencies">
            <oneOrMore>
                <ref name="Dependency"/>
            </oneOrMore>
        </element>
    </define>

    <!-- Dependency -->
    <define name="Dependency">
        <element name="Dependency">
            <ref name="attlist.VersionReleaseToFrom"/>
            <text/>
        </element>
    </define>

    <!-- AnyDependency -->
    <define name="AnyDependency">
        <element name="AnyDependency">
            <oneOrMore>
                <ref name="Dependency"/>
            </oneOrMore>
        </element>
    </define>

    <!-- attlist.VersionReleaseToFrom -->
    <define name="attlist.VersionReleaseToFrom">
        <group>
            <optional>
                <attribute name="versionFrom"/>
            </optional>
            <optional>
                <attribute name="versionTo"/>
            </optional>
            <optional>
                <attribute name="version"/>
            </optional>
            <optional>
                <attribute name="releaseFrom"/>
            </optional>
            <optional>
                <attribute name="releaseTo"/>
            </optional>
            <optional>
                <attribute name="release"/>
            </optional>
        </group>
    </define>

    <!-- Patches -->
    <define name="Patches">
        <element name="Patches">
            <oneOrMore>
                <ref name="Patch"/>
            </oneOrMore>
        </element>
    </define>

    <!-- Patch -->
    <define name="Patch">
        <element name="Patch">
            <ref name="attlist.Patch"/>
            <text/>
        </element>
    </define>
    <!-- attlist.Patch -->
    <define name="attlist.Patch" combine="interleave">
        <group>
            <optional>
                <attribute name="compressionType"/>
            </optional>
            <optional>
                <attribute name="level"/>
            </optional>
            <optional>
                <attribute name="target"/>
            </optional>
            <optional>
                <attribute name="reverse"/>
            </optional>
        </group>
    </define>

    <!-- Provides -->
    <define name="Provides">
        <element name="Provides">
            <oneOrMore>
                <ref name="SCOM"/>
            </oneOrMore>
        </element>
    </define>

    <!-- SCOM -->
    <define name="SCOM">
        <element name="SCOM">
            <ref name="attlist.SCOM"/>
            <text/>
        </element>
    </define>
    <!-- attlist.SCOM -->
    <define name="attlist.SCOM">
        <optional>
            <attribute name="script"/>
        </optional>
        <optional>
            <attribute name="name"/>
        </optional>
    </define>

    <!-- Conflicts -->
    <define name="Conflicts">
        <element name="Conflicts">
            <oneOrMore>
                <ref name="Conflicts.Package"/>
            </oneOrMore>
        </element>
    </define>

    <define name="Conflicts.Package">
        <element name="Package">
            <ref name="attlist.VersionReleaseToFrom"/>
            <text />
        </element>
    </define>

    <!-- Replaces -->
    <define name="Replaces">
        <element name="Replaces">
            <oneOrMore>
                <ref name="Replaces.Package"/>
            </oneOrMore>
        </element>
    </define>

    <define name="Replaces.Package">
        <element name="Package">
            <text />
        </element>
    </define>

    <!-- AdditionalFiles -->
    <define name="AdditionalFiles">
        <element name="AdditionalFiles">
            <oneOrMore>
                <ref name="AdditionalFile"/>
            </oneOrMore>
        </element>
    </define>

    <!-- AdditionalFile -->
    <define name="AdditionalFile">
        <element name="AdditionalFile">
            <ref name="attlist.AdditionalFile"/>
            <text/>
        </element>
    </define>
    <!-- attlist.AdditionalFile -->
    <define name="attlist.AdditionalFile">
        <attribute name="target"/>
        <optional>
            <attribute name="permission"/>
        </optional>
        <optional>
            <attribute name="owner"/>
        </optional>
        <optional>
            <attribute name="group"/>
        </optional>
    </define>

    <!-- RuntimeDependencies -->
    <define name="RuntimeDependencies">
        <element name="RuntimeDependencies">
            <choice>
                <oneOrMore>
                    <ref name="AnyDependency"/>
                </oneOrMore>
                <oneOrMore>
                    <ref name="Dependency"/>
                </oneOrMore>
                <group>
                    <oneOrMore>
                        <ref name="AnyDependency"/>
                    </oneOrMore>
                    <oneOrMore>
                        <ref name="Dependency"/>
                    </oneOrMore>
                </group>
            </choice>
        </element>
    </define>

    <!-- Files -->
    <define name="Files">
        <element name="Files">
            <oneOrMore>
                <ref name="Path"/>
            </oneOrMore>
        </element>
    </define>

    <!-- Path -->
    <define name="Path">
        <element name="Path">
            <ref name="attlist.Path"/>
            <text/>
        </element>
    </define>
    <!-- attlist.Path -->
    <define name="attlist.Path" combine="interleave">
        <group>
            <attribute name="fileType">
                <choice>
                    <value>executable</value>
                    <value>library</value>
                    <value>data</value>
                    <value>config</value>
                    <value>doc</value>
                    <value>man</value>
                    <value>info</value>
                    <value>localedata</value>
                    <value>header</value>
                </choice>
            </attribute>
            <optional>
                <attribute name="permanent">
                    <choice>
                        <value>false</value>
                        <value>true</value>
                    </choice>
                </attribute>
            </optional>
            <optional>
                <attribute name="replace">
                    <choice>
                        <value>false</value>
                        <value>true</value>
                    </choice>
                </attribute>
            </optional>
        </group>
    </define>

    <!-- Update -->
    <define name="Update">
        <element name="Update">
            <ref name="attlist.Update"/>
            <ref name="Date"/>
            <ref name="Version"/>
            <ref name="Comment"/>
            <zeroOrMore>
                <ref name="Type"/>
            </zeroOrMore>
            <optional>
                <ref name="Requires"/>
            </optional>
            <ref name="Packager.Name"/>
            <ref name="Email"/>
        </element>
    </define>

    <!-- attlist.Update -->
    <define name="attlist.Update" combine="interleave">
        <attribute name="release"/>
        <optional>
            <attribute name="type">
                <choice>
                    <value>critical</value>
                    <value>security</value>
                </choice>
            </attribute>
        </optional>
    </define>

    <!-- Date -->
    <define name="Date">
        <element name="Date">
            <data type="date" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"/>
        </element>
    </define>

    <!-- Version -->
    <define name="Version">
        <element name="Version">
            <text/>
        </element>
    </define>

    <!-- Comment -->
    <define name="Comment">
        <element name="Comment">
            <text/>
        </element>
    </define>

    <!-- Type -->
    <define name="Type">
        <element name="Type">
            <ref name="attlist.Type"/>
            <choice>
                <value>critical</value>
                <value>security</value>
            </choice>
        </element>
    </define>

    <!-- attlist.Type -->
    <define name="attlist.Type" combine="interleave">
        <optional>
            <attribute name="package"/>
        </optional>
    </define>

    <!-- Requires -->
    <define name="Requires">
        <element name="Requires">
            <oneOrMore>
                <ref name="Action"/>
            </oneOrMore>
        </element>
    </define>

    <!-- Action -->
    <define name="Action">
        <element name="Action">
            <ref name="attlist.Action"/>
            <choice>
                <value>reverseDependencyUpdate</value>
                <value>systemRestart</value>
                <value>serviceRestart</value>
            </choice>
        </element>
    </define>

    <!-- attlist.Action -->
    <define name="attlist.Action" combine="interleave">
        <optional>
            <attribute name="package"/>
        </optional>
        <optional>
            <attribute name="target"/>
        </optional>
    </define>
</grammar>


code:
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
  <mime-type type="application/x-inary">
    <_comment>Inary package</_comment>
    <glob pattern="*.inary"/>
  </mime-type>
</mime-info>


code:
# -*- coding: utf-8 -*-
#
# Main fork Pisi: Copyright (C) 2005 - 2011, Tubitak/UEKAE
#
# Copyright (C) 2016 - 2018, Suleyman POYRAZ (Zaryob)
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.
#

# INARY version

import atexit
import importlib
import logging
import logging.handlers
import os
import sys

__version__ = "1.0"

__all__ = ['api', 'configfile', 'db', 'util', '_cleanup']

import inary.api
import inary.config
import inary.context as ctx

def init_logging():
    log_dir = os.path.join(ctx.config.dest_dir(), ctx.config.log_dir())
    if os.access(log_dir, os.W_OK) and "distutils.core" not in sys.modules:
        handler = logging.handlers.RotatingFileHandler('{}/inary.log'.format(log_dir))
        formatter = logging.Formatter('%(asctime)s  %(name)s(%(module)12s:%(lineno)4d)  %(levelname).1s  %(message)s')
        handler.setFormatter(formatter)
        ctx.log = logging.getLogger('inary')
        ctx.log.addHandler(handler)
        ctx.loghandler = handler
        ctx.log.setLevel(logging.DEBUG)

def _cleanup():
    """Close the database cleanly and do other cleanup."""
    ctx.disable_keyboard_interrupts()
    if ctx.log:
        ctx.loghandler.flush()
        ctx.log.removeHandler(ctx.loghandler)

    #    filesdb = inary.db.filesdb.FilesDB()
    #    if filesdb.is_initialized():
    #        filesdb.close()

    if ctx.build_leftover and os.path.exists(ctx.build_leftover):
        os.unlink(ctx.build_leftover)

    ctx.ui.close()
    ctx.enable_keyboard_interrupts()

# Hack for inary to work with non-patched Python. inary needs
# lots of work for not doing this.
importlib.reload(sys)

atexit.register(_cleanup)

ctx.config = inary.config.Config()
init_logging()


code:
for managing CFLAGS, CXXFLAGS and LDFLAGS you can use inarytools
for CFLAGGS -> inarytools.cflags
for LDFLAGGS -> inarytools.ldflags
for CXXFLAGGS -> inarytools.cxxflags
for both CFLAGGS and CXXFLAGS -> inarytools.flags

available operations:

add("param1", "param2", ..., "paramN")
e.g.
inarytools.cxxflags.add("-fpermisive")
  -> shelltools.export("CXXFLAGS", "{} -fpermisive".format(get.CXXFLAGS()))
inarytools.flags.add("-fno-strict-aliasing", "-fPIC")
  -> shelltools.export("CFLAGS", "{} -fno-strict-aliasing -fPIC".format(get.CFLAGS()))
  -> shelltools.export("CXXFLAGS", "{} -ffno-strict-aliasing -fPIC".format(get.CXXFLAGS()))

remove("param1", "param2", ..., "paramN")
e.g.
inarytools.cflags.remove("-fno-strict-aliasing")
  -> shelltools.export("CFLAGS", get.CFLAGS().replace("-fno-strict-aliasing", ""))

replace("old value", "new value")
e.g.
inarytools.cflags.replace("-O2", "-O3")
  -> shelltools.export("CFLAGS", get.CFLAGS().replace("-O2", "-O3"))

sub(pattern, repl, count, flags)
works like re.sub(pattern, repl, string, count, flags) for specified flags
e.g.
inarytools.cflags.replace("-O\d", "-Os")
  -> import re
  -> shelltools.export("CFLAGS", re.sub("-O\d", "-Os", get.CFLAGS()))


code:
TODO
-----

(-) Add filter_flags, disable_as_needed, disable_no_undefined functions
(-) inarytools.dobin() needs a destinationFile parameter to rename the binary
(-) inarytools.dodoc() may need an optional mode parameter for chmodding installed
    documents
(-) inarytools.dodoc() does not allow passing a directory as source
(-) rename() could be dropped in favor of move()
(-) inarytools.dosed() does not provide all sed functionality. It only supports
    substitution. Rename the function or add support for other sed commands.
(-) It is not clear which function takes source file paths relative to workDir or
    relative to installDir (dosed, insinto -> workDir, rename -> installDir).
    We may consider using different module names to distinguish these like
    sourceutils, installutils, etc.

path: inary/actionsapi/TODO


code:
# -*- coding: utf-8 -*-
#
# Main fork Pisi: Copyright (C) 2005 - 2011, Tubitak/UEKAE
#
# Copyright (C) 2016 - 2018, Suleyman POYRAZ (Zaryob)
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.
#

import inary.context as ctx
import inary.errors

class Error(inary.errors.Error):
    pass

class Exception(inary.errors.Exception):
    pass

def error(msg):
    if ctx.config.get_option('ignore_action_errors'):
        ctx.ui.error(msg)
    else:
        raise Error(msg)


code:
# -*- coding: utf-8 -*-
#
# Main fork Pisi: Copyright (C) 2005 - 2011, Tubitak/UEKAE
#
# Copyright (C) 2016 - 2018, Suleyman POYRAZ (Zaryob)
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.

# Standard Python Modules
import os

import gettext

__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext

# Inary Modules
import inary.context as ctx

# ActionsAPI Modules
import inary.actionsapi
import inary.actionsapi.get as get
from inary.actionsapi.shelltools import system
from inary.actionsapi.shelltools import can_access_file
from inary.actionsapi.shelltools import unlink
from inary.actionsapi.libtools import gnuconfig_update
from inary.actionsapi.shelltools import isDirectory
from inary.actionsapi.shelltools import ls
from inary.actionsapi.inarytools import dosed
from inary.actionsapi.inarytools import removeDir

class ConfigureError(inary.actionsapi.Error):
    def __init__(self, value=''):
        inary.actionsapi.Error.__init__(self, value)
        self.value = value
        ctx.ui.error("[AutoTools]: " + value)
        if can_access_file('config.log'):
            ctx.ui.error(_('Please attach the config.log to your bug report:\n{}/config.log').format(os.getcwd()))

class MakeError(inary.actionsapi.Error):
    def __init__(self, value=''):
        inary.actionsapi.Error.__init__(self, value)
        self.value = value
        ctx.ui.error("[AutoTools]: " + value)

class CompileError(inary.actionsapi.Error):
    def __init__(self, value=''):
        inary.actionsapi.Error.__init__(self, value)
        self.value = value
        ctx.ui.error("[AutoTools]: " + value)

class InstallError(inary.actionsapi.Error):
    def __init__(self, value=''):
        inary.actionsapi.Error.__init__(self, value)
        self.value = value
        ctx.ui.error("[AutoTools]: " + value)

class RunTimeError(inary.actionsapi.Error):
    def __init__(self, value=''):
        inary.actionsapi.Error.__init__(self, value)
        self.value = value
        ctx.ui.error("[AutoTools]: " + value)

def configure(parameters=''):
    """configure source with given parameters = "--with-nls --with-libusb --with-something-usefull"""

    if can_access_file('configure'):
        gnuconfig_update()

        prefix = get.emul32prefixDIR() if get.buildTYPE() == "emul32" else get.defaultprefixDIR()
        args = './configure \
                --prefix=/{0} \
                --build={1} \
                --mandir=/{2} \
                --infodir=/{3} \
                --datadir=/{4} \
                --sysconfdir=/{5} \
                --localstatedir=/{6} \
                --libexecdir=/{7} \
                {8}{9}'.format(prefix, get.HOST(), get.manDIR(), get.infoDIR(),
                               get.dataDIR(), get.confDIR(), get.localstateDIR(), get.libexecDIR(),
                               "--libdir=/usr/lib32 " if get.buildTYPE() == "emul32" else "",
                               parameters)

        if system(args):
            raise ConfigureError(_('Configure failed.'))
    else:
        raise ConfigureError(_('No configure script found. (\"{}\" file not found.)'.format("configure")))

def rawConfigure(parameters=''):
    """configure source with given parameters = --prefix=/usr --libdir=/usr/lib --with-nls """
    if can_access_file('configure'):
        gnuconfig_update()

        if system('./configure {}'.format(parameters)):
            raise ConfigureError(_('Configure failed.'))
    else:
        raise ConfigureError(_('No configure script found. (\"{}\" file not found.)'.format("configure")))

def compile(parameters=''):
    if system('{0} {1} {2}'.format(get.CC(), get.CFLAGS(), parameters)):
        raise CompileError(_('Compiling failed.'))

def make(parameters=''):
    """make source with given parameters = "all" || "doc" etc."""
    if system('make {0} {1}'.format(get.makeJOBS(), parameters)):
        raise MakeError(_('Make failed.'))

def fixInfoDir():
    infoDir = '{}/usr/share/info/dir'.format(get.installDIR())
    if can_access_file(infoDir):
        unlink(infoDir)

def fixpc():
    """ fix .pc files in installDIR()/usr/lib32/pkgconfig"""
    path = "{}/usr/lib32/pkgconfig".format(get.installDIR())
    if isDirectory(path):
        for f in ls("{}/*.pc".format(path)):
            dosed(f, get.emul32prefixDIR(), get.defaultprefixDIR())

def install(parameters='', argument='install'):
    """install source into install directory with given parameters"""
    args = 'make prefix={0}/{1} \
            datadir={0}/{2} \
            infodir={0}/{3} \
            localstatedir={0}/{4} \
            mandir={0}/{5} \
            sysconfdir={0}/{6} \
            {7} \
            {8}'.format(get.installDIR(),
                        get.defaultprefixDIR(),
                        get.dataDIR(),
                        get.infoDIR(),
                        get.localstateDIR(),
                        get.manDIR(),
                        get.confDIR(),
                        parameters,
                        argument)

    if system(args):
        raise InstallError(_('Install failed.'))
    else:
        fixInfoDir()

    if get.buildTYPE() == "emul32":
        fixpc()
        if isDirectory("{}/emul32".format(get.installDIR())): removeDir("/emul32")

def rawInstall(parameters='', argument='install'):
    """install source into install directory with given parameters = PREFIX=get.installDIR()"""
    if system('make {0} {1}'.format(parameters, argument)):
        raise InstallError(_('Install failed.'))
    else:
        fixInfoDir()

    if get.buildTYPE() == "emul32":
        fixpc()
        if isDirectory("{}/emul32".format(get.installDIR())): removeDir("/emul32")

def aclocal(parameters=''):
    """generates an aclocal.m4 based on the contents of configure.in."""
    if system('aclocal {}'.format(parameters)):
        raise RunTimeError(_('Running \'aclocal\' failed.'))

def autogen():
    """generates configure script from autogen"""
    if system('bash autogen.sh'):
        raise RunTimeError(_('Running \'autogen.sh\' script failed.'))

def autoconf(parameters=''):
    """generates a configure script"""
    if system('autoconf {}'.format(parameters)):
        raise RunTimeError(_('Running \'autoconf\' failed.'))

def autoreconf(parameters=''):
    """re-generates a configure script"""
    if system('autoreconf {}'.format(parameters)):
        raise RunTimeError(_('Running \'autoreconf\' failed.'))

def automake(parameters=''):
    """generates a makefile"""
    if system('automake {}'.format(parameters)):
        raise RunTimeError(_('Running \'automake\' failed.'))

def autoheader(parameters=''):
    """generates templates for configure"""
    if system('autoheader {}'.format(parameters)):
        raise RunTimeError(_('Running \'autoheader\' failed.'))


code:
# -*- coding: utf-8 -*-
#
# Main fork Pisi: Copyright (C) 2005 - 2011, Tubitak/UEKAE
#
# Copyright (C) 2016 - 2018, Suleyman POYRAZ (Zaryob)
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.

# Standard Python Modules
import os

import gettext

__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext

# Inary Modules
import inary.context as ctx
from inary.util import join_path

# ActionsAPI Modules
import inary.actionsapi
import inary.actionsapi.get as get
from inary.actionsapi.shelltools import system
from inary.actionsapi.shelltools import can_access_file
from inary.actionsapi.shelltools import unlink

class ConfigureError(inary.actionsapi.Error):
    def __init__(self, value=''):
        inary.actionsapi.Error.__init__(self, value)
        self.value = value
        ctx.ui.error("[CMakeTools]: " + value)
        if can_access_file('config.log'):
            ctx.ui.error(_('Please attach the config.log to your bug report:\n{}/config.log').format(os.getcwd()))

class MakeError(inary.actionsapi.Error):
    def __init__(self, value=''):
        inary.actionsapi.Error.__init__(self, value)
        self.value = value
        ctx.ui.error("[CMakeTools]: " + value)

class InstallError(inary.actionsapi.Error):
    def __init__(self, value=''):
        inary.actionsapi.Error.__init__(self, value)
        self.value = value
        ctx.ui.error("[CMakeTools]: " + value)

class RunTimeError(inary.actionsapi.Error):
    def __init__(self, value=''):
        inary.actionsapi.Error.__init__(self, value)
        self.value = value
        ctx.ui.error("[CMakeTools]: " + value)

def configure(parameters='', installPrefix='/{}'.format(get.defaultprefixDIR()), sourceDir='.'):
    """configure source with given cmake parameters = "-DCMAKE_BUILD_TYPE -DCMAKE_CXX_FLAGS ... " """
    if can_access_file(join_path(sourceDir, 'CMakeLists.txt')):
        args = 'cmake -DCMAKE_INSTALL_PREFIX={0} \
                      -DCMAKE_INSTALL_LIBDIR={1} \
                      -DCMAKE_C_FLAGS="{7} {2}" \
                      -DCMAKE_CXX_FLAGS="{7} {3}" \
                      -DCMAKE_LD_FLAGS="{4}" \
                      -DCMAKE_BUILD_TYPE=RelWithDebInfo {5} {6}'.format(installPrefix,
                                                                        "/usr/lib32 " if get.buildTYPE() == "emul32" else "/usr/lib",
                                                                        get.CFLAGS(),
                                                                        get.CXXFLAGS(),
                                                                        get.LDFLAGS(),
                                                                        parameters,
                                                                        sourceDir,
                                                                        "-m32"  if get.buildTYPE() == "emul32" else "-m64")

        if system(args):
            raise ConfigureError(_('Configure failed.'))
    else:
        raise ConfigureError(_('No configure script found. (\"{}\" file not found.)'.format("CMakeLists.txt")))

def make(parameters=''):
    """build source with given parameters"""
    if ctx.config.get_option("verbose") and ctx.config.get_option("debug"):
        command = 'make VERBOSE=1 {0} {1}'.format(get.makeJOBS(), parameters)
    else:
        command = 'make {0} {1} '.format(get.makeJOBS(), parameters)

    if system(command):
        raise MakeError(_('Make failed.'))

def fixInfoDir():
    infoDir = '{}/usr/share/info/dir'.format(get.installDIR())
    if can_access_file(infoDir):
        unlink(infoDir)

def install(parameters='', argument='install'):
    """install source into install directory with given parameters"""
    # You can't squeeze unix paths with things like 'bindir', 'datadir', etc with CMake
    # http://public.kitware.com/pipermail/cmake/2006-August/010748.html
    args = 'make DESTDIR="{0}" \
                 {1} \
                 {2}'.format(get.installDIR(),
                             parameters,
                             argument)

    if system(args):
        raise InstallError(_('Install failed.'))
    else:
        fixInfoDir()

def rawInstall(parameters='', argument='install'):
    """install source into install directory with given parameters = PREFIX=get.installDIR()"""
    if can_access_file('makefile') or can_access_file('Makefile') or can_access_file('GNUmakefile'):
        if system('make {0} {1} '.format(parameters, argument)):
            raise InstallError(_('Install failed.'))
        else:
            fixInfoDir()
    else:
        raise InstallError(_('No Makefile found.'))


code:
# -*- coding: utf-8 -*-
#
# Main fork Pisi: Copyright (C) 2005 - 2011, Tubitak/UEKAE
#
# Copyright (C) 2016 - 2018, Suleyman POYRAZ (Zaryob)
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.

# Standard Python Modules
import re
import sys

# ActionsAPI

def cat(filename):
    return open(filename)

class grep:
    """keep only lines that match the regexp"""

    def __init__(self, pat, flags=0):
        self.fun = re.compile(pat, flags).match

    def __ror__(self, input):
        return filter(self.fun, input)

class tr:
    """apply arbitrary transform to each sequence element"""

    def __init__(self, transform):
        self.tr = transform

    def __ror__(self, input):
        return map(self.tr, input)

class printto:
    """print sequence elements one per line"""

    def __init__(self, out=sys.stdout):
        self.out = out

    def __ror__(self, input):
        for line in input:
            print(line, file=self.out)

printlines = printto()

class terminator:
    def __init__(self, method):
        self.process = method

    def __ror__(self, input):
        return self.process(input)

aslist = terminator(list)
asdict = terminator(dict)
astuple = terminator(tuple)
join = terminator(''.join)
enum = terminator(enumerate)

class sort:
    def __ror__(self, input):
        ll = list(input)
        ll.sort()
        return ll

sort = sort()

class uniq:
    def __ror__(self, input):
        for i in input:
            try:
                if i == prev:
                    continue
            except NameError:
                pass
            prev = i
            yield i

uniq = uniq()


code:
import inary.actionsapi.shelltools

sourcefile="action.sh"

def prepare(args=''):
   shelltools.system("source {} ; _prepare {}".format(sourcefile,args))

def pkgver(args=''):
   shelltools.system("source {} ; _pkgver {}".format(sourcefile,args))

def build(args=''):
   shelltools.system("source {} ; _build {}".format(sourcefile,args))

def check(args=''):
   shelltools.system("source {} ; _check {}".format(sourcefile,args))

def install(args=''):
   shelltools.system("source {} ; _install {}".format(sourcefile,args))


code:
# -*- coding: utf-8 -*-
#
# Main fork Pisi: Copyright (C) 2005 - 2011, Tubitak/UEKAE
#
# Copyright (C) 2016 - 2018, Suleyman POYRAZ (Zaryob)
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option)
# any later version.
#
# Please read the COPYING file.

# Standart Python Modules
import os
import sys
import multiprocessing

import gettext

__trans = gettext.translation('inary', fallback=True)
_ = __trans.gettext

# INARY Modules
import inary.actionsapi
import inary.context as ctx

# ActionsAPI Modules
import inary.actionsapi.variables

class BinutilsError(inary.actionsapi.Error):
    def __init__(self, value=''):
        inary.actionsapi.Error.__init__(self, value)
        self.value = value
        ctx.ui.error("[Binutils]: "+ value)

# Globals
env = inary.actionsapi.variables.glb.env
dirs = inary.actionsapi.variables.glb.dirs
config = inary.actionsapi.variables.glb.config
generals = inary.actionsapi.variables.glb.generals

def curDIR():
    """returns current work directory's path"""
    return os.getcwd()

def curKERNEL():
    """returns currently running kernel's version"""
    return os.uname()[2]

def curPYTHON():
    """ returns currently used python's version"""
    (a, b, c, x, y) = sys.version_info
    return 'python{0}.{1}'.format(a, b)

def curPERL():
    """ returns currently used perl's version"""
    # for i in os.listdir("/usr/bin"):
    #    if i.startswith("perl"):
    #        if i.split("perl")[1]

    return os.path.realpath('/usr/bin/perl').split('perl')[1]

def ENV(environ):
    """returns any given environ variable"""
    try:
        return os.environ[environ]
    except KeyError:
        return None

# PİSİ Related Functions

def pkgDIR():
    """returns the path of binary packages"""
    '''Default: /var/cache/inary/packages'''
    return env.pkg_dir

def workDIR():
    return env.work_dir

def installDIR():
    """returns the path of binary packages"""
    return env.install_dir

# Sulin Related Functions

def lsbINFO():
    """Returns a dictionary filled through /etc/lsb-release."""
    return dict([(l.split("=")[0], l.split("=")[1].strip("'\"")) \
                 for l in open("/etc/lsb-release").read().strip().split("\n") if "=" in l])

def kernelVERSION():
    return env.src_version

# PSPEC Related Functions

def srcNAME():
    return env.src_name

def srcVERSION():
    return env.src_version

def srcRELEASE():
    return env.src_release

def srcTAG():
    return '{0}-{1}-{2}'.format(env.src_name, env.src_version, env.src_release)

def srcDIR():
    return '{0}-{1}'.format(env.src_name, env.src_version)

# Build Related Functions

def ARCH():
    return generals.architecture

def HOST():
    return env.host

def CHOST():
    # FIXME: Currently it behave same as HOST,
    # but will be used for cross-compiling when inary ready...
    return env.host

def CFLAGS():
    return env.cflags

def CXXFLAGS():
    return env.cxxflags

def LDFLAGS():
    return env.ldflags

def makeJOBS():
    # Note: "auto" only works when /sys is mounted.
    if env.jobs == "auto":
        try:
            procs = multiprocessing.cpu_count()
            env.jobs = procs
        except Exception as e:
            ctx.ui.warning(_("Unable to retrieve CPU count: {}").format(e))
            env.jobs = 4
    return env.jobs

def buildTYPE():
    """returns the current build type"""
    return env.build_type

# Directory Related Functions

def docDIR():
    return dirs.doc

def sbinDIR():
    return dirs.sbin

def infoDIR():
    return dirs.info

def manDIR():
    return dirs.man

def dataDIR():
    return dirs.data

def confDIR():
    return dirs.conf

def localstateDIR():
    return dirs.localstate

def libexecDIR():
    return dirs.libexec

def defaultprefixDIR():
    return dirs.defaultprefix

def emul32prefixDIR():
    return dirs.emul32prefix

def kdeDIR():
    return dirs.kde

def qtDIR():
    return dirs.qt

# Binutils Variables

def existBinary(bin):
    # determine if path has binary
    path = os.environ['PATH'].split(':')
    for directory in path:
        if os.path.exists(os.path.join(directory, bin)):
            return True
    return False

def getBinutilsInfo(util):
    cross_build_name = '{0}-{1}'.format(HOST(), util)
    if not existBinary(cross_build_name):
        if not existBinary(util):
            raise BinutilsError(_('Util \'{}\' cannot be found.').format(util))
        else:
            ctx.ui.warning(_('\'{0}\' does not exist, using plain name \'{1}\'').format(cross_build_name, util))
            return util
    else:
        return cross_build_name

def AR():
    return getBinutilsInfo('ar')

def AS():
    return getBinutilsInfo('as')

def CC():
    return getBinutilsInfo('gcc')

def CXX():
    return getBinutilsInfo('g++')

def LD():
    return getBinutilsInfo('ld')

def NM():
    return getBinutilsInfo('nm')

def RANLIB():
    return getBinutilsInfo('ranlib')

def F77():
    return getBinutilsInfo('g77')

def GCJ():
    return getBinutilsInfo('gcj')