code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>telepathy-logger</Name>
        <Homepage>http://telepathy.freedesktop.org/wiki</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>LGPLv2+</License>
        <License>BSD</License>
        <IsA>library</IsA>
        Logging utility Telepathy
        <Description>telepathy-logger is a logging utility for Telepathy communication framework.</Description>
        <Archive sha1sum="549949d13ccd1bac7895eec0ce9b546782b22b5f" type="tarbz2">http://telepathy.freedesktop.org/releases/telepathy-logger/telepathy-logger-0.8.2.tar.bz2</Archive>
        <BuildDependencies>

            <Dependency>glib2-devel</Dependency>
            <Dependency>intltool</Dependency>
            <Dependency>libxslt-devel</Dependency>
            <Dependency>dbus-devel</Dependency>
            <Dependency>dbus-glib-devel</Dependency>
            <Dependency>gobject-introspection-devel</Dependency>
            <Dependency>libxml2-devel</Dependency>
            <Dependency>sqlite-devel</Dependency>
            <Dependency>telepathy-glib-devel</Dependency>
        </BuildDependencies>
    </Source>

    <Package>
        <Name>telepathy-logger</Name>
        <RuntimeDependencies>
            <Dependency>dbus</Dependency>
            <Dependency>glib2</Dependency>
            <Dependency>sqlite</Dependency>
            <Dependency>libxml2</Dependency>
            <Dependency>dbus-glib</Dependency>
            <Dependency>telepathy-glib</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="data">/usr/share/gir-1.0/</Path>
            <Path fileType="data">/usr/share/telepathy</Path>
            <Path fileType="data">/usr/share/glib-2.0/</Path>
            <Path fileType="library">/usr/libexec</Path>
            <Path fileType="data">/usr/share/dbus-1</Path>
            <Path fileType="doc">/usr/share/gtk-doc</Path>
            <Path fileType="doc">/usr/share/doc</Path>
        </Files>
    </Package>

    <Package>
        <Name>telepathy-logger-devel</Name>
        Development files for telepathy-logger
        <RuntimeDependencies>
            <Dependency release="current">telepathy-logger</Dependency>
            <Dependency>telepathy-glib-devel</Dependency>
            <Dependency>libxml2-devel</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="header">/usr/include</Path>
            <Path fileType="data">/usr/lib/pkgconfig</Path>
        </Files>
    </Package>

    <History>
        <Update release="3">
            <Date>2017-05-20</Date>
            <Version>0.8.2</Version>
            <Comment>Rebuild with new toolchain</Comment>
            <Name>Mustafa Cinasal</Name>
            <Email>muscnsl@gmail.com</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>0.8.2</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2016-03-30</Date>
            <Version>0.8.2</Version>
            <Comment>First release</Comment>
            <Name>Alihan Öztürk</Name>
            <Email>alihan@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>telepathy-logger</Name>
        Telepathy için kayıt tutma aracı.
        <Description xml:lang="tr">telepathy-logger, Telepathy iletişim altyapısı için kayıt tutma aracıdır.</Description>
    </Source>

    <Package>
        <Name>telepathy-logger-devel</Name>
        telepathy-logger için geliştirme dosyaları
    </Package>
</PISI>

repo_name: ayhanyalcinsoy/main


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

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

def setup():
    autotools.configure("--prefix=/usr \
                         --libexecdir=/usr/lib/telepathy \
                         --enable-gtk-doc \
                         --disable-upower \
                         --disable-static")

def build():
    autotools.make()

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

    pisitools.dodoc("AUTHORS", "COPYING", "ChangeLog", "README", "NEWS")


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>telepathy-mission-control</Name>
        <Homepage>http://telepathy.freedesktop.org/wiki/Mission_Control</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>LGPLv2</License>
        <IsA>app:console</IsA>
        <IsA>library</IsA>
        Telepathy component managing connection managers
        <Description>telepathy-mission-control, or Mission Control, is a Telepathy component providing a way for end user applications to abstract some of the details of connection managers, to provide a simple way to manipulate a bunch of connection managers at once, and to remove the need to have in each program the account definitions and credentials.</Description>
        <Archive sha1sum="30f4093b6918ffaf6bc0e585cf0d84f40aa24e25" type="targz">http://telepathy.freedesktop.org/releases/telepathy-mission-control/telepathy-mission-control-5.16.4.tar.gz</Archive>
        <BuildDependencies>
            <Dependency>libxslt-devel</Dependency>
            <Dependency>dbus-devel</Dependency>
            <Dependency>dbus-glib-devel</Dependency>
            <Dependency>telepathy-glib-devel</Dependency>
            <Dependency>gtk-doc</Dependency>
            <Dependency>NetworkManager-devel</Dependency>
            <Dependency>docbook-xsl</Dependency>
            <Dependency>libaccounts-glib-devel</Dependency>
        </BuildDependencies>
    </Source>

    <Package>
        <Name>telepathy-mission-control</Name>
        <RuntimeDependencies>
            <Dependency>dbus</Dependency>
            <Dependency>glib2</Dependency>
            <Dependency>dbus-glib</Dependency>
            <Dependency>NetworkManager</Dependency>
            <Dependency>telepathy-glib</Dependency>
            <Dependency>libaccounts-glib</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="library">/usr/lib/libmission-control-plugins.so.0*</Path>
            <Path fileType="library">/usr/lib/telepathy/mission-control-5</Path>
            <Path fileType="man">/usr/share/man</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="data">/usr/share/dbus-1</Path>
            <Path fileType="data">/usr/share/glib-2.0</Path>
        </Files>
    </Package>

    <Package>
        <Name>telepathy-mission-control-devel</Name>
        Development files for telepathy-mission-control
        <RuntimeDependencies>
            <Dependency release="current">telepathy-mission-control</Dependency>
            <Dependency>telepathy-glib-devel</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="header">/usr/include/mission-control-5.5</Path>
            <Path fileType="library">/usr/lib/libmission-control-plugins.so</Path>
            <Path fileType="data">/usr/lib/pkgconfig/mission-control-plugins.pc</Path>
            <Path fileType="doc">/usr/share/gtk-doc/html/mission-control-plugins</Path>
        </Files>
    </Package>

    <History>
        <Update release="4">
            <Date>2017-07-30</Date>
            <Version>5.16.4</Version>
            <Comment>Rebuild</Comment>
            <Name>Mustafa Cinasal</Name>
            <Email>muscnsl@gmail.com</Email>
        </Update>
        <Update release="3">
            <Date>2017-05-22</Date>
            <Version>5.16.4</Version>
            <Comment>Version bump</Comment>
            <Name>Mustafa Cinasal</Name>
            <Email>muscnsl@gmail.com</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>5.16.3</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2016-03-30</Date>
            <Version>5.16.3</Version>
            <Comment>First release</Comment>
            <Name>Alihan Öztürk</Name>
            <Email>alihan@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>telepathy-mission-control</Name>
        Bağlantı yöneticilerini düzenlemeya yarayan Telepathy bileşeni
        <Description xml:lang="tr">telepathy-mission-control, diğer adıyla Mission Control, bağlantı yöneticilerini düzenlemenin zorluklarını kullanıcıdan soyutlamaya çalışan, basitçe hesap oluşturmanıza olanak tanıyan bir Telepathy bileşenidir.</Description>
    </Source>

    <Package>
        <Name>telepathy-mission-control-devel</Name>
        telepathy-mission-control için geliştirme dosyaları
    </Package>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

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

WorkDir = "telepathy-qt-%s" % get.srcVERSION()

def setup():
    cmaketools.configure("-DDESIRED_QT_VERSION=5 \
                          -DPYTHON_EXECUTABLE=/usr/bin/python2.7 \
                          -DENABLE_EXAMPLES=OFF \
                          -DENABLE_TESTS=OFF")

def build():
    cmaketools.make()

def install():
    cmaketools.install()

    pisitools.dodoc("AUTHORS", "ChangeLog", "COPYING", "NEWS", "README")


code:
From 2a460afdbd0cb39d8dcecaf6cea5ce9ce7d3216b Mon Sep 17 00:00:00 2001
From: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Date: Fri, 5 Jun 2015 12:47:13 +0200
Subject: CMake: Fixed deprecated _BSD_SOURCE.

Since glibc-2.20 _DEFAULT_SOURCE definition is also required.

Reviewed-by: Alexandr Akulich

diff --git a/cmake/modules/TelepathyDefaults.cmake b/cmake/modules/TelepathyDefaults.cmake
index d34b24d..dc98697 100644
--- a/cmake/modules/TelepathyDefaults.cmake
+++ b/cmake/modules/TelepathyDefaults.cmake
@@ -108,7 +108,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
     endif(${NOT_RELEASE} EQUAL 1)

     if(CMAKE_SYSTEM_NAME MATCHES Linux)
-        add_definitions(-D_BSD_SOURCE)
+        add_definitions(-D_BSD_SOURCE -D_DEFAULT_SOURCE)
     endif(CMAKE_SYSTEM_NAME MATCHES Linux)

     # Compiler coverage
--
cgit v0.10.2


code:
From ec4a3d62b68a57254515f01fc5ea3325ffb1dbfb Mon Sep 17 00:00:00 2001
From: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Date: Tue, 29 Sep 2015 20:52:15 +0200
Subject: Farstream: gst/gstconfig.h can be in LIBDIR, search for it explicitly

Since GStreamer-1.5.1 config header file moved to LIBDIR.

Reviewed-by: Alexandr Akulich <akulichalexander@gmail.com>

diff --git a/TelepathyQt/Farstream/CMakeLists.txt b/TelepathyQt/Farstream/CMakeLists.txt
index 250bfdb..dd71430 100644
--- a/TelepathyQt/Farstream/CMakeLists.txt
+++ b/TelepathyQt/Farstream/CMakeLists.txt
@@ -2,7 +2,7 @@ if(FARSTREAM_COMPONENTS_FOUND)
     include_directories(${TELEPATHY_FARSTREAM_INCLUDE_DIR}
                         ${TELEPATHY_GLIB_INCLUDE_DIR}
                         ${FARSTREAM_INCLUDE_DIR}
-                        ${GSTREAMER_INCLUDE_DIR}
+                        ${GSTREAMER_INCLUDE_DIRS}
                         ${GLIB2_INCLUDE_DIR}
                         ${LIBXML2_INCLUDE_DIR}
                         ${DBUS_INCLUDE_DIR})
diff --git a/cmake/modules/FindGStreamer.cmake b/cmake/modules/FindGStreamer.cmake
index 63fb41c..ffdd7a9 100644
--- a/cmake/modules/FindGStreamer.cmake
+++ b/cmake/modules/FindGStreamer.cmake
@@ -13,12 +13,12 @@

 # TODO: Other versions --> GSTREAMER_X_Y_FOUND (Example: GSTREAMER_0_8_FOUND and GSTREAMER_0_10_FOUND etc)

-IF (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY)
+IF (GSTREAMER_INCLUDE_DIRS AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY)
    # in cache already
    SET(GSTREAMER_FIND_QUIETLY TRUE)
-ELSE (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY)
+ELSE (GSTREAMER_INCLUDE_DIRS AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY)
    SET(GSTREAMER_FIND_QUIETLY FALSE)
-ENDIF (GSTREAMER_INCLUDE_DIR AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY)
+ENDIF (GSTREAMER_INCLUDE_DIRS AND GSTREAMER_LIBRARIES AND GSTREAMER_BASE_LIBRARY AND GSTREAMER_INTERFACE_LIBRARY)

 IF (NOT WIN32)
    # use pkg-config to get the directories and then use these values
@@ -38,6 +38,15 @@ FIND_PATH(GSTREAMER_INCLUDE_DIR gst/gst.h
    PATH_SUFFIXES gstreamer-1.0
    )

+FIND_PATH(GSTREAMER_CONF_INCLUDE_DIR gst/gstconfig.h
+   PATHS
+   ${PC_GSTREAMER_INCLUDEDIR}
+   ${PC_GSTREAMER_INCLUDE_DIRS}
+   PATH_SUFFIXES gstreamer-1.0
+   )
+
+SET(GSTREAMER_INCLUDE_DIRS ${GSTREAMER_INCLUDE_DIR} ${GSTREAMER_CONF_INCLUDE_DIR})
+
 FIND_LIBRARY(GSTREAMER_LIBRARIES NAMES gstreamer-1.0
    PATHS
    ${PC_GSTREAMER_LIBDIR}
@@ -57,6 +66,12 @@ ELSE (GSTREAMER_INCLUDE_DIR)
    MESSAGE(STATUS "GStreamer: WARNING: include dir not found")
 ENDIF (GSTREAMER_INCLUDE_DIR)

+IF (GSTREAMER_CONF_INCLUDE_DIR)
+	#MESSAGE(STATUS "DEBUG: Found GStreamer config include dir: ${GSTREAMER_CONF_INCLUDE_DIR}")
+ELSE (GSTREAMER_CONF_INCLUDE_DIR)
+   MESSAGE(STATUS "GStreamer: WARNING: config include dir not found")
+ENDIF (GSTREAMER_CONF_INCLUDE_DIR)
+
 IF (GSTREAMER_LIBRARIES)
    #MESSAGE(STATUS "DEBUG: Found GStreamer library: ${GSTREAMER_LIBRARIES}")
 ELSE (GSTREAMER_LIBRARIES)
@@ -65,6 +80,6 @@ ENDIF (GSTREAMER_LIBRARIES)

 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GStreamer  DEFAULT_MSG  GSTREAMER_LIBRARIES GSTREAMER_INCLUDE_DIR GSTREAMER_BASE_LIBRARY)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GStreamer  DEFAULT_MSG  GSTREAMER_LIBRARIES GSTREAMER_INCLUDE_DIRS GSTREAMER_BASE_LIBRARY)

-MARK_AS_ADVANCED(GSTREAMER_INCLUDE_DIR GSTREAMER_LIBRARIES GSTREAMER_BASE_LIBRARY)
+MARK_AS_ADVANCED(GSTREAMER_INCLUDE_DIRS GSTREAMER_LIBRARIES GSTREAMER_BASE_LIBRARY)
--
cgit v0.10.2


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>telepathy-qt5</Name>
        <Homepage>http://telepathy.freedesktop.org</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>LGPLv2.1</License>
        <IsA>library</IsA>
        Qt based classes for Telepathy communication framework
        <Description>The Telepathy project is about building a unified framework for many different kinds of real-time communications. telepathy-qt contains Qt-based base and proxy classes for use in connection managers and clients.</Description>
        <Archive sha1sum="f0dc68fdc05d0d43ae21481c1a875e7bfe919b9b" type="targz">http://telepathy.freedesktop.org/releases/telepathy-qt/telepathy-qt-0.9.7.tar.gz</Archive>
        <BuildDependencies>
            <Dependency>cmake</Dependency>
            <Dependency>qt5-doc</Dependency>
            <Dependency>qt5-base-devel</Dependency>
            <Dependency>qt5-assistant-devel</Dependency>
            <Dependency>gobject-introspection-devel</Dependency>
            <Dependency>dbus-glib-devel</Dependency>
            <Dependency>libxml2-devel</Dependency>
            <Dependency>farstream-devel</Dependency>
            <Dependency>telepathy-farstream-devel</Dependency>
            <Dependency>doxygen</Dependency>
        </BuildDependencies>
        <Patches>

        </Patches>
    </Source>

    <Package>
        <Name>telepathy-qt5</Name>
        <RuntimeDependencies>
            <Dependency>glib2</Dependency>
            <Dependency>libgcc</Dependency>
            <Dependency>qt5-base</Dependency>
            <Dependency>telepathy-glib</Dependency>
            <Dependency>telepathy-farstream</Dependency>
            <Dependency>doxygen</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="doc">/usr/share/doc</Path>
        </Files>
    </Package>

    <Package>
        <Name>telepathy-qt5-devel</Name>
        Development files for telepathy-qt5
        <RuntimeDependencies>
            <Dependency release="current">telepathy-qt5</Dependency>
            <Dependency>qt5-base-devel</Dependency>
            <Dependency>telepathy-glib-devel</Dependency>
            <Dependency>telepathy-farstream-devel</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="header">/usr/include</Path>
            <Path fileType="data">/usr/lib/pkgconfig</Path>
        </Files>
    </Package>

    <History>
        <Update release="3">
            <Date>2017-05-20</Date>
            <Version>0.9.7</Version>
            <Comment>Version bump</Comment>
            <Name>Mustafa Cinasal</Name>
            <Email>muscnsl@gmail.com</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>0.9.6</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2016-03-30</Date>
            <Version>0.9.6</Version>
            <Comment>First release</Comment>
            <Name>Alihan Öztürk</Name>
            <Email>alihan@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>telepathy-qt5</Name>
        Telepathy iletişim çatısı için Qt tabanlı sınıflar
        <Description xml:lang="tr">Telepathy projesi çeşitli gerçek zamanlı iletişim türleri için birleşik bir çatı oluşturmayı amaçlar. telepathy-qt bağlantı yöneticileri ve istemcilerde kullanılmak üzere Qt tabanlı temel ve vekil sınıfları içerir.</Description>
    </Source>

    <Package>
        <Name>telepathy-qt5-devel</Name>
        telepathy-qt5 için geliştirme dosyaları
    </Package>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

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

def setup():
    autotools.configure("--prefix=/usr \
                         --sysconfdir=/etc \
                         --libexecdir=/usr/lib/telepathy \
                         --disable-static \
                         --with-tls=openssl \
                         --enable-avahi-tests=no \
                         --disable-Werror")

    #pisitools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")

def build():
    autotools.make("-j1")

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

    pisitools.dodoc("AUTHORS", "ChangeLog", "COPYING", "README", "NEWS")


code:
diff -Nur telepathy-salut-0.3.11-old/configure.ac telepathy-salut-0.3.11/configure.ac
--- telepathy-salut-0.3.11-old/configure.ac	2010-04-06 13:21:58.592842887 +0300
+++ telepathy-salut-0.3.11/configure.ac	2010-04-06 13:23:33.924588464 +0300
@@ -33,6 +33,10 @@
 AM_PROG_AS
 AM_PROG_MKDIR_P

+dnl make sure locale does not mess with upper/lower conversions
+LC_ALL="C"
+AC_SUBST(LC_ALL)
+
 dnl add common command line switches
 SALUT_ARG_DEBUG
 SALUT_ARG_VALGRIND


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>telepathy-salut</Name>
        <Homepage>http://telepathy.freedesktop.org/wiki</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>LGPLv2+</License>
        <IsA>library</IsA>
        <Summary>Link-local XMPP Telepathy connection manager</Summary>
        <Description>telepathy-salut is Telepathy connection manager for link-local XMPP. Normally, XMPP does no support direct client-to-client interactions, since it requires authentication with a server. This package makes it is possible to establish an XMPP-like communications on a local network using zero-configuration networking.</Description>
        <Archive sha1sum="b37e623be6c6cd7b9ca4ae7ed20fea7d3a13b37d" type="targz">http://telepathy.freedesktop.org/releases/telepathy-salut/telepathy-salut-0.8.1.tar.gz</Archive>
        <BuildDependencies>
            <Dependency>libxslt-devel</Dependency>
            <Dependency>glib2-devel</Dependency>
            <Dependency>gobject-introspection-devel</Dependency>
            <Dependency>dbus-devel</Dependency>
            <Dependency>dbus-glib-devel</Dependency>
            <Dependency>telepathy-glib-devel</Dependency>
            <Dependency>avahi-devel</Dependency>
            <Dependency>avahi-glib-devel</Dependency>
            <Dependency>libsoup-devel</Dependency>
            <Dependency>openssl-devel</Dependency>
            <Dependency>python-devel</Dependency>
            <Dependency>sqlite-devel</Dependency>
            <Dependency>cyrus-sasl-devel</Dependency>
        </BuildDependencies>
        <Patches>
            <Patch level="1">fix_bork_in_tr_locale.patch</Patch>
        </Patches>
    </Source>

    <Package>
        <Name>telepathy-salut</Name>
        <RuntimeDependencies>
            <Dependency>dbus</Dependency>
            <Dependency>glib2</Dependency>
            <Dependency>sqlite</Dependency>
            <Dependency>libsoup</Dependency>
            <Dependency>libxml2</Dependency>
            <Dependency>openssl</Dependency>
            <Dependency>dbus-glib</Dependency>
            <Dependency>avahi-glib</Dependency>
            <Dependency>avahi-libs</Dependency>
            <Dependency>telepathy-glib</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="data">/usr/share/dbus-1</Path>
            <Path fileType="data">/usr/share/telepathy</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="man">/usr/share/man</Path>
        </Files>
    </Package>

    <History>
        <Update release="3">
            <Date>2017-05-22</Date>
            <Version>0.8.1</Version>
            <Comment>Rebuild with new toolchain</Comment>
            <Name>Mustafa Cinasal</Name>
            <Email>muscnsl@gmail.com</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>0.8.1</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
         <Update release="1">
            <Date>2015-11-22</Date>
            <Version>0.8.1</Version>
            <Comment>First release</Comment>
            <Name>Alihan Öztürk</Name>
            <Email>alihan@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>telepathy-salut</Name>
        <Summary xml:lang="tr">XMPP ile yerel-bağlantı iletişimini sağlayan Telepathy bağlantı yöneticisi.</Summary>
        <Description xml:lang="tr">telepathy-salut, yerel bir ağ üzerinde XMPP benzeri iletişimi mümkün kılan bir Telepathy bağlantı yöneticisidir.</Description>
    </Source>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

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

def setup():
    autotools.configure("--libexecdir=/usr/lib")

def build():
    autotools.make()

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

    pisitools.dodoc("AUTHORS", "COPYING", "NEWS", "README")


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>telepathy-sunshine</Name>
        <Homepage>http://telepathy.freedesktop.org/wiki</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv3+</License>
        <IsA>library</IsA>
        <Summary>Gadu-Gadu connection manager for telepathy</Summary>
        <Description>Telepathy-sunshine is a Gadu-Gadu network connection manager. It supports the Nowe Gadu Gadu features such as UTF-8 encoding and new statuses.</Description>
        <Archive sha1sum="b4a39f5e087787c32e541038024756463aebcbbf" type="targz">http://telepathy.freedesktop.org/releases/telepathy-sunshine/telepathy-sunshine-0.2.0.tar.gz</Archive>
        <Patches>
            <Patch level="1">dont-compile-py.patch</Patch>
        </Patches>
    </Source>

    <Package>
        <Name>telepathy-sunshine</Name>
        <Files>
            <Path fileType="executable">/usr/libexec</Path>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="data">/usr/share/dbus-1</Path>
            <Path fileType="data">/usr/share/telepathy</Path>
            <Path fileType="man">/usr/share/man</Path>
            <Path fileType="doc">/usr/share/doc</Path>
        </Files>
    </Package>

    <History>
        <Update release="3">
            <Date>2017-05-22</Date>
            <Version>2.0</Version>
            <Comment>Rebuild with new toolchain</Comment>
            <Name>Mustafa Cinasal</Name>
            <Email>muscnsl@gmail.com</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>2.0</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2015-11-22</Date>
            <Version>2.0</Version>
            <Comment>First release</Comment>
            <Name>Alihan Öztürk</Name>
            <Email>alihan@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>telepathy-sunshine</Name>
        <Summary xml:lang="tr">Telepathy için Gadu Gadu bağlantı yöneticisi</Summary>
        <Description xml:lang="tr">Telepathy-sunshine Telepathy iletişim altyapısı için Gadu Gadu bağlantı yöneticisidir.</Description>
    </Source>
</PISI>


code:
<PISI>
    <Name>network</Name>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt

from pisi.actionsapi import shelltools
from pisi.actionsapi import pisitools
from pisi.actionsapi import autotools
from pisi.actionsapi import get

def setup():
    shelltools.system("./autogen.sh")
    autotools.configure("--disable-static \
                         --enable-more-warnings=yes \
                         --with-udev-base-dir=/lib/udev \
                         --enable-gtk-doc \
                         --with-polkit=permissive")

    pisitools.dosed("libtool", " -shared ", " -Wl,-O1,--as-needed -shared ")

def build():
    autotools.make()

def check():
    autotools.make("check")

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

    pisitools.dodoc("README", "COPYING")


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>ModemManager</Name>
        <Homepage>http://projects.gnome.org/NetworkManager</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>LGPLv2.1</License>
        <IsA>app:console</IsA>
        <IsA>service</IsA>
        A manager framework for mobile broadband modems
        <Description>ModemManager provides a unified high level API for communicating with mobile broadband modems.</Description>
        <Archive sha1sum="d08004666df8e615c3d2a06af3b5dac4ac125a13" type="tarxz">http://www.freedesktop.org/software/ModemManager/ModemManager-1.6.12.tar.xz</Archive>
        <BuildDependencies>
            <Dependency>glib2-devel</Dependency>
            <Dependency>libgudev-devel</Dependency>
            <Dependency>libxslt-devel</Dependency>
            <Dependency>gobject-introspection-devel</Dependency>
            <Dependency>polkit-devel</Dependency>
            <Dependency>ppp-devel</Dependency>
            <Dependency>libqmi-devel</Dependency>
            <Dependency>libmbim-devel</Dependency>
            <Dependency>intltool</Dependency>
            <Dependency>gtk-doc</Dependency>
            <Dependency>docbook-xsl</Dependency>
            <Dependency>python-six</Dependency>
            <Dependency>vala-devel</Dependency>
        </BuildDependencies>
    </Source>

    <Package>
        <Name>ModemManager</Name>
        <RuntimeDependencies>
            <Dependency>glib2</Dependency>
            <Dependency>libqmi</Dependency>
            <Dependency>polkit</Dependency>
            <Dependency>libmbim</Dependency>
            <Dependency>libgudev</Dependency>
            <Dependency>libmm-glib</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="executable">/usr/sbin</Path>
            <Path fileType="data">/usr/share/icons</Path>
            <Path fileType="localedata">/usr/share/locale</Path>
            <Path fileType="data">/usr/share/dbus-1</Path>
            <Path fileType="data">/usr/share/gir-1.0/ModemManager-1.0.gir</Path>
            <Path fileType="data">/lib/udev/rules.d/</Path>
            <Path fileType="data">/etc/dbus-1/system.d/</Path>
            <Path fileType="library">/usr/lib/ModemManager</Path>
            <Path fileType="library">/usr/lib/girepository-1.0/ModemManager-1.0.typelib</Path>
            <Path fileType="man">/usr/share/man/man8/ModemManager.8</Path>
            <Path fileType="data">/usr/share/gtk-doc</Path>
            <Path fileType="data">/usr/share/polkit-1</Path>
            <Path fileType="data">/usr/share/bash-completion</Path>
        </Files>
    </Package>

    <Package>
        <Name>ModemManager-devel</Name>
        Development files for ModemManager
        <RuntimeDependencies>
            <Dependency release="current">ModemManager</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="header">/usr/include/ModemManager/</Path>
            <Path fileType="data">/usr/lib/pkgconfig/ModemManager.pc</Path>
        </Files>
    </Package>

    <Package>
        <Name>libmm-glib</Name>
        D-Bus service for managing modems - shared libraries
        <RuntimeDependencies>
            <Dependency>glib2</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="data">/usr/share/vala/vapi/libmm-glib.vapi </Path>
            <Path fileType="data">/usr/share/vala/vapi/libmm-glib.deps </Path>
            <Path fileType="data">/usr/lib/libmm-glib.so*</Path>
            <Path fileType="man">/usr/share/man/man8/mmcli.8</Path>
        </Files>
    </Package>

    <Package>
        <Name>libmm-glib-devel</Name>
        Development files for libmm-glib
        <RuntimeDependencies>
            <Dependency release="current">libmm-glib</Dependency>
            <Dependency>glib2-devel</Dependency>
            <Dependency>ModemManager-devel</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="header">/usr/include/libmm-glib/</Path>
            <Path fileType="data">/usr/lib/pkgconfig/mm-glib.pc</Path>
        </Files>
    </Package>

    <History>
        <Update release="5">
            <Date>2018-02-19</Date>
            <Version>1.6.12</Version>
            <Comment>Version bump</Comment>
            <Name>Mustafa Cinasal</Name>
            <Email>muscnsl@gmail.com</Email>
        </Update>
        <Update release="4">
            <Date>2017-02-19</Date>
            <Version>1.6.4</Version>
            <Comment>Version bump.</Comment>
            <Name>Ertuğrul Erata</Name>
            <Email>ertugrulerata@gmail.com</Email>
        </Update>
        <Update release="3">
            <Date>2016-11-12</Date>
            <Version>1.6.2</Version>
            <Comment>Version bump.</Comment>
            <Name>Yusuf Aydemir</Name>
            <Email>yusuf.aydemir@pisilnux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>1.4.12</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2016-01-25</Date>
            <Version>1.4.12</Version>
            <Comment>First release</Comment>
            <Name>Ayhan Yalçınsoy</Name>
            <Email>ayhanyalcinsoy@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>ModemManager</Name>
        Mobil modemler için yönetim katmanı
        <Description xml:lang="tr">ModemManager, 3G ve GSM gibi mobil genişbant modemlerle D-Bus üzerinden iletişimi sağlayan bir sistem hizmetidir.</Description>
    </Source>

    <Package>
        <Name>ModemManager-devel</Name>
        ModemManager için geliştirme dosyaları
    </Package>

    <Package>
        <Name>libmm-glib</Name>
        D-Bus service for managing modems - shared libraries
    </Package>

    <Package>
        <Name>libmm-glib-devel</Name>
        Development files for libmm-glib
        libmm-glib için geliştirme dosyaları
    </Package>
</PISI>


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 2.
# See the file http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt

from pisi.actionsapi import get
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import shelltools

def setup():
    # /var/run => /run
    #for f in ["configure.ac", "src/Makefile.am", "src/Makefile.in"]:
        #pisitools.dosed(f, "\$\(?localstatedir\)?(\/run\/(\$PACKAGE|NetworkManager))", "\\1")
    #pisitools.dosed("configure.ac", "\/var(\/run\/ConsoleKit)", "\\1")
    #pisitools.dosed("configure.ac", "^initscript", deleteLine=True)
    autotools.autoreconf("-fiv")
    shelltools.system("intltoolize --force --copy --automake")

    autotools.configure("--disable-static \
                         --disable-silent-rules \
                         --disable-wimax \
                         --disable-lto \
                         --disable-config-plugin-ibft \
                         --disable-ifnet \
                         --disable-more-warnings \
                         --enable-modify-system \
                         --enable-ppp=yes \
                         --enable-bluez5-dun \
                         --enable-concheck \
                         --without-netconfig \
                         --with-modem-manager-1 \
                         --with-libsoup=yes \
                         --with-session-tracking=consolekit \
                         --with-suspend-resume=upower \
                         --with-system-ca-path=/etc/ssl/certs \
                         --with-crypto=nss \
                         --with-dhcpcd=/usr/bin/dhcpcd \
                         --with-pppd=/usr/sbin/pppd \
                         --with-pppd-plugin-dir=/usr/lib/pppd/2.4.7 \
                         --with-dbus-sys-dir=/etc/dbus-1/system.d \
                         --with-dhclient=/usr/sbin/dhclient \
                         --with-kernel-firmware-dir=/lib/firmware \
                         --with-udev-dir=/lib/udev \
                         --with-resolvconf=/etc/resolv.default.conf \
                         --with-iptables=/sbin/iptables \
                         --with-dnsmasq=/usr/sbin/dnsmasq \
                         --with-systemdsystemunitdir=no \
                         --with-nmtui \
                         --localstatedir=/var \
                         --sysconfdir=/etc \
                         --libexecdir=/usr/lib/NetworkManager \
                        ")

    pisitools.dosed("libtool", " -shared ", " -Wl,--as-needed -shared ")

def build():
    autotools.make()

#def check():
    #autotools.make("-k check")

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

    pisitools.dodir("/etc/NetworkManager/VPN")

    pisitools.dodoc("AUTHORS", "ChangeLog", "CONTRIBUTING", "COPYING", "NEWS", "README")


code:
# -*- coding: utf-8 -*-
from comar.service import *
import os

serviceType = "local"
serviceDesc = _({"en": "Network Manager",
                 "tr": "Ağ Yöneticisi Hizmeti"})
serviceDefault = "conditional"

MSG_BACKEND_WARNING = _({
                        "en" : "NetworkManager is not enabled by default. You can change this from /etc/conf.d/NetworkManager.",
                        "tr" : "NetworkManager öntanımlı olarak etkin değil. /etc/conf.d/NetworkManager dosyasından bu ayarı değiştirebilirsiniz."
                        })

PIDFILE="/run/NetworkManager/NetworkManager.pid"
USETHIS=eval(config.get("DEFAULT", "True"))

@synchronized
def start():
    if not USETHIS:
        fail(MSG_BACKEND_WARNING)

    startService(command="/usr/sbin/NetworkManager",
                 args="--pid-file=%s" % PIDFILE,
                 donotify=True)

@synchronized
def stop():
    stopService(pidfile=PIDFILE,
                donotify=True)

    try:
        os.unlink(PIDFILE)
    except:
        pass

def ready():
    if not USETHIS:
        fail(MSG_BACKEND_WARNING)
    else:
        start()

def status():
    return isServiceRunning(pidfile=PIDFILE)


code:
From 11aa07ed939193e85516c287a57dee1837242972 Mon Sep 17 00:00:00 2001
From: Thomas Haller <thaller@redhat.com>
Date: Mon, 4 Jan 2016 18:54:26 +0100
Subject: [PATCH] core: fix failure to configure routes due to wrong
 device-route for IPv4 peer-addresses

As in the case of a OpenVPN connection, we might add an address like:
  10.8.0.58/32 ptp 10.8.0.57

In this case, kernel would automatically add a device-route like:
  10.8.0.57/32 via 0.0.0.0 dev 32 metric 0 mss 0 src rtprot-kernel scope link pref-src 10.8.0.58

nm_ip4_config_commit() checks all IP addresses to figure out
the present device-routes. Then the routes are synced by NMRouteManager.
Due to a bug, we would not consider the peer-address, but the local-address
and configure a route 10.8.0.58/32, instead of 10.8.0.57/32.

That stays mostly unnoticed, because usually the peer and the local-address are
in the same subnet, so that there is no difference (/32 is an example of the
peer-address being in a different subnet).

It also seems that due to a bug fixed by df4e5357521 this issue didn't surface.
Probably because we would not notice the 10.8.0.57/32 right away and thus
nm_route_manager_ip4_route_sync() would not wrongly delete it.

https://bugzilla.gnome.org/show_bug.cgi?id=759892

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809195
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809494
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=809526
https://bugs.archlinux.org/task/47535
https://bugzilla.redhat.com/show_bug.cgi?id=1294309
https://mail.gnome.org/archives/networkmanager-list/2015-December/msg00059.html
---
 src/nm-ip4-config.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c
index f625d35..61e29af 100644
--- a/src/nm-ip4-config.c
+++ b/src/nm-ip4-config.c
@@ -298,7 +298,8 @@ nm_ip4_config_commit (const NMIP4Config *config, int ifindex, gboolean routes_fu

 				route.ifindex = ifindex;
 				route.source = NM_IP_CONFIG_SOURCE_KERNEL;
-				route.network = nm_utils_ip4_address_clear_host_address (addr->address, addr->plen);
+				route.network = nm_utils_ip4_address_clear_host_address (addr->peer_address ? : addr->address,
+				                                                         addr->plen);
 				route.plen = addr->plen;
 				route.pref_src = addr->address;
 				route.metric = default_route_metric;
--
2.6.4


code:
polkit.addRule(function(action, subject) {
    if (/^org\.freedesktop\.ModemManager1\.(Device\.Control|Contacts|Messaging|Location)$/.test(action.id) &&
        subject.isInGroup("network")) {
        return "yes";
    }
});


code:
polkit.addRule(function(action, subject) {
	if (action.id == "org.freedesktop.NetworkManager.settings.modify.system" &&
		subject.isInGroup("network")) {
		return "yes";
	}
});


code:
[main]
plugins=keyfile
dns=default


code:
# Set this to False for disabling NM startup on boot
DEFAULT="True"


code:
diff -Nur NetworkManager-0.9.0.orig/src/nm-policy.c NetworkManager-0.9.0/src/nm-policy.c
--- NetworkManager-0.9.0.orig/src/nm-policy.c	2011-08-23 06:41:02.099686450 +0000
+++ NetworkManager-0.9.0/src/nm-policy.c	2011-08-23 06:43:38.227791737 +0000
@@ -302,6 +302,7 @@
 		return;
 	}

+#if 0
 	/* Try automatically determined hostname from the best device's IP config */
 	if (!best4)
 		best4 = get_best_ip4_device (policy->manager, &best_req4);
@@ -356,6 +357,7 @@
 		}
 	}

+#endif
 	/* If no automatically-configured hostname, try using the hostname from
 	 * when NM started up.
 	 */


code:
[Let users in removable group modify NetworkManager]
Identity=unix-group:removable
Action=org.freedesktop.NetworkManager.settings.*
ResultAny=no
ResultInactive=no
ResultActive=yes


code:
#!/usr/bin/python
# -*- coding: utf-8 -*-

# Copyright 2009-2010 TUBITAK/UEKAE
# Licensed under the GNU General Public License, version 2.
# See the file http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
#
#
#
# A migration script to transform COMAR based network profiles into NetworkManager based network profiles.
#
# The main purpose of the script is help Pardus 2009 users to be able to use their network profiles in Pardus 2011
# without any effort when they upgrade their system.
#
# A few words about how stuff works. COMAR based network manager keeps profile settings under /etc/network with two
# files: net_tools which includes ethernet profile settings and wireless_tools which includes wireless profile settings.
# On the other hand, NetworkManager keeps each profile settings in an individual file under /etc/NetworkManager/system-connections.
#
# This script simply reads your old profile files and try to create a new profile file compatible with NetworkManager for each profile.
#
#

import os
import ConfigParser

default_nameservers = []
default_resolv_conf_file = "/etc/resolv.default.conf"
lan_config_file  = "/etc/network/net_tools"
wlan_config_file  = "/etc/network/wireless_tools"
migration_sign = "/etc/network/.migrated"
NetworkManager_conf_dir = "/etc/NetworkManager/system-connections"

def is_migrated_before():
    """Make this tool run once; so after migration, touch a file named '.migrated'
    under old network manager profiles dir. Check it first and then try to migrate profiles.
    """

    global migration_sign
    if os.path.exists(migration_sign):
        return True
    else:
        return False

def get_default_nameservers():
    """Read once default name servers in resolve.default.conf, if 'name_mode' in
    given profile was set to default, supply these values in the new profile file
    """
    global default_nameservers
    if len(default_nameservers) == 0:
        if os.path.exists(default_resolv_conf_file):
            with open(default_resolv_conf_file) as f:
                nameservers_file = f.readlines()

            for line in nameservers_file:
                if not line.startswith("#") and line.startswith("nameserver"):
                    ns = line.split()[-1]
                    default_nameservers.append(ns)

        #If we can't find default.resolv.conf, supply default Pardus DNS servers
        else:
            default_nameservers = ["193.140.100.210", "193.140.100.215", "193.140.100.220"]

    return default_nameservers

class PardusNetworkProfile:
    """Represents COMAR based network profiles that we have been using in Pardus' network
    manager. We have two types of network profiles specified: wired or wireless
    """

    def __init__(self, name, connection_type, settings):

        self.profile_name = name
        self.connection_type = connection_type
        self.device = "none"
        self.net_mode = "none"
        self.name_mode = "none"
        self.state = "none"
        self.name_server = "none"
        self.net_address = "none"
        self.net_mask = "none"
        self.net_gateway = "none"
        self.remote = "none"
        self.auth = "none"
        self.auth_password = "none"

        self.set_attributes(settings)

    def set_attributes(self, settings):
        """We receive profile settings as dictionary type in 'settings'
        Map each key-value pairs for each object.
        """

        for key, value in settings.items():
            self.__dict__[key] = value

    def get_profile_name(self):
        return self.profile_name

    def get_connection_type(self):
        return self.connection_type

    def get_device(self):
        return self.device

    def get_net_mode(self):
        return self.net_mode

    def get_name_mode(self):
        return self.name_mode

    def get_state(self):
        return self.state

    def get_name_server(self):
        return self.name_server

    def get_net_address(self):
        return self.net_address

    def get_net_mask(self):
        return self.net_mask

    def get_net_gateway(self):
        return self.net_gateway

    def get_remote(self):
        return self.remote

    def get_auth(self):
        return self.auth

    def get_auth_password(self):
        return self.auth_password

class NetworkManagerProfile:
    """Represents network profiles used in NetworkManager. In NetworkManager,
    settings are kept in a seperate file for each profile.
    """

    def __init__(self, name, pardus_profile):
        """Each section is kept in corresponding class attribute"""

        self.cfg = ConfigParser.ConfigParser()
        self.connection = Connection(pardus_profile)
        self.ipv4 = IpV4(pardus_profile)
        self.ipv6 = IpV6(pardus_profile)
        self._802_3_ethernet = self.set_802_3_ethernet(pardus_profile)
        self._802_11_wireless = self.set_802_11_wireless(pardus_profile)
        self._802_11_wireless_security = self.set_802_11_wireless_security(pardus_profile)

        self.create_config()

    def set_802_3_ethernet(self, pardus_profile):
        """If this is a wired (802-3-ethernet) profile, set _802_3_ethernet
        attribute.
        """

        if pardus_profile.connection_type == "802-3-ethernet":
            return  _802_3_Ethernet(pardus_profile)
        else:
            return "none"

    def set_802_11_wireless(self, pardus_profile):
        """If this is a wireless (802-11-wirelesss) profile, set
        _802_11_wireless attribute."""
        if pardus_profile.connection_type == "802-11-wireless":
            return  _802_11_Wireless(pardus_profile)
        else:
            return "none"

    def set_802_11_wireless_security(self, pardus_profile):
        """If the wireless connection has any security restrictions, create a
        802-11-wireless-security section with corresponding values.
        """

        if pardus_profile.get_connection_type() ==  "802-11-wireless": #Check if it is a wlan profile
            if pardus_profile.get_auth() == "none":
                self._802_11_wireless.security = "none"
                return "none"
            else:
                self._802_11_wireless.security = "802-11-wireless-security"
                return _802_11_Wireless_Security(pardus_profile)
        else:
            return "none"

    def create_config(self):
        """Create sections and options in the prfoile's config file by calling
        each options corresponding method.
        """

        #FIXME: Try to do it over loops ie. self[attr].set_config()
        for attr, value in self.__dict__.items():
            if attr == "connection":
                self.connection.set_config(self.cfg)
            if attr == "ipv4":
                self.ipv4.set_config(self.cfg)
            if attr == "ipv6":
                self.ipv6.set_config(self.cfg)
            if attr == "_802_3_ethernet" and not value == "none":
                self._802_3_ethernet.set_config(self.cfg)
            if attr == "_802_11_wireless" and not value == "none":
                self._802_11_wireless.set_config(self.cfg)
            if attr == "_802_11_wireless_security" and not value == "none":
                self._802_11_wireless_security.set_config(self.cfg)

    def write_config(self):
        """Write settings to profile file"""

        #Before writing to file we must convert underscores to dashes, moreover _id must be written as id, and _type as type

        if not os.path.exists(NetworkManager_conf_dir):
            os.makedirs(NetworkManager_conf_dir, mode=0755)

        profile_path = os.path.join("%s" % NetworkManager_conf_dir, self.connection._id)
        with open(profile_path, "wb") as configfile:
            self.cfg.write(configfile)

    def set_ownership(self):
        """NetworkManager is smart enough to understand whether a configuration file is valid
        by checking its permissions"""

        os.chmod(os.path.join("%s" % NetworkManager_conf_dir, self.connection._id), 0600)

class Connection:
    """Instances of Connection class represent essential properties of a network connection to identify itself."""

    def __init__(self, pardus_profile):
        self.name = "connection"
        self._id = pardus_profile.get_profile_name()
        self.uuid = self.set_uuid(device = pardus_profile.get_device())
        self._type = pardus_profile.get_connection_type()
        self.autoconnect = self.set_autoconnect(pardus_profile)
        self.timestamp = "none"
        self.read_only = "false"

    def set_autoconnect(self, profile):
        """Set profile activation at startup"""

        if str(profile.get_state()) == "down":
            return "false"
        else:
            return "none"   #NM set this 'true' as default if we dont set anything

    def set_uuid(self, device):
        """Generate random type UUID"""
        import uuid

        return str(uuid.uuid4())

    def set_config(self, cfg):
        """One single config file will be used to write settings"""

        cfg.add_section(self.name)
        for attr, value in self.__dict__.items():
            if value not in ["false", "none"] and  attr != "name":
                #Before creating config file _id must be id, and _type must be type
                if attr == "_id" or attr == "_type" : attr = attr.split("_")[-1]
                #There isnt any underscore in config options, replace them with dashes if found any
                attr = attr.replace("_", "-")
                cfg.set(self.name, attr, value)

class IpV4:
    """Instances of IpV4 class represent IPv4 based properties of a connection."""

    def __init__(self, pardus_profile):
        self.name = "ipv4"
        self.dns_search = "none"
        self.routes = "none"
        self.ignore_auto_routes = "false"
        self.ignore_auto_dns = "false"
        self.dhcp_client_id = "none"
        self.dhcp_send_hostname = "false"
        self.dhcp_hostname = "none"
        self.never_default = "false"
        self.method = pardus_profile.get_net_mode() # auto or manual, same as in NM
        self.addresses1 = self.set_addresses(pardus_profile)    # NM uses array of IPv4 address structures. We have only one for each iface
        self.dns = self.set_dns(pardus_profile)

    def set_dns(self, pardus_profile):
        """Decide whether to use default, custom or auto (DHCP assigned) nameservers"""

        if pardus_profile.get_name_mode() == "default":
            default_nameservers = ";".join( get_default_nameservers())
            default_nameservers = default_nameservers + ";" # Make sure addresses end with ';'
            self.ignore_auto_dns = "true"
            return str(default_nameservers)
        elif pardus_profile.get_name_mode() == "custom":
            name_server = str(pardus_profile.get_name_server())
            name_server = name_server + ";"
            self.ignore_auto_dns = "true"
            return str(name_server)
        else:
            # Nothing done in auto option
            return "none"

    def set_addresses(self, pardus_profile):
        """Set network addresses from given settings"""

        addresses = []
        if self.method == "manual":
            net_mask = self.calculate_prefix(pardus_profile.get_net_mask())
            addresses.append(str(pardus_profile.get_net_address()))
            addresses.append(str(net_mask))
            addresses.append(str(pardus_profile.get_net_gateway()))
            addresses = ";".join(addresses)
            addresses = addresses + ";"     # Make sure addresses end with ';'
            return addresses
        else:
            return "none"

    def decimal2binary(self, n):
        """Convert decimal octet value to binary format"""

        octet = ["0", "0", "0", "0", "0", "0", "0", "0"]
        index = 0
        if n < 0 or n > 255:
            raise ValueError, "Octet value must be between [0-255]"
        if n == 0:
            return "".join(octet)
        while n > 0:
            octet[index] = str((n % 2))
            index += 1
            n = n >> 1
        octet.reverse()
        return "".join(octet)

    def calculate_prefix(self, net_mask):
        """Convert netmask value to CIDR prefix type which is between [1-32] as told in NM spec
            See http://mail.gnome.org/archives/networkmanager-list/2008-August/msg00076.html"""

        octets = net_mask.split(".")
        octet_in_binary = []
        netmask_value = 0
        for octet in octets:
            ret = self.decimal2binary(int(octet))
            octet_in_binary.append(ret)
        for i in "".join(octet_in_binary):
            if int(i) == 1 : netmask_value += 1
        return netmask_value

    def set_config(self, cfg):
        """One single config file will be used to write settings"""

        cfg.add_section(self.name)
        for attr, value in self.__dict__.items():
            if value not in ["false", "none"] and  attr != "name":
                attr = attr.replace("_", "-")
                cfg.set(self.name, attr, value)

class IpV6:
    """Instances of IpV6 class represent IPv6 based properties of a connection."""

    def __init__(self, pardus_profile):
        self.name = "ipv6"
        self.method = "none"
        self.dns = "none"
        self.dns_search = "none"
        self.addresses = "none"
        self.routes = "none"
        self.ignore_auto_routes = "false"
        self.ignore_auto_dns = "false"
        self.dhcp_client_id = "none"
        self.dhcp_send_hostname = "none"
        self.dhcp_hostname = "none"
        self.never_default = "false"

        self.set_method()

    def set_method(self):
        """Ignoring by default for nowadays"""
        self.method = "ignore"

    def set_config(self, cfg):
        """One single config file will be used to write settings"""

        cfg.add_section(self.name)
        for attr, value in self.__dict__.items():
            if value not in ["false", "none"] and  attr != "name":
                attr = attr.replace("_", "-")
                cfg.set(self.name, attr, value)

class _802_3_Ethernet:
    """Instances of _802_3_Ethernet class represent options related with ethernet device."""

    def __init__(self, pardus_profile):
        self.name = "802-3-ethernet"
        self.port = "none"
        self.speed = "none" #0
        self.duplex = "full"
        self.auto_negotiate = "false"
        self.mac_address = self.set_mac_address(pardus_profile.get_device())
        self.mtu = "none" #0

    def set_mac_address(self, iface):
        """Return MAC addresses of given interface on the machine"""
        if os.path.exists("/sys/class/net/%s" % iface):
            return open("/sys/class/net/%s/address" % iface).read().strip()
        return "none"

    def set_config(self, cfg):
        """One single config file will be used to write settings"""

        cfg.add_section(self.name)
        for attr, value in self.__dict__.items():
            if value not in ["false", "none"] and  attr != "name":
                attr = attr.replace("_", "-")
                cfg.set(self.name, attr, value)

class _802_11_Wireless:
    """Instances of _802_11_Wireless class represent options related with wireless device."""

    def __init__(self, pardus_profile):
        self.name = "802-11-wireless"
        self.ssid = self.set_ssid(pardus_profile)
        self.band = "none"
        self.channel = "0"
        self.bssid = "none"
        self.rate = "0"
        self.tx_power = "0"
        self.mtu = "0"
        self.seen_bssids = "none"
        self.security = "none"
        self.mode = self.set_mode(pardus_profile)
        self.mac_address = self.set_mac_address(pardus_profile.get_device())

    def set_mac_address(self, iface):
        """Return MAC addresses of given interface on the machine"""
        if os.path.exists("/sys/class/net/%s" % iface):
            return open("/sys/class/net/%s/address" % iface).read().strip()
        return "none"

    def set_mode(self, pardus_profile):
        """One of 'infrastructure' or 'adhoc'. If blank, infrastructure is assumed"""

        #TODO: How to determine mode (adhoc or infrastructure) from old profile settings
        return "infrastructure"

    def set_ssid(self, pardus_profile):
        """Set ssid value"""

        if pardus_profile.connection_type == "802-11-wireless":
            return str(pardus_profile.get_remote())
        else:
            return "none"

    def set_config(self, cfg):
        """One single config file will be used to write settings"""

        cfg.add_section(self.name)
        for attr, value in self.__dict__.items():
            if value not in ["false", "none", "0"] and  attr != "name":
                attr = attr.replace("_", "-")
                cfg.set(self.name, attr, value)

class _802_11_Wireless_Security:
    """Instances of _802_11_Wireless_Security class represent authentication properties and operations
    used in order to be included in networks requiring them.
    """

    def __init__(self, pardus_profile):
        self.name = "802-11-wireless-security"
        self.key_mgmt = "none"
        self.wep_tx_keyidx = "0"
        self.auth_alg = "none"
        self.proto = "none"
        self.pairwise = "none"
        self.group = "none"
        self.leap_username = "none"
        self.wep_key0 = "none"
        self.wep_key1 = "none"
        self.wep_key2 = "none"
        self.wep_key3 = "none"
        self.psk = "none"
        self.leap_password = "none"
        self.wep_key_type = "0"

        self.set_up_wireless_security(pardus_profile)

    def set_up_wireless_security(self, pardus_profile):
        """WEP, WPA or none type security based operations"""

        if pardus_profile.get_auth() in ["wep", "wepascii"]:
            self.set_wep(pardus_profile)
        elif pardus_profile.get_auth() == "wpa-psk":
            self.set_wpa(pardus_profile)
        else:
            return

    def set_wpa(self, pardus_profile):
        """Set up WPA based networks"""

        self.key_mgmt = "wpa-psk"
        self.psk = str(pardus_profile.get_auth_password())

    def set_wep(self, pardus_profile):
        """Set up WEP based networks"""

        self.auth_alg = "open" #TODO: or 'shared' ??
        self.key_mgmt = "None" # Which stands for WEP based key management
        self.wep_key0 = str(pardus_profile.get_auth_password()) # Default index
        self.wep_key_type = "1" # Interpret WEP keys as hex or ascii keys

    def set_config(self, cfg):
        """One single config file will be used to write settings"""

        cfg.add_section(self.name)
        for attr, value in self.__dict__.items():
            if value not in ["false", "none", "0"] and  attr != "name":
                attr = attr.replace("_", "-")

                # key-mgmt=none is a mandatory assignment for WEP based
                # configurations. As we set all class members' default value
                # to 'none', and then filter to set config file with non-none
                # values, key-mgmt is set to 'None' intentionally to pass that
                # filtering, and its value is set later on by lowercasing to
                # hack around this situation.
                if attr == "key-mgmt":
                    value = value.lower()
                cfg.set(self.name, attr, value)

class Migrator:
    """Read COMAR based network profiles we have been using in Pardus' network manager and
    transform them into NetworkManager profile type.
    """

    def __init__(self):

        self.pardus_profiles = []
        self.network_manager_profiles = []
        self.lan_config_path = lan_config_file
        self.wlan_config_path = wlan_config_file
        self.read_pardus_profiles()

    def read_pardus_profiles(self):
        """Read wired/wireless profile settings, create PardusNetworkProfile
        object for each one, and store them in a list.
        """

        self.lan_config = ConfigParser.ConfigParser()
        self.lan_config.read(self.lan_config_path)
        connection_type = "802-3-ethernet"
        for section in self.lan_config.sections():
            lan_settings = {}
            for option in self.lan_config.options(section):
                if option == "device":
                    #To strip device name from long device string
                    lan_settings[option] = self.lan_config.get(section, option).split("_")[-1]
                else:
                    lan_settings[option] = self.lan_config.get(section, option)
            p = PardusNetworkProfile(section, connection_type, lan_settings)
            self.pardus_profiles.append(p)

        self.wlan_config = ConfigParser.ConfigParser()
        self.wlan_config.read(self.wlan_config_path)
        connection_type = "802-11-wireless"
        for section in self.wlan_config.sections():
            wlan_settings = {}
            for option in self.wlan_config.options(section):
                if option == "device":
                    wlan_settings[option] = self.wlan_config.get(section, option).split("_")[-1]
                else:
                    wlan_settings[option] = self.wlan_config.get(section, option)
            p = PardusNetworkProfile(section, connection_type, wlan_settings)
            self.pardus_profiles.append(p)

    def transform_profiles(self):
        """Convert Pardus' network profiles to NetworkManager profiles"""

        if len(self.pardus_profiles) > 0:  # Make sure we have some profiles to migrate
            for profile in self.pardus_profiles:
                network_manager_profile = NetworkManagerProfile(profile.get_profile_name, profile)
                self.network_manager_profiles.append(network_manager_profile)

    def write_network_manager_profiles(self):
        """Create profile file for each NetworkManager profile and change ownerships to 0600"""

        if len(self.network_manager_profiles) > 0:  # Make sure we have some profiles to migrate
            for profile in self.network_manager_profiles:
                profile.write_config()
                profile.set_ownership()
        with open(migration_sign, "w") as f:
            pass

if __name__ == "__main__":

    print "DEBUG: Checking whether network profiles migrated..."
    if not is_migrated_before():
        m = Migrator()
        m.transform_profiles()
        m.write_network_manager_profiles()
        print "DEBUG: Network profiles migration completed successfully!"
    else:
        print "DEBUG: Network profiles migration seems already done before. Nothing done this time!"


code: d /root/NetworkManager 0755 root root