--- istanbul-0.2.2.orig/debian/rules
+++ istanbul-0.2.2/debian/rules
@@ -0,0 +1,74 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+include /usr/share/quilt/quilt.make
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+CFLAGS = -Wall -g
+DESTDIR = $(CURDIR)/debian/istanbul
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+else
+	CFLAGS += -O2
+endif
+
+config.status: $(QUILT_STAMPFN)
+	dh_testdir
+	./configure --host=$(DEB_HOST_GNU_TYPE) \
+		    --build=$(DEB_BUILD_GNU_TYPE) \
+		    --prefix=/usr \
+		    --mandir=\$${prefix}/share/man \
+		    --sysconfdir=\$${prefix}/share \
+		    --disable-gconftool
+
+build: build-stamp
+
+build-stamp: config.status
+	dh_testdir
+	$(MAKE)
+	touch build-stamp
+
+clean: unpatch
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp 
+	[ ! -f Makefile ] || $(MAKE) distclean
+	dh_clean 
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k 
+	dh_installdirs
+
+	 $(MAKE) DESTDIR=$(DESTDIR) install
+	 cp $(CURDIR)/debian/istanbul.xpm $(DESTDIR)/usr/share/pixmaps/
+	 rm `find $(DESTDIR) -name '*.la'`
+
+binary-indep: build install
+
+binary-arch: build install
+	     dh_testdir
+	     dh_testroot
+	     dh_installchangelogs ChangeLog
+	     dh_installdocs
+	     dh_installmenu
+	     dh_strip
+	     dh_compress
+	     dh_fixperms
+	     dh_gconf
+	     dh_pysupport
+	     dh_installdeb
+	     dh_shlibdeps
+	     dh_gencontrol
+	     dh_md5sums
+	     dh_builddeb
+	
+binary: binary-indep binary-arch
+
+.PHONY: build clean binary-indep binary-arch binary install
--- istanbul-0.2.2.orig/debian/pyversions
+++ istanbul-0.2.2/debian/pyversions
@@ -0,0 +1 @@
+2.3-
--- istanbul-0.2.2.orig/debian/dirs
+++ istanbul-0.2.2/debian/dirs
@@ -0,0 +1 @@
+/usr/share/pixmaps/
--- istanbul-0.2.2.orig/debian/copyright
+++ istanbul-0.2.2/debian/copyright
@@ -0,0 +1,47 @@
+This package was debianized by Luca Bruno <lucab@debian.org> on
+Sun, 11 Sep 2005 19:49:53 +0200.
+
+It was downloaded from http://live.gnome.org/Istanbul
+
+Files: *
+Copyright: © 2005, 2006 Zaheer Abbas Merali <zaheerabbas@merali.org>
+	   © 2006 John N. Laliberte <jlaliberte@gmail.com>
+	   © 2004, 2005 Fluendo, S.L. <www.fluendo.com>
+	   © 2006 Chong Kai Xiong <descender@phreaker.org>
+	   © 2006 Wouter Bolsterlee <wbolster@gnome.org>
+License: GPL-2+
+    This package 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.
+
+Files: gst/gstximagesrc.*
+Copyright: © 2006 Zaheer Abbas Merali <zaheerabbas@merali.org>
+License: LGPL-2+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+Files: gst/ximageutil.*
+Copyright: © 2005 Luca Ognibene <luogni@tin.it>
+License: LGPL-2+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+Files: Makefile.*, config*
+Copyright: © 1992-2006 Free Software Foundation, Inc.
+License: GPL-2+
+    This package 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.
+
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL' and the
+complete text of the GNU Lesser General Public License can be found in
+`/usr/share/common-licenses/LGPL'.
+
--- istanbul-0.2.2.orig/debian/compat
+++ istanbul-0.2.2/debian/compat
@@ -0,0 +1 @@
+5
--- istanbul-0.2.2.orig/debian/README.source
+++ istanbul-0.2.2/debian/README.source
@@ -0,0 +1,2 @@
+This package uses quilt for patch management, for more information see
+the file /usr/share/doc/quilt/README.source in the quilt package.
--- istanbul-0.2.2.orig/debian/doc
+++ istanbul-0.2.2/debian/doc
@@ -0,0 +1,2 @@
+README
+NEWS
--- istanbul-0.2.2.orig/debian/control
+++ istanbul-0.2.2/debian/control
@@ -0,0 +1,36 @@
+Source: istanbul
+Section: gnome
+Priority: extra
+Vcs-Git: https://git.unstable.it/packages.git/
+Vcs-Browser: https://git.unstable.it/?p=packages.git;a=shortlog;h=istanbul
+Maintainer: Luca Bruno <lucab@debian.org>
+Build-Depends:	debhelper (>= 5.0.37.2), python-dev (>= 2.3.5), 
+		python-gtk2-dev (>= 2.6), libgstreamer0.10-dev (>=0.10.8), 
+		python-gst0.10 (>= 0.10), libgtk2.0-dev, libglade2-dev, 
+		python-support (>=0.5.3), intltool, 
+		libgstreamer-plugins-base0.10-dev, libglib2.0-dev, 
+		libxml2-dev, libxext-dev, libxfixes-dev, libx11-dev, libtool, 
+		python-gnome2-extras-dev, python-gnome2-dev, python-xlib, 
+		quilt (>= 0.40)
+Standards-Version: 3.9.0
+Homepage: http://live.gnome.org/Istanbul
+
+Package: istanbul
+Architecture: any
+Depends:    ${misc:Depends}, ${shlibs:Depends}, ${python:Depends}, 
+	    python-gst0.10 (>= 0.10), python-glade2 (>= 2.8.2-3.1), 
+	    gettext, gstreamer0.10-plugins-good (>= 0.10.3),
+	    gstreamer0.10-plugins-base (>= 0.10.8), gstreamer0.10-x, 
+	    gstreamer0.10-alsa [!kfreebsd-any], python-gnome2, python-xlib
+Suggests: fbpanel | perlpanel
+XB-Python-Version: ${python:Versions}
+Description: Desktop session recorder producing Ogg Theora video
+ Istanbul is a desktop session recorder for the Free Desktop.
+ It records your session into an Ogg Theora video file.
+ To start the recording, you click on its icon in the 
+ notification area. To stop you click its icon again.
+ It can make a screencast of the full screen or just of an 
+ area of the screen. It is even capable of recording audio 
+ from the default input channel.
+ .
+ It works on GNOME, KDE, Xfce and others.
--- istanbul-0.2.2.orig/debian/changelog
+++ istanbul-0.2.2/debian/changelog
@@ -0,0 +1,160 @@
+istanbul (0.2.2-8.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Don't ship .la files (Closes: #621642).
+
+ -- Luk Claes <luk@debian.org>  Thu, 23 Jun 2011 07:31:44 +0200
+
+istanbul (0.2.2-8) unstable; urgency=medium
+
+  * Remove GStreamer alsa explicit audiosource, not available on kfreebsd-*
+    (Closes: #591739)
+  * Avoid overwriting directories when saving screencast (Closes: #592258)
+
+ -- Luca Bruno <lucab@debian.org>  Tue, 17 Aug 2010 11:39:08 +0200
+
+istanbul (0.2.2-7) unstable; urgency=low
+
+  * Bumped Standards-version to 3.9.0 (no changes needed)
+  * Fix recording with audio, patch from upstream (Closes: #486660)
+  * Fix threads issues, patch from upstream (Closes: #554568, #558241, #578202)
+
+ -- Luca Bruno <lucab@debian.org>  Sat, 24 Jul 2010 14:21:35 +0200
+
+istanbul (0.2.2-6) unstable; urgency=low
+
+  * Removing Florian Ragwitz from uploaders (Closes: #523164)
+  * Removing deprecated egg.trayicon in favour of gtk.StatusIcon 
+    (Closes: #560980)
+
+ -- Luca Bruno <lucab@debian.org>  Wed, 30 Dec 2009 13:20:28 +0100
+
+istanbul (0.2.2-5) unstable; urgency=low
+
+  * Acknowledged NMU; thanks thiemo, you'll never be forgotten
+    (Closes: #500418)
+  * Remove optional depends on pypanel (Closes: #507906)
+  * Depend on python-eggtrayicon instead of python-gnome2-extras
+    (Closes: #485301)
+  * Bumped Standards-version to 3.8.1 (no changes needed)
+  * Use $(QUILT_STAMPFN) as patch target to avoid double configuration
+  * Remove useless get-orig-source target and script
+
+ -- Luca Bruno <lucab@debian.org>  Thu, 19 Mar 2009 20:53:54 +0100
+
+istanbul (0.2.2-4.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Re-enable builds for any architecture. (Closes: #500418)
+
+ -- Thiemo Seufer <ths@debian.org>  Fri, 31 Oct 2008 11:49:01 +0100
+
+istanbul (0.2.2-4) unstable; urgency=low
+
+  * Do not screw up python import path at runtime with wrong data
+    (Closes: #476674)
+  * Fix window selection and recording under compiz, patch by
+    Krzysztof Kotlenga (Closes: #415896)
+      
+ -- Luca Bruno <lucab@debian.org>  Sun, 27 Apr 2008 15:20:03 +0200
+
+istanbul (0.2.2-3) unstable; urgency=low
+
+  * Moving to Priority: extra
+  * Suggesting an external standard panel for desktop environments without a 
+    systray, or not following the specification (Closes: #445899)
+  * Disabling those architectures where python-gst isn't available
+
+ -- Luca Bruno <lucab@debian.org>  Thu, 14 Feb 2008 17:01:37 +0100
+
+istanbul (0.2.2-2) unstable; urgency=low
+
+  * Added Vcs entry in debian/control
+  * Fixed menu section complying with Debian Menu transition
+  * Handling our patches better with quilt, added build-dep for it
+  * Istanbul now honours umask setting (Closes: #435157)
+  * This packages now conforms to the New Python Policy
+  * debian/copyright rewritten in a machine-interpretable format
+
+ -- Luca Bruno <lucab@debian.org>  Sun, 29 Jul 2007 17:23:29 +0200
+
+istanbul (0.2.2-1) unstable; urgency=low
+
+  * New upstream version (codename: "Camp Nou, 21 Feb 2007") (Closes: #413367)
+  * Removed not necessary depends on gstreamer-plugins-ugly (Closes: #385565)
+  * Improved manpage, removed gstreamer related section (Closes: #413114)
+  * Ugly hack on configure to avoid autobuilding problems with egg.trayicon
+  * All our previous patches are now shipped by upstream
+
+ -- Luca Bruno <luca.br@uno.it>  Sat, 10 Mar 2007 14:25:26 +0100
+
+istanbul (0.2.1-3) unstable; urgency=low
+
+  * Description improved (Closes: #391944)
+  * Buttons text improved in save dialog (Closes: #383153)
+  * Fixed bad handling of 8bpp or 16bpp screen (Closes: #386877)
+
+ -- Luca Bruno <luca.br@uno.it>  Wed, 15 Nov 2006 16:41:50 +0100
+
+istanbul (0.2.1-2) unstable; urgency=low
+
+  * Fixed missing dependency on python-gnome2 (Closes: #384781) 
+
+ -- Luca Bruno <luca.br@uno.it>  Mon, 28 Aug 2006 09:47:25 +0200
+
+istanbul (0.2.1-1) unstable; urgency=low
+
+  * New upstream release (codename: "Freedom to record speech")
+  * istanbul can now record audio, added dependecies on gstreamer-alsa plugins
+  * Patch from CVS to workaround a bug in a Xv driver (Closes: #382416)
+  * Improved handling of gconf schemas and added related dependecies
+
+ -- Luca Bruno <luca.br@uno.it>  Wed, 16 Aug 2006 09:41:13 +0200
+
+istanbul (0.2.0-1) unstable; urgency=low
+
+  * New upstream version (codename: "Zinedine Zidane")
+  * Upstream now includes all our patches, dropping our specific copy
+     + pytrayicon files removed, removed its licence from debian/copyright
+  * Manpage has been incorporated upstream, dropping our specific copy
+  * istanbul now is shipped with a CVS hacked copy of libgstximagesrc, so
+    we're temporarily building for arch: any
+
+ -- Luca Bruno <luca.br@uno.it>  Fri, 28 Jul 2006 21:35:41 +0200
+
+istanbul (0.1.2-1) unstable; urgency=low
+
+  * New upstream version (codename: "Come on England!")
+  * Updated Standards-Version (no changes needed)
+  * Many changes to accomply with latest python-policy revision
+     + Updating dependency on python-glade2 (Closes: #377055)
+  * istanbul now uses GStreamer 0.10 by default
+  * Added a proper debian/watch file
+  * No more using a private version of pytrayicon, using instead egg.trayicon
+    provided by python-gnome2-extras
+  * Little patch for main.py to work correctly with all locales
+  * No more compilation needed, istanbul is now arch: all
+
+ -- Luca Bruno <luca.br@uno.it>  Mon,  3 Jul 2006 11:15:06 +0200
+
+istanbul (0.1.1-3) unstable; urgency=low
+
+  * Using xpm icon in menu entry, to match policy
+  * Menu now works also in bottom taskbar (Closes: #341303)
+
+ -- Luca Bruno <luca.br@uno.it>  Sat,  4 Feb 2006 13:53:20 +0100
+
+istanbul (0.1.1-2) unstable; urgency=low
+
+  * Added dependency on gstreamer0.8-jpeg (Closes: #344164)
+  * Improved Debian menu entry:
+    - Added icon
+    - Added longtitle
+
+ -- Luca Bruno <luca.br@uno.it>  Thu, 22 Dec 2005 14:59:02 +0100
+
+istanbul (0.1.1-1) unstable; urgency=low
+
+  * Initial release (Closes: #316503)
+
+ -- Luca Bruno <luca.br@uno.it>  Sat,  8 Oct 2005 15:39:31 +0200
--- istanbul-0.2.2.orig/debian/menu
+++ istanbul-0.2.2/debian/menu
@@ -0,0 +1,6 @@
+?package(istanbul):needs="X11"\
+	section="Applications/Video"\
+  	title="Istanbul"\
+	command="/usr/bin/istanbul"\
+	longtitle="Desktop session recorder"\
+	icon="/usr/share/pixmaps/istanbul.xpm"
--- istanbul-0.2.2.orig/debian/istanbul.xpm
+++ istanbul-0.2.2/debian/istanbul.xpm
@@ -0,0 +1,157 @@
+/* XPM */
+static char * istanbul_xpm[] = {
+"32 32 122 2",
+"  	c None",
+". 	c #4B494B",
+"+ 	c #444244",
+"@ 	c #3D3B3D",
+"# 	c #605E60",
+"$ 	c #040204",
+"% 	c #164A16",
+"& 	c #393739",
+"* 	c #363436",
+"= 	c #848284",
+"- 	c #6F6D6F",
+"; 	c #595759",
+"> 	c #747274",
+", 	c #123A12",
+"' 	c #8A898A",
+") 	c #484648",
+"! 	c #6B696B",
+"~ 	c #1F1905",
+"{ 	c #544607",
+"] 	c #2A282A",
+"^ 	c #A3A3A3",
+"/ 	c #4F4D4F",
+"( 	c #565456",
+"_ 	c #403E40",
+": 	c #3B1304",
+"< 	c #A93504",
+"[ 	c #828182",
+"} 	c #888788",
+"| 	c #FC4E04",
+"1 	c #722404",
+"2 	c #8E2C04",
+"3 	c #686668",
+"4 	c #908F90",
+"5 	c #7D7B7D",
+"6 	c #7B797B",
+"7 	c #E04604",
+"8 	c #525052",
+"9 	c #767476",
+"0 	c #248024",
+"a 	c #571B04",
+"b 	c #373537",
+"c 	c #9D9D9D",
+"d 	c #242224",
+"e 	c #0F0D0F",
+"f 	c #201E20",
+"g 	c #797779",
+"h 	c #2F2D2F",
+"i 	c #646264",
+"j 	c #282628",
+"k 	c #371757",
+"l 	c #150920",
+"m 	c #C53D04",
+"n 	c #0B090B",
+"o 	c #9C42FC",
+"p 	c #7A34C5",
+"q 	c #08023E",
+"r 	c #0C026C",
+"s 	c #4C1EAC",
+"t 	c #69667F",
+"u 	c #46305B",
+"v 	c #392F06",
+"w 	c #19106F",
+"x 	c #3F3B54",
+"y 	c #1F175F",
+"z 	c #341B74",
+"A 	c #8F3EE4",
+"B 	c #481E72",
+"C 	c #0A0255",
+"D 	c #2C108C",
+"E 	c #6C2DCC",
+"F 	c #7C34DC",
+"G 	c #0B1E0B",
+"H 	c #207220",
+"I 	c #070227",
+"J 	c #1C097C",
+"K 	c #3C179C",
+"L 	c #58268E",
+"M 	c #5C26BC",
+"N 	c #0B0260",
+"O 	c #183A58",
+"P 	c #195619",
+"Q 	c #0B320B",
+"R 	c #3B6450",
+"S 	c #7049B0",
+"T 	c #06021B",
+"U 	c #2FAA2F",
+"V 	c #36F136",
+"W 	c #19D619",
+"X 	c #0BB20B",
+"Y 	c #199319",
+"Z 	c #28A228",
+"` 	c #090249",
+" .	c #121012",
+"..	c #3B3A3B",
+"+.	c #414141",
+"@.	c #5EB15E",
+"#.	c #BCBEBC",
+"$.	c #6CE96C",
+"%.	c #36DA36",
+"&.	c #209B20",
+"*.	c #050210",
+"=.	c #646464",
+"-.	c #6A6A6A",
+";.	c #A1CCA1",
+">.	c #181718",
+",.	c #B0B1B0",
+"'.	c #939493",
+").	c #1C1747",
+"!.	c #1E1C1E",
+"~.	c #191719",
+"{.	c #26103B",
+"].	c #8B3BE0",
+"^.	c #692DA9",
+"/.	c #7F7F7F",
+"(.	c #7A7A7A",
+"_.	c #2D2C2D",
+":.	c #A8A9A8",
+"<.	c #040E10",
+"[.	c #042527",
+"}.	c #5E5D5E",
+"|.	c #565656",
+"1.	c #566161",
+"    . +     @ #                             $ $ %               ",
+"  & * @ = - ; + >                           $ $ , $ $ $         ",
+"  ; @ . = = ' # ) !                     $ $ ~ { $   % , $       ",
+"    ] * = = ' ^ / ( _                 $ : < ~ { < : $ $ $       ",
+"        = = = = [ ; }               $ < | | 1 $ 2 | : $ $ $     ",
+"        3 = = = 4 = 5 6             $ < | 2 $ $ | | 7 :   $     ",
+"        8 5 9 = = = ; =           $ $ < 7 : $ : | | | 2 $ 0 $   ",
+"        + - 9 = 9 . = ;           $ : 1 : $ $ : | | | | $ $ $   ",
+"        @ - = = 4 = = -           $ : 1 : $ $ < | | : < a $ $   ",
+"        b - = ; c 4 9 # d e $     $ $ < 7 : : 7 | | $ $ a $ $   ",
+"        f ; 9 - / g 9 . # f $ $ $ $ $ < 7 : $ 1 | 2 $ $ $ $ $   ",
+"    $ $ $ h # ; & i = = @ j $ $ $ $ $ < < $ $ $ | 2 $ 1 $ $ $   ",
+"  $ $ $ $ $ + # 3 9 3 3 9 @ k k k l $ 1 < $ $ $ m a $ 1   $     ",
+"  $ $ $ $ $ n # 3 9 - 8 + + o o o p $ $ < $ $ $ a a $ $ $ $     ",
+"$ $ $ $ q r r s t = - @ ( u o o o o p l $ v { { $ $ $ $ $ $     ",
+"$ $ $ $ r r r r w x x y z A o o o o o p B v { { $ $ $ $ $       ",
+"$ $ $ $ C r r r r r r r r r r r D E F o o o $ B G G H $         ",
+"$ $ $ $ I r r r r r r r r r r r r r J K o L H $ G G $ $         ",
+"$ $ $ $ k M r r r r r r r r r r r r N O P P P Q R S $ $         ",
+"$ $ $ $ k o s r r r r r r r r r r r T U V W W X Y Z $ $ $       ",
+"  $ $ $ k o o M r r r r r C ` `  ...+.@.#.$.%.Y &.U l k $       ",
+"  $ $ $ l p o o s r r q I *.$ $ ..=.#.#.-.;.P P , B p o $       ",
+"    $ $ $ B o o o M >.+.-.#.#.#. .=.,.#.#.#.'.).r s o o  .!.    ",
+"      $ $ $ L o o o +.#.#.#.#.#.=. .,.#.'.'.#.+.q r M o ~.~.e   ",
+"        $ $ {.].o o ^./.#.#.#.#.(.>._.:.#.#.#.#._.` r r B $  .  ",
+"        $ $ $ {.o o ^._.#.#.#.#.#.+.$ /.#.#.#.#./.T r r  . .    ",
+"            $ $ $ B $ $ _./.<.[.'.}._.$ |./.|.$ $ $ L o $       ",
+"              $ $ $ {.{._./.1.[.+.,./.$ _.$ $ B ^.^.o L $       ",
+"                  $ $ $ _.:.#.#.:./.$ $ k k o o o p B $         ",
+"                      $ $ /.'.+._.$ ^.^.o o o o k l             ",
+"                          $ $ $ $ $ $ $ $ $ $ $                 ",
+"                          $                                     "};
--- istanbul-0.2.2.orig/debian/watch
+++ istanbul-0.2.2/debian/watch
@@ -0,0 +1,8 @@
+version=3
+
+http://live.gnome.org/Istanbul \
+http://zaheer.merali.org/istanbul-(.*)\.tar\.bz2 \
+debian uupdate
+
+
+
--- istanbul-0.2.2.orig/debian/patches/desktop-entry.diff
+++ istanbul-0.2.2/debian/patches/desktop-entry.diff
@@ -0,0 +1,15 @@
+--- istanbul-0.2.2.orig/data/istanbul.desktop.in
++++ istanbul-0.2.2/data/istanbul.desktop.in
+@@ -1,5 +1,4 @@
+ [Desktop Entry]
+-Encoding=UTF-8
+ _Name=Istanbul Desktop Session Recorder
+ _GenericName=Desktop Session Recorder
+ _Comment=Record a video of your desktop session
+@@ -7,5 +6,5 @@
+ Terminal=false
+ Type=Application
+ Icon=istanbul.png
+-Categories=GNOME;Application;AudioVideo;
++Categories=GNOME;AudioVideo;
+ StartupNotify=false
--- istanbul-0.2.2.orig/debian/patches/ugly-configure.diff
+++ istanbul-0.2.2/debian/patches/ugly-configure.diff
@@ -0,0 +1,13 @@
+Index: istanbul-0.2.2/configure
+===================================================================
+--- istanbul-0.2.2.orig/configure	2007-08-08 22:54:20.000000000 +0200
++++ istanbul-0.2.2/configure	2007-08-08 22:54:36.000000000 +0200
+@@ -22509,7 +22509,7 @@
+ 
+ try:
+ 
+-    import egg.trayicon
++    import sys
+ 
+     sys.exit(0)
+ except ImportError:
--- istanbul-0.2.2.orig/debian/patches/fix_grab_xid.patch
+++ istanbul-0.2.2/debian/patches/fix_grab_xid.patch
@@ -0,0 +1,36 @@
+From: Jef Spaleta <jspaleta@gmail.com>
+Subject: Try to get the xid on realization of the videowidget
+Origin: upstream
+Bug: https://bugzilla.gnome.org/show_bug.cgi?id=604938
+Bug-Debian: http://bugs.debian.org/554568
+
+Index: istanbul-0.2.2/istanbul/main/save_window.py
+===================================================================
+--- istanbul-0.2.2.orig/istanbul/main/save_window.py	2010-07-08 10:38:56.609390459 +0200
++++ istanbul-0.2.2/istanbul/main/save_window.py	2010-07-08 10:38:53.153107943 +0200
+@@ -35,8 +35,13 @@
+     def __init__(self):
+         gtk.DrawingArea.__init__(self)
+         self.imagesink = None
++        self._xid = None
+         self.unset_flags(gtk.DOUBLE_BUFFERED)
+ 
++    def do_realize(self):
++        Gtk.DrawingArea.do_realize(self)
++        self._xid = self.window.xid
++
+     def do_expose_event(self, event):
+         if self.imagesink:
+             self.imagesink.expose()
+@@ -45,9 +50,9 @@
+             return True
+ 
+     def set_sink(self, sink):
+-        assert self.window.xid
++        assert self._xid is not None
+         self.imagesink = sink
+-        self.imagesink.set_xwindow_id(self.window.xid)
++        self.imagesink.set_xwindow_id(self._xid)
+ 
+ class SaveWindow(gtk.Window):
+     UPDATE_INTERVAL = 500
--- istanbul-0.2.2.orig/debian/patches/manpage.diff
+++ istanbul-0.2.2/debian/patches/manpage.diff
@@ -0,0 +1,77 @@
+Index: istanbul-0.2.2/doc/man/istanbul.1
+===================================================================
+--- istanbul-0.2.2.orig/doc/man/istanbul.1	2007-08-11 14:59:47.000000000 +0200
++++ istanbul-0.2.2/doc/man/istanbul.1	2007-08-11 15:01:04.000000000 +0200
+@@ -14,8 +14,9 @@
+ area: a click on the icon to start recording, another click to stop.
+ .PP
+ \fBistanbul\fP preferences can be configured with a right click on the icon.
++You can choose to record full screen, a selected windows or a particular area.
+ .TP
+-It can also stream to an Icecast2 server.
++It can also record audio from GStreamer default input.
+ .PP
+ By default it records to ~/desktop-recording.ogg
+ .SH OPTIONS
+@@ -29,55 +30,13 @@
+ .B \-\-version
+ Show version of program.
+ .TP
+-.B \-\-usage
+-Display brief usage message
++.B \-\-help\-all
++Print summary of all available options for istanbul.
+ .TP
+-Istanbul accepts also GStreamer options.
+-A summary of them is included below.
+-.TP
+-.B \-\-gst\-version
+-Print the GStreamer version
+-.TP
+-.B \-\-gst\-fatal\-warnings
+-Make all warnings fatal
+-.TP
+-.B \-\-gst\-debug\-help
+-Print available debug categories and exit
+-.TP
+-.B \-\-gst\-debug\-level=LEVEL
+-Default debug level from 1 (only error) to 5 (anything) or 0 for no output
+-.TP
+-.B \-\-gst\-debug=LIST
+-Comma-separated list of category_name:level pairs to set specific levels for the individual categories
+-.TP
+-.B \-\-gst\-debug\-no\-color
+-Disable colored debugging output
+-.TP
+-.B \-\-gst\-debug\-disable
+-Disable debugging
+-.TP
+-.B \-\-gst\-disable\-cpu\-opt
+-Disable accelerated CPU instructions
+-.TP
+-.B \-\-gst\-plugin\-spew
+-Enable verbose plugin loading diagnostics
+-.TP
+-.B \-\-gst\-plugin\-path=PATHS
+-path list for loading plugins (separated by ':')
+-.TP
+-.B \-\-gst\-plugin\-load=PLUGINS 
+-Comma-separated list of plugins to preload in addition to the list stored in environment variable GST_PLUGIN_PATH
+-.TP
+-.B \-\-gst\-disable\-segtrap
+-Disable trapping of segmentation faults during plugin loading
+-.TP
+-.B \-\-gst\-scheduler=SCHEDULER
+-Scheduler to use (default is 'opt')
+-.TP
+-.B \-\-gst\-registry=REGISTRY
+-Registry to use
+-.SH AUTHOR
+-Istanbul was written by  Zaheer Abbas Merali <zaheerabbas@merali.org>.
++.B \-\-help\-gst
++Print summary of available options for the gstreamer framework.
++.SH AUTHORS
++Istanbul was written by Zaheer Abbas Merali <zaheerabbas@merali.org>.
+ .PP
+ This manual page was written by Luca Bruno <luca.br@uno.it>,
+ for the Debian project (but may be used by others).
--- istanbul-0.2.2.orig/debian/patches/window-record.diff
+++ istanbul-0.2.2/debian/patches/window-record.diff
@@ -0,0 +1,11 @@
+--- istanbul-0.2.2.orig/istanbul/main/window_select.py
++++ istanbul-0.2.2/istanbul/main/window_select.py
+@@ -85,7 +85,7 @@
+                 return child
+ 
+         for child in children:
+-            result = self._get_client_window_check_children(window)
++            result = self._get_client_window_check_children(child)
+             if result != None:
+                 return result
+ 
--- istanbul-0.2.2.orig/debian/patches/kfreebsd-noalsa.diff
+++ istanbul-0.2.2/debian/patches/kfreebsd-noalsa.diff
@@ -0,0 +1,13 @@
+Index: istanbul-0.2.2/istanbul/main/screencast.py
+===================================================================
+--- istanbul-0.2.2.orig/istanbul/main/screencast.py	2010-08-17 11:38:02.898762661 +0200
++++ istanbul-0.2.2/istanbul/main/screencast.py	2010-08-17 11:38:51.154511463 +0200
+@@ -95,7 +95,7 @@
+             if Preferences().has_gconf():
+                 asource = 'gconfaudiosrc name=audiosource'
+             else:
+-                asource = 'alsasrc name=audiosource'
++                asource = 'autoaudiosrc name=audiosource'
+             acappipeline = '%s ! audioconvert ! vorbisenc' % asource
+ 
+         vencode_pipeline = 'video/x-raw-yuv,width=%d,height=%d,framerate=%s '\
--- istanbul-0.2.2.orig/debian/patches/audio_eos.diff
+++ istanbul-0.2.2/debian/patches/audio_eos.diff
@@ -0,0 +1,19 @@
+From: Florian Boucault <florian@boucault.net>
+Subject: Patch fixing audio recording 
+Origin: upstream
+Bug: https://bugzilla.gnome.org/show_bug.cgi?id=430151 
+Bug-Debian: http://bugs.debian.org/486660
+
+Index: istanbul-0.2.2.orig/istanbul/main/screencast.py
+===================================================================
+--- istanbul-0.2.2.orig/istanbul/main/screencast.py	(révision 131)
++++ istanbul-0.2.2.orig/istanbul/main/screencast.py	(copie de travail)
+@@ -135,7 +135,7 @@
+             m.run()
+             m.destroy()
+             self.finished_callback(message)
+-        elif message.type == gst.MESSAGE_EOS:
++        elif message.type == gst.MESSAGE_EOS or message.type == gst.MESSAGE_CLOCK_LOST:
+             self._pipeline.set_state(gst.STATE_NULL)
+             self.on_eos()
+ 
--- istanbul-0.2.2.orig/debian/patches/eggtrayicon-removal.diff
+++ istanbul-0.2.2/debian/patches/eggtrayicon-removal.diff
@@ -0,0 +1,91 @@
+Index: istanbul-0.2.2/istanbul/main/tray_icon.py
+===================================================================
+--- istanbul-0.2.2.orig/istanbul/main/tray_icon.py	2009-12-30 11:50:39.000000000 +0100
++++ istanbul-0.2.2/istanbul/main/tray_icon.py	2009-12-30 11:50:47.000000000 +0100
+@@ -23,7 +23,6 @@
+ from istanbul.main.preferences import Preferences
+ 
+ import gtk
+-import egg.trayicon
+ 
+ import locale, gettext
+ _ = gettext.gettext
+@@ -33,20 +32,13 @@
+     state = RecordingState.STOPPED
+     current_screencast = None
+     popup_menu = TrayPopupMenu()
+-    event_box = Screen().event_box
++    tray_image = gtk.StatusIcon()
+ 
+     def __init__(self):
+-        gtk.window_set_default_icon_name(gtk.STOCK_MEDIA_RECORD)
+-        self.tray_image = gtk.Image()
+-        self.tray_image.set_from_stock(gtk.STOCK_MEDIA_RECORD, gtk.ICON_SIZE_SMALL_TOOLBAR)
+-        self.event_box.add(self.tray_image)
+-        self.tooltips = gtk.Tooltips()
+-        self.tooltips.set_tip(self.event_box,
+-            _("Left click to start screencast.  Right click for menu."))
+-        self.tray_container = egg.trayicon.TrayIcon("istanbul")
+-        self.tray_container.add(self.event_box)
+-        self.event_box.connect("button-press-event", self._trayicon_clicked)
+-        self.tray_container.show_all()
++        self.tray_image.set_from_stock(gtk.STOCK_MEDIA_RECORD)
++        self.tray_image.set_tooltip(_("Left click to start screencast.  Right click for menu."))
++        self.tray_image.connect("button-press-event", self._trayicon_clicked)
++        self.tray_image.set_visible(True)
+ 
+     def _trayicon_clicked(self, widget, event):
+         """
+@@ -55,21 +47,17 @@
+         """
+         if event.button == 1:
+             if self.state == RecordingState.STOPPED:
+-                self.tray_image.set_from_stock(gtk.STOCK_MEDIA_STOP, 
+-                    gtk.ICON_SIZE_SMALL_TOOLBAR)
+-                self.tooltips.set_tip(self.event_box,
+-                    _("Left click to stop recording screencast."))
++                self.tray_image.set_from_stock(gtk.STOCK_MEDIA_STOP)
++                self.tray_image.set_tooltip(_("Left click to stop recording screencast."))
+                 self.state = RecordingState.RECORDING
+                 self.current_screencast = Screencast(self.stop_handler)
+                 self.current_screencast.selector = self.popup_menu.selector
+                 self.current_screencast.start_recording()
+ 
+             elif self.state == RecordingState.RECORDING:
+-                self.tray_image.set_from_stock(gtk.STOCK_HARDDISK,
+-                    gtk.ICON_SIZE_SMALL_TOOLBAR)
++                self.tray_image.set_from_stock(gtk.STOCK_HARDDISK)
+                 self.state = RecordingState.SAVING
+-                self.tooltips.set_tip(self.event_box,
+-                    _("In process of saving to disk."))
++                self.tray_image.set_tooltip(_("In process of saving to disk."))
+                 self.current_screencast.stop_recording()
+                
+         # only show popup if in idle state                    
+@@ -77,11 +65,8 @@
+             self.popup_menu.show()
+     
+     def stop_handler(self, event):
+-        self.tray_image.set_from_stock(gtk.STOCK_MEDIA_RECORD, 
+-            gtk.ICON_SIZE_SMALL_TOOLBAR)
++        self.tray_image.set_from_stock(gtk.STOCK_MEDIA_RECORD)
+         self.state = RecordingState.STOPPED
+-        self.tooltips.set_tip(self.event_box,
+-            _("Left click to start screencast.  Right click for menu."))
++        self.tray_image.set_tooltip(_("Left click to start screencast.  Right click for menu."))
+         return False
+ 
+-
+Index: istanbul-0.2.2/istanbul/main/main.py
+===================================================================
+--- istanbul-0.2.2.orig/istanbul/main/main.py	2009-12-30 11:51:23.000000000 +0100
++++ istanbul-0.2.2/istanbul/main/main.py	2009-12-30 11:51:33.000000000 +0100
+@@ -49,8 +49,6 @@
+ 
+ import gst
+ 
+-import egg.trayicon
+-
+ _ = gettext.gettext
+ 
+ class Istanbul:
--- istanbul-0.2.2.orig/debian/patches/fix_preview_window.patch
+++ istanbul-0.2.2/debian/patches/fix_preview_window.patch
@@ -0,0 +1,23 @@
+From: Jef Spaleta <jspaleta@gmail.com>
+Subject: Additional patch to fix preview video widget in save_window.py
+Origin: upstream
+Bug: https://bugzilla.gnome.org/show_bug.cgi?id=604938
+Bug-Debian: http://bugs.debian.org/554568
+
+Index: istanbul-0.2.2/istanbul/main/save_window.py
+===================================================================
+--- istanbul-0.2.2.orig/istanbul/main/save_window.py	2010-07-08 10:39:51.433390429 +0200
++++ istanbul-0.2.2/istanbul/main/save_window.py	2010-07-08 10:39:49.184894943 +0200
+@@ -143,8 +143,11 @@
+             yoptions=0)
+         table.set_row_spacing(0,6)
+         table.set_row_spacing(1,6)
++        def init_videowidget( widget):
++            widget._xid = widget.window.xid
++            self.player.pause()
+         self.videowidget.connect_after('realize',
+-                                       lambda *x: self.player.pause() )
++            init_videowidget )
+         self.videowidget.set_size_request(width, height)
+ 
+         # create save, edit, cancel buttons
--- istanbul-0.2.2.orig/debian/patches/dir-overwrite.diff
+++ istanbul-0.2.2/debian/patches/dir-overwrite.diff
@@ -0,0 +1,27 @@
+Index: istanbul-0.2.2/istanbul/main/save_window.py
+===================================================================
+--- istanbul-0.2.2.orig/istanbul/main/save_window.py	2010-08-17 11:45:43.178263468 +0200
++++ istanbul-0.2.2/istanbul/main/save_window.py	2010-08-17 11:46:54.030511524 +0200
+@@ -265,7 +265,7 @@
+             try:
+                 trysave = gnomevfs.xfer_uri(gnomevfs.URI("file://%s" % self.location), 
+                     gnomevfs.URI(self.filechooser.get_uri()), 
+-                    gnomevfs.XFER_DELETE_ITEMS,
++                    gnomevfs.XFER_REMOVESOURCE,
+                     gnomevfs.XFER_ERROR_MODE_ABORT | XFER_TARGET_DEFAULT_PERMS, 
+                     gnomevfs.XFER_OVERWRITE_MODE_ABORT)
+             except gnomevfs.FileExistsError:
+@@ -281,10 +281,12 @@
+                 dialog.hide()
+                 if res == gtk.RESPONSE_YES:
+                     try:
++                        if os.path.isdir(self.filechooser.get_uri()[7:]):
++                            raise Exception()
+                         trysave = gnomevfs.xfer_uri(
+                         gnomevfs.URI("file://%s" % self.location), 
+                         gnomevfs.URI(self.filechooser.get_uri()), 
+-                        gnomevfs.XFER_DELETE_ITEMS,
++                        gnomevfs.XFER_REMOVESOURCE,
+                         gnomevfs.XFER_ERROR_MODE_ABORT | XFER_TARGET_DEFAULT_PERMS, 
+                         gnomevfs.XFER_OVERWRITE_MODE_REPLACE)
+                     except Exception:
--- istanbul-0.2.2.orig/debian/patches/honour-umask.diff
+++ istanbul-0.2.2/debian/patches/honour-umask.diff
@@ -0,0 +1,38 @@
+Index: istanbul-0.2.2/istanbul/main/save_window.py
+===================================================================
+--- istanbul-0.2.2.orig/istanbul/main/save_window.py	2007-08-11 15:53:00.000000000 +0200
++++ istanbul-0.2.2/istanbul/main/save_window.py	2007-08-11 16:58:11.000000000 +0200
+@@ -253,11 +253,12 @@
+ 
+         if Preferences().has_gnomevfs():
+             import gnomevfs
++            XFER_TARGET_DEFAULT_PERMS = 1 << 12
+             try:
+                 trysave = gnomevfs.xfer_uri(gnomevfs.URI("file://%s" % self.location), 
+                     gnomevfs.URI(self.filechooser.get_uri()), 
+                     gnomevfs.XFER_DELETE_ITEMS,
+-                    gnomevfs.XFER_ERROR_MODE_ABORT, 
++                    gnomevfs.XFER_ERROR_MODE_ABORT | XFER_TARGET_DEFAULT_PERMS, 
+                     gnomevfs.XFER_OVERWRITE_MODE_ABORT)
+             except gnomevfs.FileExistsError:
+                 dialog = gtk.MessageDialog(self,
+@@ -276,7 +277,7 @@
+                         gnomevfs.URI("file://%s" % self.location), 
+                         gnomevfs.URI(self.filechooser.get_uri()), 
+                         gnomevfs.XFER_DELETE_ITEMS,
+-                        gnomevfs.XFER_ERROR_MODE_ABORT, 
++                        gnomevfs.XFER_ERROR_MODE_ABORT | XFER_TARGET_DEFAULT_PERMS, 
+                         gnomevfs.XFER_OVERWRITE_MODE_REPLACE)
+                     except Exception:
+                         dialog = gtk.MessageDialog(self,
+@@ -299,7 +300,10 @@
+             import shutil
+ 
+             try:
++                umask = os.umask(0)
++                empty_umask = os.umask(umask)
+                 shutil.move(self.location, self.filechooser.get_uri()[7:])
++                os.chmod(self.filechooser.get_uri()[7:], 0777-umask)
+             except Exception:
+                 dialog = gtk.MessageDialog(self,
+                     gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
--- istanbul-0.2.2.orig/debian/patches/series
+++ istanbul-0.2.2/debian/patches/series
@@ -0,0 +1,12 @@
+ugly-configure.diff
+audio_eos.diff
+python-import.diff
+window-record.diff
+manpage.diff
+desktop-entry.diff
+honour-umask.diff
+eggtrayicon-removal.diff
+fix_grab_xid.patch
+fix_preview_window.patch
+dir-overwrite.diff
+kfreebsd-noalsa.diff
--- istanbul-0.2.2.orig/debian/patches/python-import.diff
+++ istanbul-0.2.2/debian/patches/python-import.diff
@@ -0,0 +1,18 @@
+--- istanbul-0.2.2.orig/bin/istanbul.in
++++ istanbul-0.2.2/bin/istanbul.in
+@@ -18,15 +18,9 @@
+ import os
+ import sys
+ 
+-if not '@PYGTK_DIR@' in sys.path:
+-    sys.path.insert(0, '@PYGTK_DIR@')
+-
+ import pygtk
+ pygtk.require('2.0')
+ 
+-if not '@PYTHONDIR@' in sys.path:
+-    sys.path.insert(0, '@PYTHONDIR@')
+-
+ from istanbul.main import main
+ from istanbul.configure import config
+ 
