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 shelltools
from pisi.actionsapi import libtools
from pisi.actionsapi import get

def setup():
    shelltools.export("CFLAGS", "%s -fno-strict-aliasing -fno-force-addr -ffunction-sections -frename-registers -fomit-frame-pointer" % get.CFLAGS())
    shelltools.export("CXXFLAGS", "%s -fno-strict-aliasing -fno-force-addr -ffunction-sections -frename-registers -fomit-frame-pointer" % get.CXXFLAGS())
    shelltools.export("CCASFLAGS","-Wa,--noexecstack")
    # to get rid of cvs
    shelltools.export("AUTOPOINT", "true")

    #libtools.libtoolize("--force --copy")
    autotools.autoreconf("-vfi")
    autotools.configure(" \
                      --prefix=/usr \
                      --mandir=/usr/share/man \
                      --disable-altivec \
                      --disable-artstest \
                      --disable-dxr3 \
                      --disable-vidix \
                      --disable-vcd \
                      --disable-mpcdec \
                      --enable-aalib \
                      --enable-asf \
                      --enable-directfb \
                      --enable-faad \
                      --enable-fb \
                      --enable-ffmpeg-popular-codecs \
                      --enable-ffmpeg-uncommon-codecs \
                      --enable-ipv6 \
                      --enable-mmap \
                      --enable-modplug \
                      --enable-opengl \
                      --disable-samba \
                      --enable-xinerama \
                      --with-external-a52dec \
                      --with-external-ffmpeg \
                      --with-external-libmad \
                      --with-vorbis \
                      --with-x \
                      --with-xcb \
                      --with-xv-path=/usr/lib \
                      --with-freetype \
                      --with-fontconfig \
                      --without-esound \
                      --without-imagemagick \
                      --without-jack \
                      --disable-gdkpixbuf \
                      --disable-nls \
                      --disable-rpath \
                      --disable-syncfb \
                      --disable-optimizations \
                      --disable-dependency-tracking")
                      # the world is not ready for this code, see bug #8267
                      # --enable-antialiasing \
                      #--enable-mng \
                      #--with-wavpack \
                      #--with-internal-vcdlibs \

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

def build():
    autotools.make()

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

    pisitools.removeDir("/usr/share/doc/xine-lib")

    pisitools.dohtml("doc/faq/faq.html", "doc/hackersguide/*.html", "doc/hackersguide/*.png")
    pisitools.dodoc("AUTHORS", "ChangeLog", "README", "TODO", "doc/README*", "doc/faq/faq.txt")


code:
/*
 * Copyright (C) 2008 the xine project
 *
 * This file is part of xine, a free video player.
 *
 * xine 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.
 *
 * xine is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
 *
 *
 * Common acceleration definitions for vdpau
 *
 *
 */

#ifndef HAVE_XINE_ACCEL_VAAPI_H
#define HAVE_XINE_ACCEL_VAAPI_H

#ifdef __cplusplus
extern "C" {
#endif

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <va/va_x11.h>
#include <pthread.h>
#ifdef HAVE_FFMPEG_AVUTIL_H
#  include <avcodec.h>
#else
#  include <libavcodec/avcodec.h>
#endif

#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR == 52 && LIBAVCODEC_VERSION_MINOR >= 32)
#  define AVVIDEO 2
#else
#  define AVVIDEO 1
#  define pp_context	pp_context_t
#  define pp_mode	pp_mode_t
#endif

#define NUM_OUTPUT_SURFACES 22

#define SURFACE_FREE            0
#define SURFACE_ALOC            1
#define SURFACE_RELEASE         2
#define SURFACE_RENDER          3
#define SURFACE_RENDER_RELEASE  5

struct vaapi_equalizer {
  VADisplayAttribute brightness;
  VADisplayAttribute contrast;
  VADisplayAttribute hue;
  VADisplayAttribute saturation;
};

typedef struct ff_vaapi_context_s ff_vaapi_context_t;

struct ff_vaapi_context_s {
  VADisplay         va_display;
  VAContextID       va_context_id;
  VAConfigID        va_config_id;
  int               width;
  int               height;
  int               sw_width;
  int               sw_height;
  int               va_profile;
  unsigned int      va_colorspace;
  VAImage           va_subpic_image;
  VASubpictureID    va_subpic_id;
  int               va_subpic_width;
  int               va_subpic_height;
  int               is_bound;
  void              *gl_surface;
  unsigned int      soft_head;
  unsigned int      valid_context;
  unsigned int      va_head;
  unsigned int      va_soft_head;
  vo_driver_t       *driver;
  unsigned int      last_sub_image_fmt;
  VASurfaceID       last_sub_surface_id;
  struct vaapi_equalizer va_equalizer;
  VAImageFormat     *va_image_formats;
  int               va_num_image_formats;
  VAImageFormat     *va_subpic_formats;
  int               va_num_subpic_formats;
};

typedef struct ff_vaapi_surface_s ff_vaapi_surface_t;
typedef struct vaapi_accel_s vaapi_accel_t;

struct ff_vaapi_surface_s {
  unsigned int        index;
  vaapi_accel_t       *accel;
  VASurfaceID         va_surface_id;
  unsigned int        status;
};

struct vaapi_accel_s {
  unsigned int        index;
  vo_frame_t          *vo_frame;

#if AVVIDEO > 1
  int (*avcodec_decode_video2)(vo_frame_t *frame_gen, AVCodecContext *avctx, AVFrame *picture,
                               int *got_picture_ptr, AVPacket *avpkt);
#else
  int (*avcodec_decode_video)(vo_frame_t *frame_gen, AVCodecContext *avctx, AVFrame *picture,
                              int *got_picture_ptr, uint8_t *buf, int buf_size);
#endif
  VAStatus (*vaapi_init)(vo_frame_t *frame_gen, int va_profile, int width, int height, int softrender);
  int (*profile_from_imgfmt)(vo_frame_t *frame_gen, enum PixelFormat pix_fmt, int codec_id, int vaapi_mpeg_sofdec);
  ff_vaapi_context_t *(*get_context)(vo_frame_t *frame_gen);
  int (*guarded_render)(vo_frame_t *frame_gen);
  ff_vaapi_surface_t *(*get_vaapi_surface)(vo_frame_t *frame_gen);
  void (*render_vaapi_surface)(vo_frame_t *frame_gen, ff_vaapi_surface_t *va_surface);
  void (*release_vaapi_surface)(vo_frame_t *frame_gen, ff_vaapi_surface_t *va_surface);
};

#ifdef __cplusplus
}
#endif

#endif

repo_name: ayhanyalcinsoy/main


code:
--- xine-lib-1.1.1/src/xine-engine/load_plugins.c.~1~	2005-09-19 09:14:02.000000000 -0700
+++ xine-lib-1.1.1/src/xine-engine/load_plugins.c	2006-04-22 23:07:33.000000000 -0700
@@ -591,7 +591,7 @@ static void collect_plugins(xine_t *this
 	    printf("load_plugins: %s not cached\n", str);
 #endif

-	  if(!info && (lib = dlopen (str, RTLD_LAZY | RTLD_GLOBAL)) == NULL) {
+	  if(!info && (lib = dlopen (str, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)) == NULL) {
 	    const char *error = dlerror();
 	    /* too noisy -- but good to catch unresolved references */
 	    xprintf(this, XINE_VERBOSITY_LOG,
@@ -649,7 +649,7 @@ static int _load_plugin_class(xine_t *th
     /* load the dynamic library if needed */
     if (!node->file->lib_handle) {
       lprintf("dlopen %s\n", filename);
-      if ((lib = dlopen (filename, RTLD_LAZY | RTLD_GLOBAL)) == NULL) {
+      if ((lib = dlopen (filename, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)) == NULL) {
 	const char *error = dlerror();

 	xine_log (this, XINE_LOG_PLUGIN,


code:
diff -Nur xine-lib-1.1.15-old/src/libw32dll/dmo/DMO_VideoDecoder.c xine-lib-1.1.15/src/libw32dll/dmo/DMO_VideoDecoder.c
--- xine-lib-1.1.15-old/src/libw32dll/dmo/DMO_VideoDecoder.c	2008-09-27 20:55:34.000000000 +0300
+++ xine-lib-1.1.15/src/libw32dll/dmo/DMO_VideoDecoder.c	2008-09-27 21:33:01.000000000 +0300
@@ -87,7 +87,7 @@
     {     24, 24, &MEDIASUBTYPE_RGB24, CAP_NONE },
     {     32, 32, &MEDIASUBTYPE_RGB32, CAP_NONE },

-    {0},
+    {0,0,NULL,0},
 };

 DMO_VideoDecoder * DMO_VideoDecoder_Open(char* dllname, GUID* guid, BITMAPINFOHEADER * format, int flip, int maxauto)
@@ -288,8 +288,8 @@
     props.cBuffers = 1;
     props.cbBuffer = this->m_sDestType.lSampleSize;

-    //don't know how to do this correctly
-    props.cbAlign = props.cbPrefix = 0;
+    props.cbAlign = 1;
+    props.cbPrefix = 0;
     this->m_pDMO_Filter->m_pAll->vt->SetProperties(this->m_pDMO_Filter->m_pAll, &props, &props1);
     this->m_pDMO_Filter->m_pAll->vt->Commit(this->m_pDMO_Filter->m_pAll);
 #endif
@@ -327,7 +327,7 @@
     bufferin = CMediaBufferCreate(size, (void*)src, size, 0);
     result = this->m_pDMO_Filter->m_pMedia->vt->ProcessInput(this->m_pDMO_Filter->m_pMedia, 0,
 						      (IMediaBuffer*)bufferin,
-						      (is_keyframe) ? DMO_INPUT_DATA_BUFFERF_SYNCPOINT : 0,
+						      DMO_INPUT_DATA_BUFFERF_SYNCPOINT,
 						      0, 0);
     ((IMediaBuffer*)bufferin)->vt->Release((IUnknown*)bufferin);

@@ -463,8 +463,9 @@
 	  this->iv.m_obh.biSize = sizeof(BITMAPINFOHEADER);
 	  this->iv.m_obh.biCompression=csp;
 	  this->iv.m_obh.biBitCount=bits;
-	  this->iv.m_obh.biSizeImage=labs(this->iv.m_obh.biBitCount*
-             this->iv.m_obh.biWidth*this->iv.m_obh.biHeight)>>3;
+
+	  this->iv.m_obh.biSizeImage = labs(this->iv.m_obh.biWidth * this->iv.m_obh.biHeight)
+                                       * ((this->iv.m_obh.biBitCount + 7) / 8);
         }
     }
     this->m_sDestType.lSampleSize = this->iv.m_obh.biSizeImage;


code:
diff -urN xine-lib-1.1.12.orig/misc/xine-list.c xine-lib-1.1.12/misc/xine-list.c
--- xine-lib-1.1.12.orig/misc/xine-list.c	2008-04-06 21:32:21 +0300
+++ xine-lib-1.1.12/misc/xine-list.c	2008-04-19 21:15:50 +0300
@@ -125,7 +125,11 @@
       sep = strchr (text, ';') ? : text + strlen (text);
       sep2 = which == 'a' ? sep : strchr (text, ':') ? : sep;
       if (!*sep)
-        break;
+      {
+        if (text[0])
+          printf ("%s;", text);
+          break;
+      }
       if (printf ("%.*s;", (int)(sep2 - text), text) < 0 || (lf && puts ("") < 0))
         goto write_fail;
     }


code:
diff -Nur xine-lib-1.1.19-old//m4/pthreads.m4 xine-lib-1.1.19/m4/pthreads.m4
--- xine-lib-1.1.19-old//m4/pthreads.m4	2010-09-04 18:26:52.719999251 +0300
+++ xine-lib-1.1.19/m4/pthreads.m4	2010-09-04 18:28:15.110999847 +0300
@@ -15,7 +15,7 @@
   AC_ARG_VAR([PTHREAD_CFLAGS], [C compiler flags for Pthread support])
   AC_ARG_VAR([PTHREAD_LIBS], [linker flags for Pthread support])

-  dnl if PTHREAD_* are not set, default to -pthread (GCC)
+  dnl if PTHREAD_* are not set, default to -lpthread (GCC)
   if test "${PTHREAD_CFLAGS-unset}" = "unset"; then
      case $host in
        *-mingw*)  PTHREAD_CFLAGS=""		;;
@@ -25,7 +25,7 @@
                   dnl Handle Sun Studio compiler (also on Linux)
                   CC_CHECK_CFLAGS([-mt], [PTHREAD_CFLAGS="-mt"]);;

-       *)	  PTHREAD_CFLAGS="-pthread"	;;
+       *)	  PTHREAD_CFLAGS="-lpthread"	;;
      esac
   fi
   if test "${PTHREAD_LIBS-unset}" = "unset"; then
@@ -36,7 +36,7 @@
        *-solaris*)
                   dnl Use the same libraries for gcc and Sun Studio cc
                   PTHREAD_LIBS="-lpthread -lposix4 -lrt";;
-       *)	  PTHREAD_LIBS="-pthread"	;;
+       *)	  PTHREAD_LIBS="-lpthread"	;;
      esac

      dnl Again, handle Sun Studio compiler


code:
diff -up xine-lib-1.1.16.2/misc/xine-config.in.multilib xine-lib-1.1.16.2/misc/xine-config.in
--- xine-lib-1.1.16.2/misc/xine-config.in.multilib	2008-06-25 08:04:09.000000000 -0500
+++ xine-lib-1.1.16.2/misc/xine-config.in	2009-02-20 07:34:27.000000000 -0600
@@ -6,12 +6,6 @@ unset prefix
 unset exec_prefix
 unset args

-PKG_CONFIG_PATH="`cat <<'EOF'
-@XINE_PKGCONFIG_DIR@
-EOF
-`${PKG_CONFIG_PATH:+:}$PKG_CONFIG_PATH"
-export PKG_CONFIG_PATH
-
 usage()
 {
 	cat <<EOF


code:
diff -up xine-lib-1.1.17/autogen.sh.no_autopoint xine-lib-1.1.17/autogen.sh
--- xine-lib-1.1.17/autogen.sh.no_autopoint	2009-10-09 09:33:31.000000000 -0500
+++ xine-lib-1.1.17/autogen.sh	2009-12-02 09:15:48.534555467 -0600
@@ -229,10 +229,10 @@ run_aclocal () {
     echo
   fi

-  echo $_echo_n " + Running autopoint: $_echo_c"
+  #echo $_echo_n " + Running autopoint: $_echo_c"

-  autopoint
-  echo "done."
+  #autopoint
+  #echo "done."

   echo $_echo_n " + Running aclocal: $_echo_c"


code:
diff -Nur xine-lib-1.1.18.1-old/src/xine-engine/xine.c xine-lib-1.1.18.1/src/xine-engine/xine.c
--- xine-lib-1.1.18.1-old/src/xine-engine/xine.c	2010-04-15 17:34:34.920980153 +0300
+++ xine-lib-1.1.18.1/src/xine-engine/xine.c	2010-04-15 17:36:18.330983403 +0300
@@ -1710,7 +1710,7 @@
   _x_scan_plugins(this);

 #ifdef HAVE_SETLOCALE
-  if (!setlocale(LC_CTYPE, ""))
+  if (!setlocale(LC_CTYPE, "en_US.UTF-8"))
     xprintf(this, XINE_VERBOSITY_LOG, _("xine: locale not supported by C library\n"));
 #endif

diff -Nur xine-lib-1.1.18.1-old/src/xine-utils/utils.c xine-lib-1.1.18.1/src/xine-utils/utils.c
--- xine-lib-1.1.18.1-old/src/xine-utils/utils.c	2010-04-15 17:34:34.915980632 +0300
+++ xine-lib-1.1.18.1/src/xine-utils/utils.c	2010-04-15 17:36:04.272983486 +0300
@@ -564,7 +564,7 @@
   char *codeset = NULL;

 #ifdef HAVE_NL_LANGINFO
-  setlocale(LC_CTYPE, "");
+  setlocale(LC_CTYPE, "en_US.UTF-8");
   codeset = nl_langinfo(CODESET);
 #endif
   /*


code:
Index: xine-lib-1.2.6/src/combined/ffmpeg/ff_audio_decoder.c
===================================================================
--- xine-lib-1.2.6.orig/src/combined/ffmpeg/ff_audio_decoder.c
+++ xine-lib-1.2.6/src/combined/ffmpeg/ff_audio_decoder.c
@@ -590,7 +590,7 @@ static int ff_audio_decode (ff_audio_dec
   int got_frame;
   float gain = this->class->gain;
   if (!this->av_frame)
-    this->av_frame = avcodec_alloc_frame ();
+    this->av_frame = av_frame_alloc ();

   consumed = avcodec_decode_audio4 (this->context, this->av_frame, &got_frame, &avpkt);
   if ((consumed >= 0) && got_frame) {
@@ -1071,7 +1071,7 @@ static void ff_audio_reset (audio_decode
   /* try to reset the wma decoder */
   if( this->decoder_ok ) {
 #if AVAUDIO > 3
-    avcodec_free_frame (&this->av_frame);
+    av_frame_free (&this->av_frame);
 #endif
     pthread_mutex_lock (&ffmpeg_lock);
     avcodec_close (this->context);
@@ -1105,7 +1105,7 @@ static void ff_audio_dispose (audio_deco

   if( this->context && this->decoder_ok ) {
 #if AVAUDIO > 3
-    avcodec_free_frame (&this->av_frame);
+    av_frame_free (&this->av_frame);
 #endif
     pthread_mutex_lock (&ffmpeg_lock);
     avcodec_close (this->context);
Index: xine-lib-1.2.6/src/combined/ffmpeg/ff_video_decoder.c
===================================================================
--- xine-lib-1.2.6.orig/src/combined/ffmpeg/ff_video_decoder.c
+++ xine-lib-1.2.6/src/combined/ffmpeg/ff_video_decoder.c
@@ -2523,7 +2523,7 @@ static video_decoder_t *ff_video_open_pl
   this->stream                            = stream;
   this->class                             = (ff_video_class_t *) class_gen;

-  this->av_frame          = avcodec_alloc_frame();
+  this->av_frame          = av_frame_alloc();
   this->context           = avcodec_alloc_context();
   this->context->opaque   = this;
 #if AVPALETTE == 1
--- xine-lib-1.2.6/src/dxr3/ffmpeg_encoder.c.orig	2016-02-17 07:54:31.950881580 +0000
+++ xine-lib-1.2.6/src/dxr3/ffmpeg_encoder.c	2016-02-17 07:55:42.897237494 +0000
@@ -161,7 +161,7 @@
       "dxr3_mpeg_encoder: Couldn't start the ffmpeg library\n");
     return 0;
   }
-  this->picture = avcodec_alloc_frame();
+  this->picture = av_frame_alloc();
   if (!this->picture) {
     xprintf(drv->class->xine, XINE_VERBOSITY_LOG,
       "dxr3_mpeg_encoder: Couldn't allocate ffmpeg frame\n");


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>xine-lib</Name>
        <Homepage>http://xine.sourceforge.net/</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv2</License>
        <IsA>library</IsA>
        Core libraries for Xine movie player
        <Description>This package contains the Xine library. It can be used to play back various media, decode multimedia files from local disk drives, and display multimedia streamed over the Internet. It interprets many of the most common multimedia formats available - and some uncommon formats, too.</Description>
        <Archive sha1sum="f20115ddfced42d51feb159393607b17e6f2bdc1" type="tarxz">http://sourceforge.net/projects/xine/files/xine-lib/1.2.8/xine-lib-1.2.8.tar.xz</Archive>
        <AdditionalFiles>
            <AdditionalFile permission="0644" target="src/xine-engine/accel_vaapi.h">accel_vaapi.h</AdditionalFile>
        </AdditionalFiles>
        <BuildDependencies>
            <Dependency>libXext-devel</Dependency>

            <Dependency>fontconfig-devel</Dependency>
            <Dependency>freetype-devel</Dependency>
            <Dependency>zlib-devel</Dependency>
            <Dependency>libXinerama-devel</Dependency>
            <Dependency>libXv-devel</Dependency>
            <Dependency>libXvMC-devel</Dependency>
            <Dependency>libogg-devel</Dependency>
            <Dependency>libvorbis-devel</Dependency>
            <Dependency>mesa-devel</Dependency>
            <Dependency>libdvdcss-devel</Dependency>
            <Dependency>DirectFB-devel</Dependency>
            <Dependency>flac-devel</Dependency>
            <Dependency>libsdl-devel</Dependency>
            <Dependency>alsa-lib-devel</Dependency>
            <Dependency>aalib-devel</Dependency>
            <Dependency>libtheora-devel</Dependency>
            <Dependency>libvpx-devel</Dependency>
            <Dependency>samba-devel</Dependency>
            <Dependency>libmad-devel</Dependency>
            <Dependency>speex-devel</Dependency>
            <Dependency>libmodplug-devel</Dependency>
            <Dependency>ffmpeg-devel</Dependency>
            <Dependency>a52dec-devel</Dependency>

            <Dependency>libv4l-devel</Dependency>
            <Dependency>pulseaudio-libs-devel</Dependency>

            <Dependency>libdca-devel</Dependency>
            <Dependency>libbluray-devel</Dependency>
            <Dependency>libmng-devel</Dependency>

            <Dependency>libSM-devel</Dependency>
            <Dependency>libICE-devel</Dependency>
            <Dependency>libcdio-devel</Dependency>
            <Dependency>mesa-glu-devel</Dependency>
            <Dependency>libvdpau-devel</Dependency>
        </BuildDependencies>
        <Patches>

            <Patch level="1">list.patch</Patch>

            <Patch level="1">no_autopoint.patch</Patch>
            <Patch level="1">dmo.patch</Patch>
            <Patch level="1">tr_segfault_fix.patch</Patch>
            <Patch level="1">deepbind.patch</Patch>
            <Patch level="1">lpthread.patch</Patch>
        </Patches>
    </Source>

    <Package>
        <Name>xine-lib</Name>
        <RuntimeDependencies>
            <Dependency>mesa</Dependency>
            <Dependency>zlib</Dependency>
            <Dependency>flac</Dependency>

            <Dependency>speex</Dependency>
            <Dependency>aalib</Dependency>
            <Dependency>libXv</Dependency>

            <Dependency>libmad</Dependency>
            <Dependency>a52dec</Dependency>

            <Dependency>libdca</Dependency>
            <Dependency>libsdl</Dependency>
            <Dependency>libogg</Dependency>
            <Dependency>libv4l</Dependency>
            <Dependency>ffmpeg</Dependency>
            <Dependency>libX11</Dependency>

            <Dependency>libXvMC</Dependency>

            <Dependency>libXext</Dependency>
            <Dependency>libvpx</Dependency>
            <Dependency>libxcb</Dependency>
            <Dependency>alsa-lib</Dependency>
            <Dependency>freetype</Dependency>
            <Dependency>DirectFB</Dependency>
            <Dependency>libvdpau</Dependency>
            <Dependency>mesa-glu</Dependency>

            <Dependency>libtheora</Dependency>
            <Dependency>libbluray</Dependency>
            <Dependency>libvorbis</Dependency>
            <Dependency>fontconfig</Dependency>
            <Dependency>libmodplug</Dependency>

            <Dependency>pulseaudio-libs</Dependency>

        </RuntimeDependencies>
        <Files>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="data">/usr/share/xine</Path>
            <Path fileType="data">/usr/share/xine-lib/fonts</Path>
            <Path fileType="man">/usr/share/man</Path>
            <Path fileType="doc">/usr/share/doc/xine-lib</Path>
        </Files>
    </Package>

    <Package>
        <Name>xine-lib-devel</Name>
        Development files for xine-lib
        <RuntimeDependencies>
            <Dependency release="current">xine-lib</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="executable">/usr/bin/xine-config</Path>
            <Path fileType="data">/usr/lib/pkgconfig</Path>
            <Path fileType="header">/usr/include</Path>
            <Path fileType="data">/usr/share/aclocal</Path>
        </Files>
    </Package>

    <History>
        <Update release="3">
            <Date>2017-03-05</Date>
            <Version>1.2.8</Version>
            <Comment>Version bump.</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-14</Date>
            <Version>1.2.6</Version>
            <Comment>Release bump.</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2016-03-27</Date>
            <Version>1.2.6</Version>
            <Comment>First release</Comment>
            <Name>Kamil Atlı</Name>
            <Email>suvari@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>xine-lib</Name>
        Xine çokluortam oynatıcısının çekirdek kitaplıkları
        Librairies centrales pour le lecteur vidéo Xine.
        <Description xml:lang="tr">xine-lib çeşitli medyaları oynatmak, farklı medya yapılarını birbirine dönüştürmek, Internet üzerinden yayınları işleyip göstermek gibi işlevleri olan bir çokluortam kitaplığıdır. Yaygın çokluortam yapılarının çoğunu desteklediği gibi fazla yaygın olmayan yapıları da desteklemektedir.</Description>
    </Source>

    <Package>
        <Name>xine-lib-devel</Name>
        xine-lib için geliştirme dosyaları
        <Description xml:lang="tr">xine-lib için geliştirme dosyaları</Description>
    </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 shelltools
from pisi.actionsapi import get

WorkDir = "xvidcore/build/generic"

def setup():
    autotools.configure()

def build():
    autotools.make()

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

    shelltools.cd("../..")
    pisitools.insinto("/usr/share/doc/xvid/examples", "examples/*")
    pisitools.dodoc("AUTHORS", "ChangeLog*", "README", "LICENSE", "TODO")


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>xvid</Name>
        <Homepage>http://www.xvid.org/</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv2</License>
        <IsA>library</IsA>
        <Summary>High performance MPEG-4 video de-/encoding solution</Summary>
        <Description>Xvid is a codec which makes it possible to compress movies too much while still maintaining the original image quality.</Description>
        <Archive sha1sum="d8f58e35ec325ebd7de9a28440b725a40ea49dae" type="targz">http://downloads.xvid.org/downloads/xvidcore-1.3.4.tar.gz</Archive>
    </Source>

    <Package>
        <Name>xvid</Name>
        <Files>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="doc">/usr/share/doc/xvid</Path>
        </Files>
    </Package>

    <Package>
        <Name>xvid-devel</Name>
        <RuntimeDependencies>
            <Dependency release="current">xvid</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="doc">/usr/share/doc/xvid/examples</Path>
            <Path fileType="header">/usr/include</Path>
        </Files>
    </Package>

    <History>
        <Update release="3">
            <Date>2017-02-11</Date>
            <Version>1.3.4</Version>
            <Comment>Version Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>1.3.3</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2014-12-14</Date>
            <Version>1.3.3</Version>
            <Comment>First release</Comment>
            <Name>Yusuf Aydemir</Name>
            <Email>yusuf.aydemir@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>xvid</Name>
        <Summary xml:lang="tr">Yüksek performanslı bir MPEG-4 video kodlayıcı/çözücü</Summary>
        <Description xml:lang="tr">Xvid videoları kalite kaybına neden olmadan yüksek oranlarda sıkıştırabilmeye olanak tanıyan bir kodlayıcıdır.</Description>
        <Description xml:lang="es">Xvid es un codec que posibilita una alta compresión de peliculas, manteniendo la calidad original de la imagen.</Description>
    </Source>
</PISI>


code:
* working on https://github.com/ertugerata/main/raw/master/pisi-index.xml.xz
* working on http://ciftlik.pisilinux.org/2.0-Beta.1/pisi-index.xml.xz

* Packages missing in http://ciftlik.pisilinux.org/2.0-Beta.1/pisi-index.xml.xz
  desktop/kde/applications/korganizer
  desktop/toolkit/qt5/qt5-quick1
  kernel/drivers/module-fglrx
  programming/language/python3/python3-kappa

* Packages that needs compiling
  desktop/kde/graphics/libkface  (13 > 8)
  desktop/kde/l10n/kde-l10n-ar  (8 > 7)
  desktop/kde/l10n/kde-l10n-bg  (8 > 7)
  desktop/kde/l10n/kde-l10n-bs  (8 > 7)
  desktop/kde/l10n/kde-l10n-ca  (8 > 7)
  desktop/kde/l10n/kde-l10n-ca-valencia  (8 > 7)
  desktop/kde/l10n/kde-l10n-cs  (8 > 7)
  desktop/kde/l10n/kde-l10n-da  (8 > 7)
  desktop/kde/l10n/kde-l10n-de  (8 > 7)
  desktop/kde/l10n/kde-l10n-el  (8 > 7)
  desktop/kde/l10n/kde-l10n-en_GB  (8 > 7)
  desktop/kde/l10n/kde-l10n-eo  (8 > 7)
  desktop/kde/l10n/kde-l10n-es  (8 > 7)
  desktop/kde/l10n/kde-l10n-et  (8 > 7)
  desktop/kde/l10n/kde-l10n-eu  (8 > 7)
  desktop/kde/l10n/kde-l10n-fa  (8 > 7)
  desktop/kde/l10n/kde-l10n-fi  (8 > 7)
  desktop/kde/l10n/kde-l10n-fr  (8 > 7)
  desktop/kde/l10n/kde-l10n-ga  (8 > 7)
  desktop/kde/l10n/kde-l10n-gl  (8 > 7)
  desktop/kde/l10n/kde-l10n-he  (8 > 7)
  desktop/kde/l10n/kde-l10n-hi  (8 > 7)
  desktop/kde/l10n/kde-l10n-hr  (8 > 7)
  desktop/kde/l10n/kde-l10n-hu  (8 > 7)
  desktop/kde/l10n/kde-l10n-ia  (8 > 7)
  desktop/kde/l10n/kde-l10n-id  (8 > 7)
  desktop/kde/l10n/kde-l10n-is  (8 > 7)
  desktop/kde/l10n/kde-l10n-it  (8 > 7)
  desktop/kde/l10n/kde-l10n-ja  (8 > 7)
  desktop/kde/l10n/kde-l10n-kk  (8 > 7)
  desktop/kde/l10n/kde-l10n-km  (8 > 7)
  desktop/kde/l10n/kde-l10n-ko  (8 > 7)
  desktop/kde/l10n/kde-l10n-lt  (8 > 7)
  desktop/kde/l10n/kde-l10n-lv  (8 > 7)
  desktop/kde/l10n/kde-l10n-mr  (8 > 7)
  desktop/kde/l10n/kde-l10n-nb  (8 > 7)
  desktop/kde/l10n/kde-l10n-nds  (8 > 7)
  desktop/kde/l10n/kde-l10n-nl  (8 > 7)
  desktop/kde/l10n/kde-l10n-nn  (8 > 7)
  desktop/kde/l10n/kde-l10n-pa  (8 > 7)
  desktop/kde/l10n/kde-l10n-pl  (8 > 7)
  desktop/kde/l10n/kde-l10n-pt  (8 > 7)
  desktop/kde/l10n/kde-l10n-pt_BR  (8 > 7)
  desktop/kde/l10n/kde-l10n-ro  (8 > 7)
  desktop/kde/l10n/kde-l10n-ru  (8 > 7)
  desktop/kde/l10n/kde-l10n-sk  (8 > 7)
  desktop/kde/l10n/kde-l10n-sl  (8 > 7)
  desktop/kde/l10n/kde-l10n-sv  (8 > 7)
  desktop/kde/l10n/kde-l10n-tr  (8 > 7)
  desktop/kde/l10n/kde-l10n-ug  (8 > 7)
  desktop/kde/l10n/kde-l10n-uk  (8 > 7)
  desktop/kde/l10n/kde-l10n-wa  (8 > 7)
  desktop/kde/l10n/kde-l10n-zh_CN  (8 > 7)
  desktop/kde/l10n/kde-l10n-zh_TW  (8 > 7)
  desktop/toolkit/qt5/qt5-base  (7 > 6)
  desktop/toolkit/qt5/qt5-webkit  (7 > 6)
  desktop/toolkit/qtermwidget5  (5 > 4)
  editor/bluefish  (5 > 2)
  multimedia/nightingale  (2 > 1)
  multimedia/sound/timidity-shompatches  (3 > 1)
  programming/language/python/notify-python  (3 > 2)
  programming/misc/qrencode  (3 > 8)


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 get
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools

def setup():
    pisitools.dosed("avahi-daemon/avahi-daemon.conf", "^#(disallow-other-stacks=)no", "\\1yes")

    # fix avahi socket path
    pisitools.dosed('configure.ac', '^(avahi_runtime_dir=")\$\{localstatedir\}(\/run")', r'\1\2')

    autotools.autoreconf("-fi")
    # --with-systemdsystemunitdir=/lib/systemd/system
    autotools.configure("\
                         --with-distro=none \
                         --disable-monodoc \
                         --disable-static \
                         --disable-xmltoman \
                         --disable-qt3 \
                         --disable-qt4 \
                         --disable-doxygen-doc \
                         --enable-glib \
                         --enable-gobject \
                         --enable-introspection \
                         --disable-mono \
                         --disable-python \
                         --enable-gtk3 \
                         --enable-compat-howl \
                         --enable-compat-libdns_sd \
                         --with-avahi-user=avahi \
                         --with-avahi-group=avahi \
                         --with-autoipd-user=avahi-autoipd \
                         --with-autoipd-group=avahi-autoipd \
                         --with-avahi-priv-access-group=avahi \
                         --with-dbus-system-address=unix:path=/run/dbus/system_bus_socket \
                        ")

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

def build():
    autotools.make()

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

    # Add missing symlinks for avahi-compat-howl and avahi-compat-dns-sd
    pisitools.dosym("/usr/lib/pkgconfig/avahi-compat-howl.pc", "/usr/lib/pkgconfig/howl.pc")
    pisitools.dosym("/usr/lib/pkgconfig/avahi-compat-libdns_sd.pc", "/usr/lib/pkgconfig/libdns_sd.pc")
    pisitools.dosym("/usr/include/avahi-compat-libdns_sd/dns_sd.h", "/usr/include/dns_sd.h")

    # Remove example
    pisitools.remove("/etc/avahi/services/sftp-ssh.service")

    pisitools.dodir("/run/avahi-daemon")
    pisitools.dodir("/var/lib/avahi-autoipd")

    pisitools.dodoc("docs/AUTHORS", "docs/README", "docs/TODO")

    pisitools.removeDir("var/run")
    pisitools.removeDir("/usr/lib/avahi")


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

import os
import shutil

ownerships = {
        "/run/avahi-daemon"         : "avahi:avahi",
    }

def postInstall(fromVersion, fromRelease, toVersion, toRelease):
    for directory,owners in ownerships.items():
        if os.path.exists(directory):
            os.system("/bin/chown %s %s" % (owners, directory))

    if os.path.exists("/etc/localtime"):
        if not os.path.isdir("/etc/avahi/etc"):
            os.makedirs("/etc/avahi/etc")
        shutil.copy("/etc/localtime", "/etc/avahi/etc/localtime")


code:
from comar.service import *

serviceType="server"
serviceDesc = _({"en": "Avahi Server",
                 "tr": "Avahi Hizmeti"})

@synchronized
def start():
    startService(command="/usr/sbin/avahi-daemon",
                 args="-D",
                 donotify=True)

@synchronized
def stop():
    stopService(command="/usr/sbin/avahi-daemon",
                args="-k",
                donotify=True)

def reload():
    stopService(command="/usr/sbin/avahi-daemon",
                args="-r",
                donotify=True)

def status():
    return isServiceRunning("/run/avahi-daemon/pid")


code:
from comar.service import *
import signal

serviceType="server"
serviceDesc = _({"en": "Avahi DNS Configuration Daemon",
                 "tr": "Avahi DNS Yapılandırma Hizmeti"})

PIDFILE = "/run/avahi-dnsconfd.pid"
DAEMON = "/usr/sbin/avahi-dnsconfd"

@synchronized
def start():
    startDependencies("avahi")
    startService(command=DAEMON,
                 args="-D",
                 donotify=True)

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

@synchronized
def reload():
    stopService(command=DAEMON,
                signal=signal.SIGHUP)

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


code:
--- avahi-0.6.31/avahi-ui/Makefile.am.orig	2013-09-21 16:47:28.677659361 +0200
+++ avahi-0.6.31/avahi-ui/Makefile.am	2013-09-21 16:47:34.852520537 +0200
@@ -15,7 +15,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 # USA.

-AM_CFLAGS=-I$(top_srcdir) -DG_DISABLE_DEPRECATED=1 -DGDK_DISABLE_DEPRECATED=1 -DGTK_DISABLE_DEPRECATED=1
+AM_CFLAGS=-I$(top_srcdir)

 # This cool debug trap works on i386/gcc only
 AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
--- avahi-0.6.31/configure.ac.orig	2013-09-21 16:46:43.750669413 +0200
+++ avahi-0.6.31/configure.ac	2013-09-21 16:47:02.566246400 +0200
@@ -92,7 +92,7 @@
     AC_MSG_CHECKING([whether stack-smashing protection is available])
     ssp_old_cflags="$CFLAGS"
     ssp_old_ldflags="$LDFLAGS"
-    CFLAGS="$CFLAGS -Werror -fstack-protector-all -fPIC"
+    CFLAGS="$CFLAGS -fstack-protector-all -fPIC"
     LDFLAGS="$LDFLAGS -Wl,-z,defs"
     cat confdefs.h > conftest.c
     cat >>conftest.c <<_ACEOF


code: d /run/avahi-daemon 0755 avahi avahi


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>avahi</Name>
        <Homepage>http://avahi.org/</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>LGPLv2</License>
        <IsA>app:console</IsA>
        Local network service discovery
        <Description>avahi is a system which facilitates service discovery on a local network. This means that you can plug your laptop or computer into a network and instantly be able to view other people who you can chat with, find printers to print to or find files being shared.</Description>
        <Archive sha1sum="1c6d234058fd7883b3a4515e99216fdc8f71b223" type="targz">https://github.com/lathiat/avahi/releases/download/v0.6.32/avahi-0.6.32.tar.gz</Archive>
        <BuildDependencies>
            <Dependency>gtk2-devel</Dependency>
            <Dependency>gtk3-devel</Dependency>
            <Dependency>libcap-devel</Dependency>
            <Dependency>libdaemon-devel</Dependency>
            <Dependency>gobject-introspection-devel</Dependency>
            <Dependency>libepoxy-devel</Dependency>
            <Dependency>at-spi2-core-devel</Dependency>
            <Dependency>gdbm-devel</Dependency>
            <Dependency>intltool</Dependency>

        </BuildDependencies>
        <Patches>

        </Patches>
    </Source>

    <Package>
        <Name>avahi-glib</Name>
        Libraries for easy use of avahi from glib applications
        <RuntimeDependencies>
            <Dependency>glib2</Dependency>
            <Dependency release="current">avahi</Dependency>
            <Dependency release="current">avahi-libs</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="library">/usr/lib/libavahi-glib.*</Path>
            <Path fileType="library">/usr/lib/libavahi-gobject.*</Path>
        </Files>
    </Package>
    <Package>
        <Name>avahi-glib-devel</Name>
        Development files for avahi-glib
        <RuntimeDependencies>
            <Dependency release="current">avahi-glib</Dependency>
            <Dependency release="current">avahi-devel</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="header">/usr/include/avahi-glib</Path>
            <Path fileType="header">/usr/include/avahi-gobject</Path>
            <Path fileType="data">/usr/lib/pkgconfig/avahi-glib.pc</Path>
            <Path fileType="data">/usr/lib/pkgconfig/avahi-gobject.pc</Path>
        </Files>
    </Package>

    <Package>
        <Name>avahi-ui</Name>
        Gtk user interface library for Avahi
        <RuntimeDependencies>
            <Dependency>gdbm</Dependency>
            <Dependency>gtk2</Dependency>
            <Dependency>glib2</Dependency>
            <Dependency release="current">avahi-libs</Dependency>
            <Dependency release="current">avahi-glib</Dependency>
            <Dependency>atk</Dependency>
            <Dependency>cairo</Dependency>
            <Dependency>pango</Dependency>
            <Dependency>gdk-pixbuf</Dependency>
            <Dependency>fontconfig</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="library">/usr/lib/libavahi-ui.so*</Path>
        </Files>
    </Package>

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

    <Package>
        <Name>avahi-ui-gtk3</Name>
        Gtk3 user interface library for Avahi
        <RuntimeDependencies>
            <Dependency>gdbm</Dependency>
            <Dependency>glib2</Dependency>
            <Dependency>gtk3</Dependency>
            <Dependency release="current">avahi-libs</Dependency>
            <Dependency release="current">avahi-glib</Dependency>
            <Dependency>atk</Dependency>
            <Dependency>cairo</Dependency>
            <Dependency>pango</Dependency>
            <Dependency>gdk-pixbuf</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="library">/usr/lib/libavahi-ui-gtk3.so*</Path>
        </Files>
    </Package>

    <Package>
        <Name>avahi-ui-gtk3-devel</Name>
        Development files for avahi-ui-gtk3
        <RuntimeDependencies>
            <Dependency>gtk2-devel</Dependency>
            <Dependency release="current">avahi-ui-gtk3</Dependency>
            <Dependency release="current">avahi-devel</Dependency>
            <Dependency release="current">avahi-glib-devel</Dependency>
            <Dependency>gtk3-devel</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="data">/usr/lib/pkgconfig/avahi-ui-gtk3.pc</Path>
        </Files>
    </Package>

    <Package>
        <Name>avahi-ui-tools</Name>
        UI tools for mDNS browsing
        <RuntimeDependencies>
            <Dependency>gtk3</Dependency>
            <Dependency>glib2</Dependency>

            <Dependency release="current">avahi</Dependency>
            <Dependency release="current">avahi-ui</Dependency>
            <Dependency release="current">avahi-glib</Dependency>
            <Dependency release="current">avahi-ui-gtk3</Dependency>
            <Dependency release="current">avahi-libs</Dependency>
            <Dependency>gtk3</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="library">/usr/lib/python*/site-packages</Path>
            <Path fileType="executable">/usr/bin/b*</Path>
            <Path fileType="executable">/usr/bin/avahi-discover*</Path>
            <Path fileType="executable">/usr/bin/avahi-bookmarks</Path>
            <Path fileType="man">/usr/share/man/man1/b*</Path>
            <Path fileType="man">/usr/share/man/man1/avahi-discover*</Path>
            <Path fileType="man">/usr/share/man/man1/avahi-bookmarks*</Path>
            <Path fileType="data">/usr/share/avahi/interfaces</Path>
            <Path fileType="data">/usr/share/applications/b*</Path>
            <Path fileType="data">/usr/share/applications/avahi-discover.desktop</Path>
        </Files>
    </Package>

    <Package>
        <Name>avahi-compat-howl</Name>
        Libraries for howl compatibility
        <RuntimeDependencies>
            <Dependency release="current">avahi</Dependency>
            <Dependency release="current">avahi-libs</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="library">/usr/lib/libhowl.so*</Path>
        </Files>
    </Package>

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

    <Package>
        <Name>avahi-compat-libdns_sd</Name>
        Libraries for Apple Bonjour mDNSResponder compatibility
        <RuntimeDependencies>
            <Dependency release="current">avahi</Dependency>
            <Dependency release="current">avahi-libs</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="library">/usr/lib/libdns_sd.so*</Path>
        </Files>
    </Package>

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

    <Package>
        <Name>avahi-libs</Name>
        Libraries needed to run programs that use avahi
        <RuntimeDependencies>
            <Dependency>dbus</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="library">/usr/lib/libavahi-common.so*</Path>
            <Path fileType="library">/usr/lib/libavahi-client.so*</Path>
        </Files>
    </Package>

    <Package>
        <Name>avahi</Name>
        <RuntimeDependencies>
            <Dependency>dbus</Dependency>
            <Dependency>expat</Dependency>
            <Dependency>libcap</Dependency>
            <Dependency>libdaemon</Dependency>
            <Dependency release="current">avahi-libs</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="executable">/usr/sbin/avahi-daemon</Path>
            <Path fileType="library">/usr/lib/libavahi-core.so*</Path>
            <Path fileType="config">/etc/avahi/avahi-daemon.conf</Path>
            <Path fileType="config">/etc/avahi/hosts</Path>
            <Path fileType="data">/etc/avahi/services/ssh.service</Path>
            <Path fileType="data">/etc/dbus-1/system.d/avahi-dbus.conf</Path>
            <Path fileType="data">/usr/share/avahi</Path>
            <Path fileType="data">/usr/share/dbus-1/interfaces/*.xml</Path>
            <Path fileType="data">/usr/share/dbus-1/system-services</Path>
            <Path fileType="data">/usr/lib/avahi/service*</Path>
            <Path fileType="data">/lib/systemd/system</Path>
            <Path fileType="localedata">/usr/share/locale</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="man">/usr/share/man/man5/*</Path>
            <Path fileType="man">/usr/share/man/man8/avahi-daemon.*</Path>
            <Path fileType="data">/run/avahi-daemon</Path>
            <Path fileType="config">/usr/lib/tmpfiles.d/avahi.conf</Path>
        </Files>
        <AdditionalFiles>
            <AdditionalFile owner="root" permission="0644" target="/usr/lib/tmpfiles.d/avahi.conf">avahi.conf</AdditionalFile>
        </AdditionalFiles>
        <Provides>
            <COMAR script="avahi-daemon-service.py">System.Service</COMAR>
            <COMAR script="avahi-daemon-package.py">System.Package</COMAR>
        </Provides>
    </Package>

    <Package>
        <Name>avahi-autoipd</Name>
        Link-local IPv4 address automatic configuration daemon (IPv4LL)
        <RuntimeDependencies>
            <Dependency>libdaemon</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="data">/etc/avahi/avahi-autoipd.action</Path>
            <Path fileType="executable">/usr/sbin/avahi-autoipd</Path>
            <Path fileType="man">/usr/share/man/man8/avahi-autoipd.*</Path>
            <Path fileType="data">/var/lib/avahi-autoipd</Path>
        </Files>
    </Package>

    <Package>
        <Name>avahi-dnsconfd</Name>
        Configure local unicast DNS settings based on information published in mDNS
        <RuntimeDependencies>
            <Dependency>libdaemon</Dependency>
            <Dependency release="current">avahi</Dependency>
            <Dependency release="current">avahi-libs</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="data">/etc/avahi/avahi-dnsconfd.action</Path>
            <Path fileType="executable">/usr/sbin/avahi-dnsconfd</Path>
            <Path fileType="man">/usr/share/man/man8/avahi-dnsconfd.*</Path>
        </Files>
        <Provides>
            <COMAR script="avahi-dnsconfd-service.py" name="avahi_dnsconfd">System.Service</COMAR>
        </Provides>
    </Package>

    <Package>
        <Name>avahi-tools</Name>
        Command line tools for mDNS browsing and publishing
        <RuntimeDependencies>
            <Dependency>gdbm</Dependency>
            <Dependency release="current">avahi</Dependency>
            <Dependency release="current">avahi-libs</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="man">/usr/share/man/man1</Path>
        </Files>
    </Package>

    <Package>
        <Name>avahi-devel</Name>
        Development files for avahi
        <RuntimeDependencies>
            <Dependency release="current">avahi-libs</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="data">/usr/lib/pkgconfig/avahi-core.pc</Path>
            <Path fileType="data">/usr/lib/pkgconfig/avahi-client.pc</Path>
            <Path fileType="data">/usr/lib/girepository-1.0</Path>
            <Path fileType="data">/usr/share/gir-1.0</Path>
            <Path fileType="header">/usr/include/avahi-client</Path>
            <Path fileType="header">/usr/include/avahi-common</Path>
            <Path fileType="header">/usr/include/avahi-core</Path>
        </Files>
    </Package>

    <History>
        <Update release="3">
            <Date>2017-02-17</Date>
            <Version>0.6.32</Version>
            <Comment>Version Bump.</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>0.6.31</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2014-05-20</Date>
            <Version>0.6.31</Version>
            <Comment>First release</Comment>
            <Name>Yusuf Aydemir</Name>
            <Email>yusuf.aydemir@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>avahi</Name>
        Yerel ağ hizmeti bulma sistemi
        <Description xml:lang="tr">avahi yerel ağ üzerindeki hizmetleri tespit etmeyi kolaylaştıran bir sistemdir. Bu sayede, bilgisayarınızı ağa dahil ettikten sonra anında mevcut bilgisayarları ve yazıcıları görebilir ve kullanabilirsiniz.</Description>
    </Source>

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

    <Package>
        <Name>avahi-glib</Name>
        Glib uygulamalarında avahi kullanımını kolaylaştıran kitaplıklar
    </Package>

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

    <Package>
        <Name>avahi-sharp</Name>
        Mono uygulamalarında avahi kullanımını kolaylaştıran kitaplıklar
    </Package>

    <Package>
        <Name>avahi-ui-sharp</Name>
        avahi-ui için Mono dil bağlayıcıları
    </Package>

    <Package>
        <Name>avahi-ui-sharp-devel</Name>
        avahi-ui-sharp için geliştirme dosyaları
    </Package>

    <Package>
        <Name>avahi-ui</Name>
        avahi için geliştirme dosyaları
    </Package>

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

    <Package>
        <Name>avahi-ui-gtk3</Name>
        avahi-gtk3, Gtk3 user interface library for Avahi
    </Package>

    <Package>
        <Name>avahi-ui-gtk3-devel</Name>
        avahi-ui-gtk3 için geliştirme dosyaları
    </Package>

    <Package>
        <Name>avahi-ui-tools</Name>
        Grafiksel mDNS tarama araçları
    </Package>

    <Package>
        <Name>avahi-compat-howl</Name>
        howl uyumluluk kitaplıkları
    </Package>

    <Package>
        <Name>avahi-compat-howl-devel</Name>
        avahi-compat-howl için geliştirme dosyaları
    </Package>

    <Package>
        <Name>avahi-compat-libdns_sd</Name>
        libdns_sd uyumluluk kitaplıkları
    </Package>

    <Package>
        <Name>avahi-compat-libdns_sd-devel</Name>
        avahi-compat-libdns_sd için geliştirme dosyaları
    </Package>

    <Package>
        <Name>avahi-libs</Name>
        Avahi kullanan uygulamaları çalıştırmak için gerekli kitaplıklar
    </Package>

    <Package>
        <Name>avahi-autoipd</Name>
        Link-local IPv4 adresi otomatik yapılandırma hizmeti (IPv4LL)
    </Package>

    <Package>
        <Name>avahi-dnsconfd</Name>
        Yerel unicast DNS ayarlarını mDNS üzerinden gelen bilgilere göre yapılandırma hizmeti
    </Package>

    <Package>
        <Name>avahi-tools</Name>
        mDNS taramak ve yayınlamak için komut satırı araçları
    </Package>
</PISI>


code:
<PISI>
    <Name>network.analyzer</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 autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import get

def setup():
    autotools.configure()

def build():
    autotools.make()

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

    pisitools.dodoc("AUTHORS", "ChangeLog", "README*", "NEWS", "TODO")


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>gnu-netcat</Name>
        <Homepage>http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/nc/</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>GPLv2</License>
        <IsA>app:console</IsA>
        <Summary>A tool designed to read and write data across connections using TCP/IP</Summary>
        <Description>A simple Unix utility which reads and writes data across network connections using TCP or UDP protocol. It is designed to be a reliable "back-end" tool that can be used directly or easily driven by other programs and scripts.</Description>
        <Archive sha1sum="b761d70fe9e3e8b3fe33a329b9bc31300dc04d11" type="tarbz2">mirrors://sourceforge/netcat/netcat-0.7.1.tar.bz2</Archive>
    </Source>

    <Package>
        <Name>gnu-netcat</Name>
        <Files>
            <Path fileType="executable">/usr/bin</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="info">/usr/share/info</Path>
            <Path fileType="localedata">/usr/share/locale</Path>
            <Path fileType="man">/usr/share/man/man1</Path>
        </Files>
    </Package>

    <History>
        <Update release="2">
            <Date>2017-05-15</Date>
            <Version>0.7.1</Version>
            <Comment>Release bump</Comment>
            <Name>Kamil Atlı</Name>
            <Email>suvari@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2016-07-02</Date>
            <Version>0.7.1</Version>
            <Comment>First release</Comment>
            <Name>Pisi Linux Admins</Name>
            <Email>admins@pisilinux.org</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>netcat</Name>
        <Summary xml:lang="tr">TCP/IP protokolünü kullanan, ağ bağlantıları üzerinden veri okuma ve yazmaya yarayan bir yardımcı uygulama</Summary>
        <Description xml:lang="tr">Ağ bağlantıları arasında TCP ve UDP kullanarak veri okuyup yazabilen basit bir Unix aracıdır.</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 shelltools
from pisi.actionsapi import get

def setup():
    shelltools.export("CFLAGS", "%s -fPIC" % get.CFLAGS())
    autotools.autoreconf("-vfi")
    autotools.configure("--prefix=/usr \
                         --enable-ipv6 \
                         --enable-bluetooth")

def build():
    autotools.make("all")
    autotools.make("shared")

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

    # No static libs
    pisitools.remove("/usr/lib/*.a")

    # it is needed for ppd etc.
    pisitools.insinto("/usr/include", "pcap-int.h")

    pisitools.dodoc("CHANGES", "CREDITS", "README*", "VERSION", "TODO")


code:
Disable bits of remote capture support inherited from the WinPCAP merge
which cause applications to FTBFS if they define HAVE_REMOTE (#843384).

--- a/pcap/pcap.h
+++ b/pcap/pcap.h
@@ -506,6 +506,11 @@
   #define MODE_STAT 1
   #define MODE_MON 2

+#ifdef HAVE_REMOTE
+  /* Includes most of the public stuff that is needed for the remote capture */
+  #include <remote-ext.h>
+#endif	 /* HAVE_REMOTE */
+
 #elif defined(MSDOS)

   /*
@@ -526,11 +531,6 @@

 #endif /* _WIN32/MSDOS/UN*X */

-#ifdef HAVE_REMOTE
-  /* Includes most of the public stuff that is needed for the remote capture */
-  #include <remote-ext.h>
-#endif	 /* HAVE_REMOTE */
-
 #ifdef __cplusplus
 }
 #endif


code:
Submitted By:            Fernando de Oliveira <famobr at yahoo dot com dot br>
Date:                    2014-09-07
Initial Package Version: 1.6.2 (problem started with 1.6.1)
Upstream Status:         Unknown
Origin:                  ArchLinux
URL:                     https://projects.archlinux.org/svntogit/packages.git/plain/trunk/mgmt.h?h=packages/libpcap
Description:             Fix build with bluez-5.21

diff -Naur libpcap-1.6.2.orig/bluetooth/mgmt.h libpcap-1.6.2/bluetooth/mgmt.h
--- libpcap-1.6.2.orig/bluetooth/mgmt.h	1969-12-31 21:00:00.000000000 -0300
+++ libpcap-1.6.2/bluetooth/mgmt.h	2014-09-07 14:11:36.456414731 -0300
@@ -0,0 +1,772 @@
+/*
+ *  BlueZ - Bluetooth protocol stack for Linux
+ *
+ *  Copyright (C) 2010  Nokia Corporation
+ *  Copyright (C) 2010  Marcel Holtmann <marcel@holtmann.org>
+ *
+ *
+ *  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.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ *
+ */
+
+#ifndef __packed
+#define __packed __attribute__((packed))
+#endif
+
+#define MGMT_INDEX_NONE			0xFFFF
+
+#define MGMT_STATUS_SUCCESS		0x00
+#define MGMT_STATUS_UNKNOWN_COMMAND	0x01
+#define MGMT_STATUS_NOT_CONNECTED	0x02
+#define MGMT_STATUS_FAILED		0x03
+#define MGMT_STATUS_CONNECT_FAILED	0x04
+#define MGMT_STATUS_AUTH_FAILED		0x05
+#define MGMT_STATUS_NOT_PAIRED		0x06
+#define MGMT_STATUS_NO_RESOURCES	0x07
+#define MGMT_STATUS_TIMEOUT		0x08
+#define MGMT_STATUS_ALREADY_CONNECTED	0x09
+#define MGMT_STATUS_BUSY		0x0a
+#define MGMT_STATUS_REJECTED		0x0b
+#define MGMT_STATUS_NOT_SUPPORTED	0x0c
+#define MGMT_STATUS_INVALID_PARAMS	0x0d
+#define MGMT_STATUS_DISCONNECTED	0x0e
+#define MGMT_STATUS_NOT_POWERED		0x0f
+#define MGMT_STATUS_CANCELLED		0x10
+#define MGMT_STATUS_INVALID_INDEX	0x11
+#define MGMT_STATUS_RFKILLED		0x12
+
+struct mgmt_hdr {
+	uint16_t opcode;
+	uint16_t index;
+	uint16_t len;
+} __packed;
+#define MGMT_HDR_SIZE	6
+
+struct mgmt_addr_info {
+	bdaddr_t bdaddr;
+	uint8_t type;
+} __packed;
+
+#define MGMT_OP_READ_VERSION		0x0001
+struct mgmt_rp_read_version {
+	uint8_t version;
+	uint16_t revision;
+} __packed;
+
+#define MGMT_OP_READ_COMMANDS		0x0002
+struct mgmt_rp_read_commands {
+	uint16_t num_commands;
+	uint16_t num_events;
+	uint16_t opcodes[0];
+} __packed;
+
+#define MGMT_OP_READ_INDEX_LIST		0x0003
+struct mgmt_rp_read_index_list {
+	uint16_t num_controllers;
+	uint16_t index[0];
+} __packed;
+
+/* Reserve one extra byte for names in management messages so that they
+ * are always guaranteed to be nul-terminated */
+#define MGMT_MAX_NAME_LENGTH		(248 + 1)
+#define MGMT_MAX_SHORT_NAME_LENGTH	(10 + 1)
+
+#define MGMT_SETTING_POWERED		0x00000001
+#define MGMT_SETTING_CONNECTABLE	0x00000002
+#define MGMT_SETTING_FAST_CONNECTABLE	0x00000004
+#define MGMT_SETTING_DISCOVERABLE	0x00000008
+#define MGMT_SETTING_BONDABLE		0x00000010
+#define MGMT_SETTING_LINK_SECURITY	0x00000020
+#define MGMT_SETTING_SSP		0x00000040
+#define MGMT_SETTING_BREDR		0x00000080
+#define MGMT_SETTING_HS			0x00000100
+#define MGMT_SETTING_LE			0x00000200
+#define MGMT_SETTING_ADVERTISING	0x00000400
+#define MGMT_SETTING_SECURE_CONN	0x00000800
+#define MGMT_SETTING_DEBUG_KEYS		0x00001000
+#define MGMT_SETTING_PRIVACY		0x00002000
+#define MGMT_SETTING_CONFIGURATION	0x00004000
+
+#define MGMT_OP_READ_INFO		0x0004
+struct mgmt_rp_read_info {
+	bdaddr_t bdaddr;
+	uint8_t version;
+	uint16_t manufacturer;
+	uint32_t supported_settings;
+	uint32_t current_settings;
+	uint8_t dev_class[3];
+	uint8_t name[MGMT_MAX_NAME_LENGTH];
+	uint8_t short_name[MGMT_MAX_SHORT_NAME_LENGTH];
+} __packed;
+
+struct mgmt_mode {
+	uint8_t val;
+} __packed;
+
+struct mgmt_cod {
+	uint8_t val[3];
+} __packed;
+
+#define MGMT_OP_SET_POWERED		0x0005
+
+#define MGMT_OP_SET_DISCOVERABLE	0x0006
+struct mgmt_cp_set_discoverable {
+	uint8_t val;
+	uint16_t timeout;
+} __packed;
+
+#define MGMT_OP_SET_CONNECTABLE		0x0007
+
+#define MGMT_OP_SET_FAST_CONNECTABLE	0x0008
+
+#define MGMT_OP_SET_BONDABLE		0x0009
+
+#define MGMT_OP_SET_LINK_SECURITY	0x000A
+
+#define MGMT_OP_SET_SSP			0x000B
+
+#define MGMT_OP_SET_HS			0x000C
+
+#define MGMT_OP_SET_LE			0x000D
+
+#define MGMT_OP_SET_DEV_CLASS		0x000E
+struct mgmt_cp_set_dev_class {
+	uint8_t major;
+	uint8_t minor;
+} __packed;
+
+#define MGMT_OP_SET_LOCAL_NAME		0x000F
+struct mgmt_cp_set_local_name {
+	uint8_t name[MGMT_MAX_NAME_LENGTH];
+	uint8_t short_name[MGMT_MAX_SHORT_NAME_LENGTH];
+} __packed;
+
+#define MGMT_OP_ADD_UUID		0x0010
+struct mgmt_cp_add_uuid {
+	uint8_t uuid[16];
+	uint8_t svc_hint;
+} __packed;
+
+#define MGMT_OP_REMOVE_UUID		0x0011
+struct mgmt_cp_remove_uuid {
+	uint8_t uuid[16];
+} __packed;
+
+struct mgmt_link_key_info {
+	struct mgmt_addr_info addr;
+	uint8_t type;
+	uint8_t val[16];
+	uint8_t pin_len;
+} __packed;
+
+#define MGMT_OP_LOAD_LINK_KEYS		0x0012
+struct mgmt_cp_load_link_keys {
+	uint8_t debug_keys;
+	uint16_t key_count;
+	struct mgmt_link_key_info keys[0];
+} __packed;
+
+struct mgmt_ltk_info {
+	struct mgmt_addr_info addr;
+	uint8_t type;
+	uint8_t master;
+	uint8_t enc_size;
+	uint16_t ediv;
+	uint64_t rand;
+	uint8_t val[16];
+} __packed;
+
+#define MGMT_OP_LOAD_LONG_TERM_KEYS	0x0013
+struct mgmt_cp_load_long_term_keys {
+	uint16_t key_count;
+	struct mgmt_ltk_info keys[0];
+} __packed;
+
+#define MGMT_OP_DISCONNECT		0x0014
+struct mgmt_cp_disconnect {
+	struct mgmt_addr_info addr;
+} __packed;
+struct mgmt_rp_disconnect {
+	struct mgmt_addr_info addr;
+} __packed;
+
+#define MGMT_OP_GET_CONNECTIONS		0x0015
+struct mgmt_rp_get_connections {
+	uint16_t conn_count;
+	struct mgmt_addr_info addr[0];
+} __packed;
+
+#define MGMT_OP_PIN_CODE_REPLY		0x0016
+struct mgmt_cp_pin_code_reply {
+	struct mgmt_addr_info addr;
+	uint8_t pin_len;
+	uint8_t pin_code[16];
+} __packed;
+
+#define MGMT_OP_PIN_CODE_NEG_REPLY	0x0017
+struct mgmt_cp_pin_code_neg_reply {
+	struct mgmt_addr_info addr;
+} __packed;
+
+#define MGMT_OP_SET_IO_CAPABILITY	0x0018
+struct mgmt_cp_set_io_capability {
+	uint8_t io_capability;
+} __packed;
+
+#define MGMT_OP_PAIR_DEVICE		0x0019
+struct mgmt_cp_pair_device {
+	struct mgmt_addr_info addr;
+	uint8_t io_cap;
+} __packed;
+struct mgmt_rp_pair_device {
+	struct mgmt_addr_info addr;
+} __packed;
+
+#define MGMT_OP_CANCEL_PAIR_DEVICE	0x001A
+
+#define MGMT_OP_UNPAIR_DEVICE		0x001B
+struct mgmt_cp_unpair_device {
+	struct mgmt_addr_info addr;
+	uint8_t disconnect;
+} __packed;
+struct mgmt_rp_unpair_device {
+	struct mgmt_addr_info addr;
+} __packed;
+
+#define MGMT_OP_USER_CONFIRM_REPLY	0x001C
+struct mgmt_cp_user_confirm_reply {
+	struct mgmt_addr_info addr;
+} __packed;
+struct mgmt_rp_user_confirm_reply {
+	struct mgmt_addr_info addr;
+} __packed;
+
+#define MGMT_OP_USER_CONFIRM_NEG_REPLY	0x001D
+
+#define MGMT_OP_USER_PASSKEY_REPLY	0x001E
+struct mgmt_cp_user_passkey_reply {
+	struct mgmt_addr_info addr;
+	uint32_t passkey;
+} __packed;
+struct mgmt_rp_user_passkey_reply {
+	struct mgmt_addr_info addr;
+} __packed;
+
+#define MGMT_OP_USER_PASSKEY_NEG_REPLY	0x001F
+struct mgmt_cp_user_passkey_neg_reply {
+	struct mgmt_addr_info addr;
+} __packed;
+
+#define MGMT_OP_READ_LOCAL_OOB_DATA	0x0020
+struct mgmt_rp_read_local_oob_data {
+	uint8_t hash[16];
+	uint8_t randomizer[16];
+} __packed;
+struct mgmt_rp_read_local_oob_ext_data {
+	uint8_t hash192[16];
+	uint8_t randomizer192[16];
+	uint8_t hash256[16];
+	uint8_t randomizer256[16];
+} __packed;
+
+#define MGMT_OP_ADD_REMOTE_OOB_DATA	0x0021
+struct mgmt_cp_add_remote_oob_data {
+	struct mgmt_addr_info addr;
+	uint8_t hash[16];
+	uint8_t randomizer[16];
+} __packed;
+
+#define MGMT_OP_REMOVE_REMOTE_OOB_DATA	0x0022
+struct mgmt_cp_remove_remote_oob_data {
+	struct mgmt_addr_info addr;
+} __packed;
+
+#define MGMT_OP_START_DISCOVERY		0x0023
+struct mgmt_cp_start_discovery {
+	uint8_t type;
+} __packed;
+
+#define MGMT_OP_STOP_DISCOVERY		0x0024
+struct mgmt_cp_stop_discovery {
+	uint8_t type;
+} __packed;
+
+#define MGMT_OP_CONFIRM_NAME		0x0025
+struct mgmt_cp_confirm_name {
+	struct mgmt_addr_info addr;
+	uint8_t name_known;
+} __packed;
+struct mgmt_rp_confirm_name {
+	struct mgmt_addr_info addr;
+} __packed;
+
+#define MGMT_OP_BLOCK_DEVICE		0x0026
+struct mgmt_cp_block_device {
+	struct mgmt_addr_info addr;
+} __packed;
+
+#define MGMT_OP_UNBLOCK_DEVICE		0x0027
+struct mgmt_cp_unblock_device {
+	struct mgmt_addr_info addr;
+} __packed;
+
+#define MGMT_OP_SET_DEVICE_ID		0x0028
+struct mgmt_cp_set_device_id {
+	uint16_t source;
+	uint16_t vendor;
+	uint16_t product;
+	uint16_t version;
+} __packed;
+
+#define MGMT_OP_SET_ADVERTISING		0x0029
+
+#define MGMT_OP_SET_BREDR		0x002A
+
+#define MGMT_OP_SET_STATIC_ADDRESS	0x002B
+struct mgmt_cp_set_static_address {
+	bdaddr_t bdaddr;
+} __packed;
+
+#define MGMT_OP_SET_SCAN_PARAMS		0x002C
+struct mgmt_cp_set_scan_params {
+	uint16_t interval;
+	uint16_t window;
+} __packed;
+
+#define MGMT_OP_SET_SECURE_CONN		0x002D
+
+#define MGMT_OP_SET_DEBUG_KEYS		0x002E
+
+struct mgmt_irk_info {
+	struct mgmt_addr_info addr;
+	uint8_t val[16];
+} __packed;
+
+#define MGMT_OP_SET_PRIVACY		0x002F
+struct mgmt_cp_set_privacy {
+	uint8_t privacy;
+	uint8_t irk[16];
+} __packed;
+
+#define MGMT_OP_LOAD_IRKS		0x0030
+struct mgmt_cp_load_irks {
+	uint16_t irk_count;
+	struct mgmt_irk_info irks[0];
+} __packed;
+
+#define MGMT_OP_GET_CONN_INFO		0x0031
+struct mgmt_cp_get_conn_info {
+	struct mgmt_addr_info addr;
+} __packed;
+struct mgmt_rp_get_conn_info {
+	struct mgmt_addr_info addr;
+	int8_t rssi;
+	int8_t tx_power;
+	int8_t max_tx_power;
+} __packed;
+
+#define MGMT_OP_GET_CLOCK_INFO		0x0032
+struct mgmt_cp_get_clock_info {
+	struct mgmt_addr_info addr;
+} __packed;
+struct mgmt_rp_get_clock_info {
+	struct mgmt_addr_info addr;
+	uint32_t  local_clock;
+	uint32_t  piconet_clock;
+	uint16_t  accuracy;
+} __packed;
+
+#define MGMT_OP_ADD_DEVICE		0x0033
+struct mgmt_cp_add_device {
+	struct mgmt_addr_info addr;
+	uint8_t action;
+} __packed;
+struct mgmt_rp_add_device {
+	struct mgmt_addr_info addr;
+} __packed;
+
+#define MGMT_OP_REMOVE_DEVICE		0x0034
+struct mgmt_cp_remove_device {
+	struct mgmt_addr_info addr;
+} __packed;
+struct mgmt_rp_remove_device {
+	struct mgmt_addr_info addr;
+} __packed;
+
+struct mgmt_conn_param {
+	struct mgmt_addr_info addr;
+	uint16_t min_interval;
+	uint16_t max_interval;
+	uint16_t latency;
+	uint16_t timeout;
+} __packed;
+
+#define MGMT_OP_LOAD_CONN_PARAM		0x0035
+struct mgmt_cp_load_conn_param {
+	uint16_t param_count;
+	struct mgmt_conn_param params[0];
+} __packed;
+
+#define MGMT_OP_READ_UNCONF_INDEX_LIST	0x0036
+struct mgmt_rp_read_unconf_index_list {
+	uint16_t num_controllers;
+	uint16_t index[0];
+} __packed;
+
+#define MGMT_OPTION_EXTERNAL_CONFIG	0x00000001
+#define MGMT_OPTION_PUBLIC_ADDRESS	0x00000002
+
+#define MGMT_OP_READ_CONFIG_INFO	0x0037
+struct mgmt_rp_read_config_info {
+	uint16_t manufacturer;
+	uint32_t supported_options;
+	uint32_t missing_options;
+} __packed;
+
+#define MGMT_OP_SET_EXTERNAL_CONFIG	0x0038
+struct mgmt_cp_set_external_config {
+	uint8_t config;
+} __packed;
+
+#define MGMT_OP_SET_PUBLIC_ADDRESS	0x0039
+struct mgmt_cp_set_public_address {
+	bdaddr_t bdaddr;
+} __packed;
+
+#define MGMT_EV_CMD_COMPLETE		0x0001
+struct mgmt_ev_cmd_complete {
+	uint16_t opcode;
+	uint8_t status;
+	uint8_t data[0];
+} __packed;
+
+#define MGMT_EV_CMD_STATUS		0x0002
+struct mgmt_ev_cmd_status {
+	uint16_t opcode;
+	uint8_t status;
+} __packed;
+
+#define MGMT_EV_CONTROLLER_ERROR	0x0003
+struct mgmt_ev_controller_error {
+	uint8_t error_code;
+} __packed;
+
+#define MGMT_EV_INDEX_ADDED		0x0004
+
+#define MGMT_EV_INDEX_REMOVED		0x0005
+
+#define MGMT_EV_NEW_SETTINGS		0x0006
+
+#define MGMT_EV_CLASS_OF_DEV_CHANGED	0x0007
+struct mgmt_ev_class_of_dev_changed {
+	uint8_t class_of_dev[3];
+} __packed;
+
+#define MGMT_EV_LOCAL_NAME_CHANGED	0x0008
+struct mgmt_ev_local_name_changed {
+	uint8_t name[MGMT_MAX_NAME_LENGTH];
+	uint8_t short_name[MGMT_MAX_SHORT_NAME_LENGTH];
+} __packed;
+
+#define MGMT_EV_NEW_LINK_KEY		0x0009
+struct mgmt_ev_new_link_key {
+	uint8_t store_hint;
+	struct mgmt_link_key_info key;
+} __packed;
+
+#define MGMT_EV_NEW_LONG_TERM_KEY	0x000A
+struct mgmt_ev_new_long_term_key {
+	uint8_t store_hint;
+	struct mgmt_ltk_info key;
+} __packed;
+
+#define MGMT_EV_DEVICE_CONNECTED	0x000B
+struct mgmt_ev_device_connected {
+	struct mgmt_addr_info addr;
+	uint32_t flags;
+	uint16_t eir_len;
+	uint8_t eir[0];
+} __packed;
+
+#define MGMT_DEV_DISCONN_UNKNOWN	0x00
+#define MGMT_DEV_DISCONN_TIMEOUT	0x01
+#define MGMT_DEV_DISCONN_LOCAL_HOST	0x02
+#define MGMT_DEV_DISCONN_REMOTE		0x03
+
+#define MGMT_EV_DEVICE_DISCONNECTED	0x000C
+struct mgmt_ev_device_disconnected {
+	struct mgmt_addr_info addr;
+	uint8_t reason;
+} __packed;
+
+#define MGMT_EV_CONNECT_FAILED		0x000D
+struct mgmt_ev_connect_failed {
+	struct mgmt_addr_info addr;
+	uint8_t status;
+} __packed;
+
+#define MGMT_EV_PIN_CODE_REQUEST	0x000E
+struct mgmt_ev_pin_code_request {
+	struct mgmt_addr_info addr;
+	uint8_t secure;
+} __packed;
+
+#define MGMT_EV_USER_CONFIRM_REQUEST	0x000F
+struct mgmt_ev_user_confirm_request {
+	struct mgmt_addr_info addr;
+	uint8_t confirm_hint;
+	uint32_t value;
+} __packed;
+
+#define MGMT_EV_USER_PASSKEY_REQUEST	0x0010
+struct mgmt_ev_user_passkey_request {
+	struct mgmt_addr_info addr;
+} __packed;
+
+#define MGMT_EV_AUTH_FAILED		0x0011
+struct mgmt_ev_auth_failed {
+	struct mgmt_addr_info addr;
+	uint8_t status;
+} __packed;
+
+#define MGMT_DEV_FOUND_CONFIRM_NAME	0x01
+#define MGMT_DEV_FOUND_LEGACY_PAIRING	0x02
+#define MGMT_DEV_FOUND_NOT_CONNECTABLE	0x04
+
+#define MGMT_EV_DEVICE_FOUND		0x0012
+struct mgmt_ev_device_found {
+	struct mgmt_addr_info addr;
+	int8_t rssi;
+	uint32_t flags;
+	uint16_t eir_len;
+	uint8_t eir[0];
+} __packed;
+
+#define MGMT_EV_DISCOVERING		0x0013
+struct mgmt_ev_discovering {
+	uint8_t type;
+	uint8_t discovering;
+} __packed;
+
+#define MGMT_EV_DEVICE_BLOCKED		0x0014
+struct mgmt_ev_device_blocked {
+	struct mgmt_addr_info addr;
+} __packed;
+
+#define MGMT_EV_DEVICE_UNBLOCKED	0x0015
+struct mgmt_ev_device_unblocked {
+	struct mgmt_addr_info addr;
+} __packed;
+
+#define MGMT_EV_DEVICE_UNPAIRED		0x0016
+struct mgmt_ev_device_unpaired {
+	struct mgmt_addr_info addr;
+} __packed;
+
+#define MGMT_EV_PASSKEY_NOTIFY		0x0017
+struct mgmt_ev_passkey_notify {
+	struct mgmt_addr_info addr;
+	uint32_t passkey;
+	uint8_t entered;
+} __packed;
+
+#define MGMT_EV_NEW_IRK			0x0018
+struct mgmt_ev_new_irk {
+	uint8_t  store_hint;
+	bdaddr_t rpa;
+	struct mgmt_irk_info key;
+} __packed;
+
+struct mgmt_csrk_info {
+	struct mgmt_addr_info addr;
+	uint8_t master;
+	uint8_t val[16];
+} __packed;
+
+#define MGMT_EV_NEW_CSRK		0x0019
+struct mgmt_ev_new_csrk {
+	uint8_t store_hint;
+	struct mgmt_csrk_info key;
+} __packed;
+
+#define MGMT_EV_DEVICE_ADDED		0x001a
+struct mgmt_ev_device_added {
+	struct mgmt_addr_info addr;
+	uint8_t action;
+} __packed;
+
+#define MGMT_EV_DEVICE_REMOVED		0x001b
+struct mgmt_ev_device_removed {
+	struct mgmt_addr_info addr;
+} __packed;
+
+#define MGMT_EV_NEW_CONN_PARAM		0x001c
+struct mgmt_ev_new_conn_param {
+	struct mgmt_addr_info addr;
+	uint8_t store_hint;
+	uint16_t min_interval;
+	uint16_t max_interval;
+	uint16_t latency;
+	uint16_t timeout;
+} __packed;
+
+#define MGMT_EV_UNCONF_INDEX_ADDED	0x001d
+
+#define MGMT_EV_UNCONF_INDEX_REMOVED	0x001e
+
+#define MGMT_EV_NEW_CONFIG_OPTIONS	0x001f
+
+static const char *mgmt_op[] = {
+	"<0x0000>",
+	"Read Version",
+	"Read Commands",
+	"Read Index List",
+	"Read Controller Info",
+	"Set Powered",
+	"Set Discoverable",
+	"Set Connectable",
+	"Set Fast Connectable",		/* 0x0008 */
+	"Set Bondable",
+	"Set Link Security",
+	"Set Secure Simple Pairing",
+	"Set High Speed",
+	"Set Low Energy",
+	"Set Dev Class",
+	"Set Local Name",
+	"Add UUID",			/* 0x0010 */
+	"Remove UUID",
+	"Load Link Keys",
+	"Load Long Term Keys",
+	"Disconnect",
+	"Get Connections",
+	"PIN Code Reply",
+	"PIN Code Neg Reply",
+	"Set IO Capability",		/* 0x0018 */
+	"Pair Device",
+	"Cancel Pair Device",
+	"Unpair Device",
+	"User Confirm Reply",
+	"User Confirm Neg Reply",
+	"User Passkey Reply",
+	"User Passkey Neg Reply",
+	"Read Local OOB Data",		/* 0x0020 */
+	"Add Remote OOB Data",
+	"Remove Remove OOB Data",
+	"Start Discovery",
+	"Stop Discovery",
+	"Confirm Name",
+	"Block Device",
+	"Unblock Device",
+	"Set Device ID",
+	"Set Advertising",
+	"Set BR/EDR",
+	"Set Static Address",
+	"Set Scan Parameters",
+	"Set Secure Connections",
+	"Set Debug Keys",
+	"Set Privacy",
+	"Load Identity Resolving Keys",
+	"Get Connection Information",
+	"Get Clock Information",
+	"Add Device",
+	"Remove Device",
+	"Load Connection Parameters",
+	"Read Unconfigured Index List",
+	"Read Controller Configuration Information",
+	"Set External Configuration",
+	"Set Public Address",
+};
+
+static const char *mgmt_ev[] = {
+	"<0x0000>",
+	"Command Complete",
+	"Command Status",
+	"Controller Error",
+	"Index Added",
+	"Index Removed",
+	"New Settings",
+	"Class of Device Changed",
+	"Local Name Changed",		/* 0x0008 */
+	"New Link Key",
+	"New Long Term Key",
+	"Device Connected",
+	"Device Disconnected",
+	"Connect Failed",
+	"PIN Code Request",
+	"User Confirm Request",
+	"User Passkey Request",		/* 0x0010 */
+	"Authentication Failed",
+	"Device Found",
+	"Discovering",
+	"Device Blocked",
+	"Device Unblocked",
+	"Device Unpaired",
+	"Passkey Notify",
+	"New Identity Resolving Key",
+	"New Signature Resolving Key",
+	"Device Added",
+	"Device Removed",
+	"New Connection Parameter",
+	"Unconfigured Index Added",
+	"Unconfigured Index Removed",
+	"New Configuration Options",
+};
+
+static const char *mgmt_status[] = {
+	"Success",
+	"Unknown Command",
+	"Not Connected",
+	"Failed",
+	"Connect Failed",
+	"Authentication Failed",
+	"Not Paired",
+	"No Resources",
+	"Timeout",
+	"Already Connected",
+	"Busy",
+	"Rejected",
+	"Not Supported",
+	"Invalid Parameters",
+	"Disconnected",
+	"Not Powered",
+	"Cancelled",
+	"Invalid Index",
+	"Blocked through rfkill",
+};
+
+#ifndef NELEM
+#define NELEM(x) (sizeof(x) / sizeof((x)[0]))
+#endif
+
+static inline const char *mgmt_opstr(uint16_t op)
+{
+	if (op >= NELEM(mgmt_op))
+		return "<unknown opcode>";
+	return mgmt_op[op];
+}
+
+static inline const char *mgmt_evstr(uint16_t ev)
+{
+	if (ev >= NELEM(mgmt_ev))
+		return "<unknown event>";
+	return mgmt_ev[ev];
+}
+
+static inline const char *mgmt_errstr(uint8_t status)
+{
+	if (status >= NELEM(mgmt_status))
+		return "<unknown status>";
+	return mgmt_status[status];
+}


code:
/*
 *  BlueZ - Bluetooth protocol stack for Linux
 *
 *  Copyright (C) 2010  Nokia Corporation
 *  Copyright (C) 2010  Marcel Holtmann <marcel@holtmann.org>
 *
 *
 *  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.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

#ifndef __packed
#define __packed __attribute__((packed))
#endif

#define MGMT_INDEX_NONE			0xFFFF

#define MGMT_STATUS_SUCCESS		0x00
#define MGMT_STATUS_UNKNOWN_COMMAND	0x01
#define MGMT_STATUS_NOT_CONNECTED	0x02
#define MGMT_STATUS_FAILED		0x03
#define MGMT_STATUS_CONNECT_FAILED	0x04
#define MGMT_STATUS_AUTH_FAILED		0x05
#define MGMT_STATUS_NOT_PAIRED		0x06
#define MGMT_STATUS_NO_RESOURCES	0x07
#define MGMT_STATUS_TIMEOUT		0x08
#define MGMT_STATUS_ALREADY_CONNECTED	0x09
#define MGMT_STATUS_BUSY		0x0a
#define MGMT_STATUS_REJECTED		0x0b
#define MGMT_STATUS_NOT_SUPPORTED	0x0c
#define MGMT_STATUS_INVALID_PARAMS	0x0d
#define MGMT_STATUS_DISCONNECTED	0x0e
#define MGMT_STATUS_NOT_POWERED		0x0f
#define MGMT_STATUS_CANCELLED		0x10
#define MGMT_STATUS_INVALID_INDEX	0x11
#define MGMT_STATUS_RFKILLED		0x12

struct mgmt_hdr {
	uint16_t opcode;
	uint16_t index;
	uint16_t len;
} __packed;
#define MGMT_HDR_SIZE	6

struct mgmt_addr_info {
	bdaddr_t bdaddr;
	uint8_t type;
} __packed;

#define MGMT_OP_READ_VERSION		0x0001
struct mgmt_rp_read_version {
	uint8_t version;
	uint16_t revision;
} __packed;

#define MGMT_OP_READ_COMMANDS		0x0002
struct mgmt_rp_read_commands {
	uint16_t num_commands;
	uint16_t num_events;
	uint16_t opcodes[0];
} __packed;

#define MGMT_OP_READ_INDEX_LIST		0x0003
struct mgmt_rp_read_index_list {
	uint16_t num_controllers;
	uint16_t index[0];
} __packed;

/* Reserve one extra byte for names in management messages so that they
 * are always guaranteed to be nul-terminated */
#define MGMT_MAX_NAME_LENGTH		(248 + 1)
#define MGMT_MAX_SHORT_NAME_LENGTH	(10 + 1)

#define MGMT_SETTING_POWERED		0x00000001
#define MGMT_SETTING_CONNECTABLE	0x00000002
#define MGMT_SETTING_FAST_CONNECTABLE	0x00000004
#define MGMT_SETTING_DISCOVERABLE	0x00000008
#define MGMT_SETTING_BONDABLE		0x00000010
#define MGMT_SETTING_LINK_SECURITY	0x00000020
#define MGMT_SETTING_SSP		0x00000040
#define MGMT_SETTING_BREDR		0x00000080
#define MGMT_SETTING_HS			0x00000100
#define MGMT_SETTING_LE			0x00000200
#define MGMT_SETTING_ADVERTISING	0x00000400
#define MGMT_SETTING_SECURE_CONN	0x00000800
#define MGMT_SETTING_DEBUG_KEYS		0x00001000
#define MGMT_SETTING_PRIVACY		0x00002000
#define MGMT_SETTING_CONFIGURATION	0x00004000

#define MGMT_OP_READ_INFO		0x0004
struct mgmt_rp_read_info {
	bdaddr_t bdaddr;
	uint8_t version;
	uint16_t manufacturer;
	uint32_t supported_settings;
	uint32_t current_settings;
	uint8_t dev_class[3];
	uint8_t name[MGMT_MAX_NAME_LENGTH];
	uint8_t short_name[MGMT_MAX_SHORT_NAME_LENGTH];
} __packed;

struct mgmt_mode {
	uint8_t val;
} __packed;

struct mgmt_cod {
	uint8_t val[3];
} __packed;

#define MGMT_OP_SET_POWERED		0x0005

#define MGMT_OP_SET_DISCOVERABLE	0x0006
struct mgmt_cp_set_discoverable {
	uint8_t val;
	uint16_t timeout;
} __packed;

#define MGMT_OP_SET_CONNECTABLE		0x0007

#define MGMT_OP_SET_FAST_CONNECTABLE	0x0008

#define MGMT_OP_SET_BONDABLE		0x0009

#define MGMT_OP_SET_LINK_SECURITY	0x000A

#define MGMT_OP_SET_SSP			0x000B

#define MGMT_OP_SET_HS			0x000C

#define MGMT_OP_SET_LE			0x000D

#define MGMT_OP_SET_DEV_CLASS		0x000E
struct mgmt_cp_set_dev_class {
	uint8_t major;
	uint8_t minor;
} __packed;

#define MGMT_OP_SET_LOCAL_NAME		0x000F
struct mgmt_cp_set_local_name {
	uint8_t name[MGMT_MAX_NAME_LENGTH];
	uint8_t short_name[MGMT_MAX_SHORT_NAME_LENGTH];
} __packed;

#define MGMT_OP_ADD_UUID		0x0010
struct mgmt_cp_add_uuid {
	uint8_t uuid[16];
	uint8_t svc_hint;
} __packed;

#define MGMT_OP_REMOVE_UUID		0x0011
struct mgmt_cp_remove_uuid {
	uint8_t uuid[16];
} __packed;

struct mgmt_link_key_info {
	struct mgmt_addr_info addr;
	uint8_t type;
	uint8_t val[16];
	uint8_t pin_len;
} __packed;

#define MGMT_OP_LOAD_LINK_KEYS		0x0012
struct mgmt_cp_load_link_keys {
	uint8_t debug_keys;
	uint16_t key_count;
	struct mgmt_link_key_info keys[0];
} __packed;

struct mgmt_ltk_info {
	struct mgmt_addr_info addr;
	uint8_t type;
	uint8_t master;
	uint8_t enc_size;
	uint16_t ediv;
	uint64_t rand;
	uint8_t val[16];
} __packed;

#define MGMT_OP_LOAD_LONG_TERM_KEYS	0x0013
struct mgmt_cp_load_long_term_keys {
	uint16_t key_count;
	struct mgmt_ltk_info keys[0];
} __packed;

#define MGMT_OP_DISCONNECT		0x0014
struct mgmt_cp_disconnect {
	struct mgmt_addr_info addr;
} __packed;
struct mgmt_rp_disconnect {
	struct mgmt_addr_info addr;
} __packed;

#define MGMT_OP_GET_CONNECTIONS		0x0015
struct mgmt_rp_get_connections {
	uint16_t conn_count;
	struct mgmt_addr_info addr[0];
} __packed;

#define MGMT_OP_PIN_CODE_REPLY		0x0016
struct mgmt_cp_pin_code_reply {
	struct mgmt_addr_info addr;
	uint8_t pin_len;
	uint8_t pin_code[16];
} __packed;

#define MGMT_OP_PIN_CODE_NEG_REPLY	0x0017
struct mgmt_cp_pin_code_neg_reply {
	struct mgmt_addr_info addr;
} __packed;

#define MGMT_OP_SET_IO_CAPABILITY	0x0018
struct mgmt_cp_set_io_capability {
	uint8_t io_capability;
} __packed;

#define MGMT_OP_PAIR_DEVICE		0x0019
struct mgmt_cp_pair_device {
	struct mgmt_addr_info addr;
	uint8_t io_cap;
} __packed;
struct mgmt_rp_pair_device {
	struct mgmt_addr_info addr;
} __packed;

#define MGMT_OP_CANCEL_PAIR_DEVICE	0x001A

#define MGMT_OP_UNPAIR_DEVICE		0x001B
struct mgmt_cp_unpair_device {
	struct mgmt_addr_info addr;
	uint8_t disconnect;
} __packed;
struct mgmt_rp_unpair_device {
	struct mgmt_addr_info addr;
} __packed;

#define MGMT_OP_USER_CONFIRM_REPLY	0x001C
struct mgmt_cp_user_confirm_reply {
	struct mgmt_addr_info addr;
} __packed;
struct mgmt_rp_user_confirm_reply {
	struct mgmt_addr_info addr;
} __packed;

#define MGMT_OP_USER_CONFIRM_NEG_REPLY	0x001D

#define MGMT_OP_USER_PASSKEY_REPLY	0x001E
struct mgmt_cp_user_passkey_reply {
	struct mgmt_addr_info addr;
	uint32_t passkey;
} __packed;
struct mgmt_rp_user_passkey_reply {
	struct mgmt_addr_info addr;
} __packed;

#define MGMT_OP_USER_PASSKEY_NEG_REPLY	0x001F
struct mgmt_cp_user_passkey_neg_reply {
	struct mgmt_addr_info addr;
} __packed;

#define MGMT_OP_READ_LOCAL_OOB_DATA	0x0020
struct mgmt_rp_read_local_oob_data {
	uint8_t hash[16];
	uint8_t randomizer[16];
} __packed;
struct mgmt_rp_read_local_oob_ext_data {
	uint8_t hash192[16];
	uint8_t randomizer192[16];
	uint8_t hash256[16];
	uint8_t randomizer256[16];
} __packed;

#define MGMT_OP_ADD_REMOTE_OOB_DATA	0x0021
struct mgmt_cp_add_remote_oob_data {
	struct mgmt_addr_info addr;
	uint8_t hash[16];
	uint8_t randomizer[16];
} __packed;

#define MGMT_OP_REMOVE_REMOTE_OOB_DATA	0x0022
struct mgmt_cp_remove_remote_oob_data {
	struct mgmt_addr_info addr;
} __packed;

#define MGMT_OP_START_DISCOVERY		0x0023
struct mgmt_cp_start_discovery {
	uint8_t type;
} __packed;

#define MGMT_OP_STOP_DISCOVERY		0x0024
struct mgmt_cp_stop_discovery {
	uint8_t type;
} __packed;

#define MGMT_OP_CONFIRM_NAME		0x0025
struct mgmt_cp_confirm_name {
	struct mgmt_addr_info addr;
	uint8_t name_known;
} __packed;
struct mgmt_rp_confirm_name {
	struct mgmt_addr_info addr;
} __packed;

#define MGMT_OP_BLOCK_DEVICE		0x0026
struct mgmt_cp_block_device {
	struct mgmt_addr_info addr;
} __packed;

#define MGMT_OP_UNBLOCK_DEVICE		0x0027
struct mgmt_cp_unblock_device {
	struct mgmt_addr_info addr;
} __packed;

#define MGMT_OP_SET_DEVICE_ID		0x0028
struct mgmt_cp_set_device_id {
	uint16_t source;
	uint16_t vendor;
	uint16_t product;
	uint16_t version;
} __packed;

#define MGMT_OP_SET_ADVERTISING		0x0029

#define MGMT_OP_SET_BREDR		0x002A

#define MGMT_OP_SET_STATIC_ADDRESS	0x002B
struct mgmt_cp_set_static_address {
	bdaddr_t bdaddr;
} __packed;

#define MGMT_OP_SET_SCAN_PARAMS		0x002C
struct mgmt_cp_set_scan_params {
	uint16_t interval;
	uint16_t window;
} __packed;

#define MGMT_OP_SET_SECURE_CONN		0x002D

#define MGMT_OP_SET_DEBUG_KEYS		0x002E

struct mgmt_irk_info {
	struct mgmt_addr_info addr;
	uint8_t val[16];
} __packed;

#define MGMT_OP_SET_PRIVACY		0x002F
struct mgmt_cp_set_privacy {
	uint8_t privacy;
	uint8_t irk[16];
} __packed;

#define MGMT_OP_LOAD_IRKS		0x0030
struct mgmt_cp_load_irks {
	uint16_t irk_count;
	struct mgmt_irk_info irks[0];
} __packed;

#define MGMT_OP_GET_CONN_INFO		0x0031
struct mgmt_cp_get_conn_info {
	struct mgmt_addr_info addr;
} __packed;
struct mgmt_rp_get_conn_info {
	struct mgmt_addr_info addr;
	int8_t rssi;
	int8_t tx_power;
	int8_t max_tx_power;
} __packed;

#define MGMT_OP_GET_CLOCK_INFO		0x0032
struct mgmt_cp_get_clock_info {
	struct mgmt_addr_info addr;
} __packed;
struct mgmt_rp_get_clock_info {
	struct mgmt_addr_info addr;
	uint32_t  local_clock;
	uint32_t  piconet_clock;
	uint16_t  accuracy;
} __packed;

#define MGMT_OP_ADD_DEVICE		0x0033
struct mgmt_cp_add_device {
	struct mgmt_addr_info addr;
	uint8_t action;
} __packed;
struct mgmt_rp_add_device {
	struct mgmt_addr_info addr;
} __packed;

#define MGMT_OP_REMOVE_DEVICE		0x0034
struct mgmt_cp_remove_device {
	struct mgmt_addr_info addr;
} __packed;
struct mgmt_rp_remove_device {
	struct mgmt_addr_info addr;
} __packed;

struct mgmt_conn_param {
	struct mgmt_addr_info addr;
	uint16_t min_interval;
	uint16_t max_interval;
	uint16_t latency;
	uint16_t timeout;
} __packed;

#define MGMT_OP_LOAD_CONN_PARAM		0x0035
struct mgmt_cp_load_conn_param {
	uint16_t param_count;
	struct mgmt_conn_param params[0];
} __packed;

#define MGMT_OP_READ_UNCONF_INDEX_LIST	0x0036
struct mgmt_rp_read_unconf_index_list {
	uint16_t num_controllers;
	uint16_t index[0];
} __packed;

#define MGMT_OPTION_EXTERNAL_CONFIG	0x00000001
#define MGMT_OPTION_PUBLIC_ADDRESS	0x00000002

#define MGMT_OP_READ_CONFIG_INFO	0x0037
struct mgmt_rp_read_config_info {
	uint16_t manufacturer;
	uint32_t supported_options;
	uint32_t missing_options;
} __packed;

#define MGMT_OP_SET_EXTERNAL_CONFIG	0x0038
struct mgmt_cp_set_external_config {
	uint8_t config;
} __packed;

#define MGMT_OP_SET_PUBLIC_ADDRESS	0x0039
struct mgmt_cp_set_public_address {
	bdaddr_t bdaddr;
} __packed;

#define MGMT_EV_CMD_COMPLETE		0x0001
struct mgmt_ev_cmd_complete {
	uint16_t opcode;
	uint8_t status;
	uint8_t data[0];
} __packed;

#define MGMT_EV_CMD_STATUS		0x0002
struct mgmt_ev_cmd_status {
	uint16_t opcode;
	uint8_t status;
} __packed;

#define MGMT_EV_CONTROLLER_ERROR	0x0003
struct mgmt_ev_controller_error {
	uint8_t error_code;
} __packed;

#define MGMT_EV_INDEX_ADDED		0x0004

#define MGMT_EV_INDEX_REMOVED		0x0005

#define MGMT_EV_NEW_SETTINGS		0x0006

#define MGMT_EV_CLASS_OF_DEV_CHANGED	0x0007
struct mgmt_ev_class_of_dev_changed {
	uint8_t class_of_dev[3];
} __packed;

#define MGMT_EV_LOCAL_NAME_CHANGED	0x0008
struct mgmt_ev_local_name_changed {
	uint8_t name[MGMT_MAX_NAME_LENGTH];
	uint8_t short_name[MGMT_MAX_SHORT_NAME_LENGTH];
} __packed;

#define MGMT_EV_NEW_LINK_KEY		0x0009
struct mgmt_ev_new_link_key {
	uint8_t store_hint;
	struct mgmt_link_key_info key;
} __packed;

#define MGMT_EV_NEW_LONG_TERM_KEY	0x000A
struct mgmt_ev_new_long_term_key {
	uint8_t store_hint;
	struct mgmt_ltk_info key;
} __packed;

#define MGMT_EV_DEVICE_CONNECTED	0x000B
struct mgmt_ev_device_connected {
	struct mgmt_addr_info addr;
	uint32_t flags;
	uint16_t eir_len;
	uint8_t eir[0];
} __packed;

#define MGMT_DEV_DISCONN_UNKNOWN	0x00
#define MGMT_DEV_DISCONN_TIMEOUT	0x01
#define MGMT_DEV_DISCONN_LOCAL_HOST	0x02
#define MGMT_DEV_DISCONN_REMOTE		0x03

#define MGMT_EV_DEVICE_DISCONNECTED	0x000C
struct mgmt_ev_device_disconnected {
	struct mgmt_addr_info addr;
	uint8_t reason;
} __packed;

#define MGMT_EV_CONNECT_FAILED		0x000D
struct mgmt_ev_connect_failed {
	struct mgmt_addr_info addr;
	uint8_t status;
} __packed;

#define MGMT_EV_PIN_CODE_REQUEST	0x000E
struct mgmt_ev_pin_code_request {
	struct mgmt_addr_info addr;
	uint8_t secure;
} __packed;

#define MGMT_EV_USER_CONFIRM_REQUEST	0x000F
struct mgmt_ev_user_confirm_request {
	struct mgmt_addr_info addr;
	uint8_t confirm_hint;
	uint32_t value;
} __packed;

#define MGMT_EV_USER_PASSKEY_REQUEST	0x0010
struct mgmt_ev_user_passkey_request {
	struct mgmt_addr_info addr;
} __packed;

#define MGMT_EV_AUTH_FAILED		0x0011
struct mgmt_ev_auth_failed {
	struct mgmt_addr_info addr;
	uint8_t status;
} __packed;

#define MGMT_DEV_FOUND_CONFIRM_NAME	0x01
#define MGMT_DEV_FOUND_LEGACY_PAIRING	0x02
#define MGMT_DEV_FOUND_NOT_CONNECTABLE	0x04

#define MGMT_EV_DEVICE_FOUND		0x0012
struct mgmt_ev_device_found {
	struct mgmt_addr_info addr;
	int8_t rssi;
	uint32_t flags;
	uint16_t eir_len;
	uint8_t eir[0];
} __packed;

#define MGMT_EV_DISCOVERING		0x0013
struct mgmt_ev_discovering {
	uint8_t type;
	uint8_t discovering;
} __packed;

#define MGMT_EV_DEVICE_BLOCKED		0x0014
struct mgmt_ev_device_blocked {
	struct mgmt_addr_info addr;
} __packed;

#define MGMT_EV_DEVICE_UNBLOCKED	0x0015
struct mgmt_ev_device_unblocked {
	struct mgmt_addr_info addr;
} __packed;

#define MGMT_EV_DEVICE_UNPAIRED		0x0016
struct mgmt_ev_device_unpaired {
	struct mgmt_addr_info addr;
} __packed;

#define MGMT_EV_PASSKEY_NOTIFY		0x0017
struct mgmt_ev_passkey_notify {
	struct mgmt_addr_info addr;
	uint32_t passkey;
	uint8_t entered;
} __packed;

#define MGMT_EV_NEW_IRK			0x0018
struct mgmt_ev_new_irk {
	uint8_t  store_hint;
	bdaddr_t rpa;
	struct mgmt_irk_info key;
} __packed;

struct mgmt_csrk_info {
	struct mgmt_addr_info addr;
	uint8_t master;
	uint8_t val[16];
} __packed;

#define MGMT_EV_NEW_CSRK		0x0019
struct mgmt_ev_new_csrk {
	uint8_t store_hint;
	struct mgmt_csrk_info key;
} __packed;

#define MGMT_EV_DEVICE_ADDED		0x001a
struct mgmt_ev_device_added {
	struct mgmt_addr_info addr;
	uint8_t action;
} __packed;

#define MGMT_EV_DEVICE_REMOVED		0x001b
struct mgmt_ev_device_removed {
	struct mgmt_addr_info addr;
} __packed;

#define MGMT_EV_NEW_CONN_PARAM		0x001c
struct mgmt_ev_new_conn_param {
	struct mgmt_addr_info addr;
	uint8_t store_hint;
	uint16_t min_interval;
	uint16_t max_interval;
	uint16_t latency;
	uint16_t timeout;
} __packed;

#define MGMT_EV_UNCONF_INDEX_ADDED	0x001d

#define MGMT_EV_UNCONF_INDEX_REMOVED	0x001e

#define MGMT_EV_NEW_CONFIG_OPTIONS	0x001f

static const char *mgmt_op[] = {
	"<0x0000>",
	"Read Version",
	"Read Commands",
	"Read Index List",
	"Read Controller Info",
	"Set Powered",
	"Set Discoverable",
	"Set Connectable",
	"Set Fast Connectable",		/* 0x0008 */
	"Set Bondable",
	"Set Link Security",
	"Set Secure Simple Pairing",
	"Set High Speed",
	"Set Low Energy",
	"Set Dev Class",
	"Set Local Name",
	"Add UUID",			/* 0x0010 */
	"Remove UUID",
	"Load Link Keys",
	"Load Long Term Keys",
	"Disconnect",
	"Get Connections",
	"PIN Code Reply",
	"PIN Code Neg Reply",
	"Set IO Capability",		/* 0x0018 */
	"Pair Device",
	"Cancel Pair Device",
	"Unpair Device",
	"User Confirm Reply",
	"User Confirm Neg Reply",
	"User Passkey Reply",
	"User Passkey Neg Reply",
	"Read Local OOB Data",		/* 0x0020 */
	"Add Remote OOB Data",
	"Remove Remove OOB Data",
	"Start Discovery",
	"Stop Discovery",
	"Confirm Name",
	"Block Device",
	"Unblock Device",
	"Set Device ID",
	"Set Advertising",
	"Set BR/EDR",
	"Set Static Address",
	"Set Scan Parameters",
	"Set Secure Connections",
	"Set Debug Keys",
	"Set Privacy",
	"Load Identity Resolving Keys",
	"Get Connection Information",
	"Get Clock Information",
	"Add Device",
	"Remove Device",
	"Load Connection Parameters",
	"Read Unconfigured Index List",
	"Read Controller Configuration Information",
	"Set External Configuration",
	"Set Public Address",
};

static const char *mgmt_ev[] = {
	"<0x0000>",
	"Command Complete",
	"Command Status",
	"Controller Error",
	"Index Added",
	"Index Removed",
	"New Settings",
	"Class of Device Changed",
	"Local Name Changed",		/* 0x0008 */
	"New Link Key",
	"New Long Term Key",
	"Device Connected",
	"Device Disconnected",
	"Connect Failed",
	"PIN Code Request",
	"User Confirm Request",
	"User Passkey Request",		/* 0x0010 */
	"Authentication Failed",
	"Device Found",
	"Discovering",
	"Device Blocked",
	"Device Unblocked",
	"Device Unpaired",
	"Passkey Notify",
	"New Identity Resolving Key",
	"New Signature Resolving Key",
	"Device Added",
	"Device Removed",
	"New Connection Parameter",
	"Unconfigured Index Added",
	"Unconfigured Index Removed",
	"New Configuration Options",
};

static const char *mgmt_status[] = {
	"Success",
	"Unknown Command",
	"Not Connected",
	"Failed",
	"Connect Failed",
	"Authentication Failed",
	"Not Paired",
	"No Resources",
	"Timeout",
	"Already Connected",
	"Busy",
	"Rejected",
	"Not Supported",
	"Invalid Parameters",
	"Disconnected",
	"Not Powered",
	"Cancelled",
	"Invalid Index",
	"Blocked through rfkill",
};

#ifndef NELEM
#define NELEM(x) (sizeof(x) / sizeof((x)[0]))
#endif

static inline const char *mgmt_opstr(uint16_t op)
{
	if (op >= NELEM(mgmt_op))
		return "<unknown opcode>";
	return mgmt_op[op];
}

static inline const char *mgmt_evstr(uint16_t ev)
{
	if (ev >= NELEM(mgmt_ev))
		return "<unknown event>";
	return mgmt_ev[ev];
}

static inline const char *mgmt_errstr(uint8_t status)
{
	if (status >= NELEM(mgmt_status))
		return "<unknown status>";
	return mgmt_status[status];
}


code:
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
    <Source>
        <Name>libpcap</Name>
        <Homepage>http://www.tcpdump.org/</Homepage>
        <Packager>
            <Name>PisiLinux Community</Name>
            <Email>admins@pisilinux.org</Email>
        </Packager>
        <License>BSD</License>
        <IsA>library</IsA>
        A system-independent library for user-level network packet capture
        <Description>libpcap (Packet CAPture) provides a portable framework for low-level network monitoring. Applications include network statistics collection, security monitoring, network debugging, etc.</Description>
        <Archive sha1sum="32d7526dde8f8a2f75baf40c01670602aeef7e39" type="targz">http://www.tcpdump.org/release/libpcap-1.8.1.tar.gz</Archive>
        <BuildDependencies>
            <Dependency>bluez-libs-devel</Dependency>
            <Dependency>libnl-devel</Dependency>
            <Dependency>libusb-devel</Dependency>
            <Dependency>dbus-devel</Dependency>
        </BuildDependencies>
        <Patches>

            <Patch level="1">libpcap-1.7.4-enable_bluetooth-1.patch</Patch>
            <Patch>disable-remote.diff</Patch>
        </Patches>
    </Source>

    <Package>
        <Name>libpcap</Name>
        <RuntimeDependencies>
            <Dependency>bluez</Dependency>
            <Dependency>libnl</Dependency>
            <Dependency>dbus</Dependency>
            <Dependency>libusb</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="library">/usr/lib</Path>
            <Path fileType="doc">/usr/share/doc</Path>
            <Path fileType="man">/usr/share/man</Path>
        </Files>
    </Package>

    <Package>
        <Name>libpcap-devel</Name>
        Development files for libpcap
        <RuntimeDependencies>
            <Dependency release="current">libpcap</Dependency>
        </RuntimeDependencies>
        <Files>
            <Path fileType="executable">/usr/bin/pcap-config</Path>
            <Path fileType="header">/usr/include</Path>
            <Path fileType="man">/usr/share/man/man3</Path>
        </Files>
    </Package>

    <History>
        <Update release="4">
            <Date>2017-05-15</Date>
            <Version>1.8.1</Version>
            <Comment>Release Bump</Comment>
            <Name>Kamil Atlı</Name>
            <Email>suvari@pisilinux.org</Email>
        </Update>
        <Update release="3">
            <Date>2016-06-09</Date>
            <Version>1.8.1</Version>
            <Comment>Version Bump</Comment>
            <Name>Kamil Atlı</Name>
            <Email>suvari@pisilinux.org</Email>
        </Update>
        <Update release="2">
            <Date>2016-06-09</Date>
            <Version>1.7.4</Version>
            <Comment>Release Bump</Comment>
            <Name>Pisi Linux Community</Name>
            <Email>admin@pisilinux.org</Email>
        </Update>
        <Update release="1">
            <Date>2016-03-25</Date>
            <Version>1.7.4</Version>
            <Comment>First release</Comment>
            <Name>Ertuğrul Erata</Name>
            <Email>ertugrulerata@gmail.com</Email>
        </Update>
    </History>
</PISI>


code:
<?xml version="1.0" ?>
<PISI>
    <Source>
        <Name>libpcap</Name>
        Kullanıcı seviyesinde ağ paketi yakalamak için bir sistem bağımsız kitaplığı
        <Description xml:lang="tr">libpcap (Packet CAPture) düşük-seviye ağların izlenmesi için kullanılan bir kitaplıktır. Ağ istatistikleri, güvenlik izleyicisi, ağ hata gözleme gibi uygulamalar genellikle bu kitaplığı kullanır.</Description>
        <Description xml:lang="fr">libpcap (Packet CAPture) fourni un cadre de développement portable pour la surveillance réseau de bas niveau. On peut l'utiliser pour collecter des statistiques réseau, surveiller la sécurité, corriger le réseau, etc.</Description>
        <Description xml:lang="es">libpcap (Packet CAPture) facilita un framework portable para monitoreo de redes a a bajo nivel. Aplicaciones abarcan sistemas de estadísticas de red, monitoreo de seguridad, depuración de red, etc.</Description>
    </Source>

    <Package>
        <Name>libpcap-devel</Name>
        libpcap 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.autoreconf("-vif")
    autotools.configure("--disable-static \
                         --without-docdir")
                         #FIXME: documentation is temporarily disabled since update release 7.
                         #--with-documentation=/usr/share/doc/%s" % get.srcNAME())

    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.remove("/usr/share/doc/libupnp/IXML_Programming_Guide.pdf")
    #pisitools.remove("/usr/share/doc/libupnp/UPnP_Programming_Guide.pdf")