diff -u cegui-mk2-0.6.2/debian/control cegui-mk2-0.6.2/debian/control
--- cegui-mk2-0.6.2/debian/control
+++ cegui-mk2-0.6.2/debian/control
@@ -2,7 +2,7 @@
 Section: libs
 Priority: optional
 Maintainer: Muammar El Khatib <muammarelkhatib@gmail.com>
-Build-Depends: debhelper (>= 6), cdbs, dbs, libtool, automake1.9, autoconf, pkg-config, libxerces-c2-dev, libboost-signals-dev, libboost-regex-dev, libfreetype6-dev, liblcms1-dev, libtiff4-dev, libgl1-mesa-dev, libglu1-mesa-dev, libdevil-dev, libpcre3-dev, dpatch, liblua5.1-dev, lua5.1, libois-dev, libfreeimage-dev
+Build-Depends: debhelper (>= 6), cdbs, dbs, libtool, automake1.9, autoconf, pkg-config, libxerces-c2-dev, libboost-signals-dev, libboost-regex-dev, libfreetype6-dev, liblcms1-dev, libtiff4-dev, libgl1-mesa-dev, libglu1-mesa-dev, libdevil-dev, libpcre3-dev, dpatch, liblua5.1-dev, lua5.1, libois-dev [ linux-any ] , libfreeimage-dev
 Standards-Version: 3.8.4
 Homepage: http://www.cegui.org.uk/
 
diff -u cegui-mk2-0.6.2/debian/changelog cegui-mk2-0.6.2/debian/changelog
--- cegui-mk2-0.6.2/debian/changelog
+++ cegui-mk2-0.6.2/debian/changelog
@@ -1,3 +1,11 @@
+cegui-mk2 (0.6.2-4.1) unstable; urgency=low
+
+  * Fix the build on kFreeBSD
+    - 01_cegui-mk2_kfreebsd.dpatch
+    - do not build-depend on libois-dev on kFreeBSD
+
+ -- Gonéri Le Bouder <goneri@rulezlan.org>  Sat, 14 Aug 2010 07:11:34 +0200
+
 cegui-mk2 (0.6.2-4) unstable; urgency=low
 
   * Bump Standards-Version to 3.8.4. No changes were needed. 
diff -u cegui-mk2-0.6.2/debian/patches/01_cegui-mk2_kfreebsd.dpatch cegui-mk2-0.6.2/debian/patches/01_cegui-mk2_kfreebsd.dpatch
--- cegui-mk2-0.6.2/debian/patches/01_cegui-mk2_kfreebsd.dpatch
+++ cegui-mk2-0.6.2/debian/patches/01_cegui-mk2_kfreebsd.dpatch
@@ -6,9 +6,82 @@
 
 @DPATCH@
 
---- cegui-mk2-0.6.1/build-tree/cegui_mk2/src/CEGUIDynamicModule.cpp	2008-08-18 20:22:13.000000000 -0300
-+++ CEGUIDynamicModule.cpp	2008-08-19 14:34:35.000000000 -0300
-@@ -64,7 +64,7 @@
+--- cegui-mk2-0.5.0/build-tree/cegui_mk2/Samples/common/src/CEGuiIrrlichtBaseApplication.cpp
++++ cegui-mk2-0.5.0/build-tree/cegui_mk2/Samples/common/src/CEGuiIrrlichtBaseApplication.cpp
+@@ -29,7 +29,7 @@
+ #   include "config.h"
+ #endif
+ 
+-#ifdef __linux__
++#if defined(__linux__) || defined(__FreeBSD_kernel__) 
+ # include <unistd.h>
+ #endif
+ 
+--- cegui-mk2-0.5.0/build-tree/cegui_mk2/Samples/common/src/CEGuiOgreBaseApplication.cpp
++++ cegui-mk2-0.5.0/build-tree/cegui_mk2/Samples/common/src/CEGuiOgreBaseApplication.cpp
+@@ -29,7 +29,7 @@
+ #   include "config.h"
+ #endif
+ 
+-#ifdef __linux__
++#if defined(__linux__) || defined(__FreeBSD_kernel__)
+ # include <unistd.h>
+ #endif
+ 
+--- cegui-mk2-0.5.0/build-tree/cegui_mk2/Samples/common/src/CEGuiOpenGLBaseApplication.cpp
++++ cegui-mk2-0.5.0/build-tree/cegui_mk2/Samples/common/src/CEGuiOpenGLBaseApplication.cpp
+@@ -29,7 +29,7 @@
+ #   include "config.h"
+ #endif
+ 
+-#ifdef __linux__
++#if defined(__linux__) || defined(__FreeBSD_kernel__)
+ # include <unistd.h>
+ #endif
+ 
+--- cegui-mk2-0.5.0/build-tree/cegui_mk2/Samples/common/src/CEGuiSample.cpp
++++ cegui-mk2-0.5.0/build-tree/cegui_mk2/Samples/common/src/CEGuiSample.cpp
+@@ -35,7 +35,7 @@
+ // includes for renderer selector classes
+ #if defined( __WIN32__ ) || defined( _WIN32 )
+ #   include "Win32CEGuiRendererSelector.h"
+-#elif defined(__linux__)
++#elif defined(__linux__) || defined(__FreeBSD_kernel__)
+ #   ifdef CEGUI_SAMPLES_USE_GTK2
+ #       include "GTK2CEGuiRendererSelector.h"
+ #   else
+@@ -162,7 +162,7 @@ bool CEGuiSample::initialise()
+     d_rendererSelector->setRendererAvailability(Direct3D10GuiRendererType);
+ #endif
+ 
+-#elif defined(__linux__)
++#elif defined(__linux__) || defined(__FreeBSD_kernel__) 
+     // decide which method to use for renderer selection
+ #   ifdef CEGUI_SAMPLES_USE_GTK2
+         d_rendererSelector = new GTK2CEGuiRendererSelector();
+--- cegui-mk2-0.5.0/build-tree/cegui_mk2/include/CEGUIDynamicModule.h
++++ cegui-mk2-0.5.0/build-tree/cegui_mk2/include/CEGUIDynamicModule.h
+@@ -42,7 +42,7 @@
+     struct HINSTANCE__;
+     typedef struct HINSTANCE__* hInstance;
+ 
+-#elif defined(__linux__)
++#elif defined(__linux__) || defined(__FreeBSD_kernel__)
+ #    define DYNLIB_HANDLE void*
+ #    define DYNLIB_LOAD( a ) dlopen( a, RTLD_LAZY )
+ #    define DYNLIB_GETSYM( a, b ) dlsym( a, b )
+--- cegui-mk2-0.5.0/build-tree/cegui_mk2/src/CEGUIDynamicModule.cpp
++++ cegui-mk2-0.5.0/build-tree/cegui_mk2/src/CEGUIDynamicModule.cpp
+@@ -46,7 +46,7 @@
+ #   include "macPlugins.h"
+ #endif
+ 
+-#if defined(__linux__)
++#if defined(__linux__) || defined(__FreeBSD_kernel__)
+ #   include "dlfcn.h"
+ #endif
+ 
+@@ -64,7 +64,7 @@ DynamicModule::DynamicModule(const String& name) :
  		return;
  	} // if(name.empty())
  
@@ -19,0 +93,33 @@
+@@ -80,7 +80,7 @@ DynamicModule::DynamicModule(const String& name) :
+ 
+     d_handle = DYNLIB_LOAD(d_moduleName.c_str());
+ 
+-#if defined(__linux__) || defined(__MINGW32__)
++#if defined(__linux__) || defined(__MINGW32__) || defined(__FreeBSD_kernel__)
+     if (!d_handle)
+     {
+         // see if we need to add the leading 'lib'
+@@ -121,7 +121,8 @@ void* DynamicModule::getSymbolAddress(const String& symbol) const
+ String DynamicModule::getFailureString() const
+ {
+     String retMsg;
+-#if defined(__linux__) || defined (__APPLE_CC__)
++#if defined(__linux__) || defined (__APPLE_CC__) || defined(__FreeBSD_kernel__)
++
+     retMsg = DYNLIB_ERROR();
+ #elif defined(__WIN32__) || defined(_WIN32)
+     LPVOID msgBuffer;
+--- cegui-mk2-0.5.0/build-tree/cegui_mk2/src/CEGUISystem.cpp
++++ cegui-mk2-0.5.0/build-tree/cegui_mk2/src/CEGUISystem.cpp
+@@ -100,7 +100,7 @@ double SimpleTimer::currentTime()
+     return timeGetTime() / 1000.0;
+ }
+ 
+-#elif defined(__linux__) || defined(__APPLE__)
++#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD_kernel__)
+ #include <sys/time.h>
+ double SimpleTimer::currentTime()
+ {
+-- 
+1.7.1
+
