Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 katarakt (0.1-3~bpo8+1) jessie-backports; urgency=medium
 .
   * Rebuild for jessie-backports.
Author: Christoph Egger <christoph@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

Index: katarakt/src/resourcemanager.cpp
===================================================================
--- katarakt.orig/src/resourcemanager.cpp
+++ katarakt/src/resourcemanager.cpp
@@ -4,7 +4,7 @@
 #include <unistd.h>
 #include <QSocketNotifier>
 #include <QFileInfo>
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD_kernel__)
 #include <sys/inotify.h>
 #endif
 #include "resourcemanager.h"
@@ -27,7 +27,7 @@ ResourceManager::ResourceManager(const Q
 		doc(NULL),
 		center_page(0),
 		rotation(0),
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD_kernel__)
 		i_notifier(NULL),
 #endif
 		inverted_colors(false),
@@ -58,7 +58,7 @@ void ResourceManager::initialize(const Q
 	worker->start();
 
 	// setup inotify
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD_kernel__)
 	QFileInfo info(file);
 	inotify_fd = inotify_init();
 	if (inotify_fd == -1) {
@@ -142,7 +142,7 @@ void ResourceManager::shutdown() {
 	garbageMutex.unlock();
 	requests.clear();
 	requestSemaphore.acquire(requestSemaphore.available());
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD_kernel__)
 	::close(inotify_fd);
 	delete i_notifier;
 	i_notifier = NULL;
@@ -345,7 +345,7 @@ Poppler::LinkDestination *ResourceManage
 }
 
 void ResourceManager::inotify_slot() {
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD_kernel__)
 	i_notifier->setEnabled(false);
 
 	size_t event_size = sizeof(struct inotify_event) + NAME_MAX + 1;
--- katarakt-0.1.orig/src/resourcemanager.h
+++ katarakt-0.1/src/resourcemanager.h
@@ -101,7 +101,7 @@ private:
 	int page_count;
 	int rotation;
 
-#ifdef __linux__
+#if defined(__linux__) || defined(__FreeBSD_kernel__)
 	int inotify_fd;
 	int inotify_wd;
 	QSocketNotifier *i_notifier;
--- katarakt-0.1.orig/katarakt.pro
+++ katarakt-0.1/katarakt.pro
@@ -22,7 +22,7 @@ SOURCES +=  src/main.cpp \
             src/viewer.cpp src/canvas.cpp src/resourcemanager.cpp src/grid.cpp src/search.cpp src/gotoline.cpp src/config.cpp \
             src/download.cpp src/util.cpp src/kpage.cpp src/worker.cpp src/beamerwindow.cpp src/toc.cpp src/splitter.cpp \
             src/selection.cpp src/dbus/source_correlate.cpp src/dbus/dbus.cpp
-unix:LIBS += -lpoppler-qt4
+unix:LIBS += -lpoppler-qt4 -linotify
 
 documentation.target = doc/katarakt.1
 documentation.depends = doc/katarakt.txt
