--- incron-0.5.7.orig/debian/dirs
+++ incron-0.5.7/debian/dirs
@@ -0,0 +1,4 @@
+etc/incron.d
+usr/bin
+usr/sbin
+var/spool/incron
--- incron-0.5.7.orig/debian/docs
+++ incron-0.5.7/debian/docs
@@ -0,0 +1,2 @@
+README
+TODO
--- incron-0.5.7.orig/debian/control
+++ incron-0.5.7/debian/control
@@ -0,0 +1,33 @@
+Source: incron
+Section: admin
+Priority: extra
+Maintainer: Emmanuel Bouthenot <kolter@openics.org>
+Uploaders: Michael Prokop <mika@grml.org>
+Build-Depends: debhelper (>= 5), quilt (>= 0.40)
+Standards-Version: 3.7.2
+
+Package: incron
+Architecture: any
+Depends: ${shlibs:Depends}, lsb-base (>= 3.0-3), adduser
+Description: cron-like daemon which handles filesystem events
+ incron is an "inotify cron" system. It works like the regular cron but is
+ driven by filesystem events instead of time events. This package provides two
+ programs, a daemon called "incrond" (analogous to crond) and a table
+ manipulator "incrontab" (like "crontab").
+ .
+ incron uses the Linux Kernel inotify syscalls.
+ .
+ like cron, each user can edit its own incron tables.
+ .
+ incron can be used to :
+  - notifying programs (e.g. server daemons) about changes in configuration
+  - guarding changes in critical files (with their eventual recovery)
+  - file usage monitoring, statistics
+  - automatic on-crash cleanup
+  - automatic on-change backup or versioning
+  - new mail notification (for maildir)
+  - server upload notification
+  - installation management (outside packaging systems)
+  - ... and many others
+ .
+  HomePage: http://inotify.aiken.cz/
--- incron-0.5.7.orig/debian/rules
+++ incron-0.5.7/debian/rules
@@ -0,0 +1,61 @@
+#!/usr/bin/make -f
+
+include /usr/share/quilt/quilt.make
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+PACKAGE=incron
+
+configure: patch configure-stamp
+configure-stamp:
+	dh_testdir
+	touch configure-stamp
+
+build: configure build-stamp
+build-stamp:
+	dh_testdir
+	$(MAKE)
+	touch $@
+
+clean: clean-patched unpatch
+clean-patched:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	[ ! -f Makefile ] || $(MAKE) distclean
+	dh_clean 
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k 
+	dh_installdirs
+
+	install -m 755 incrontab $(CURDIR)/debian/$(PACKAGE)/usr/bin/
+	install -m 755 incrond $(CURDIR)/debian/$(PACKAGE)/usr/sbin/
+	install -m 644 incron.conf.example $(CURDIR)/debian/$(PACKAGE)/etc/incron.conf
+	touch $(CURDIR)/debian/$(PACKAGE)/etc/incron.allow
+	touch $(CURDIR)/debian/$(PACKAGE)/etc/incron.deny
+
+binary-indep: build install
+
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs CHANGELOG
+	dh_installdocs
+	dh_installexamples
+	dh_installinit
+	dh_installman
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
--- incron-0.5.7.orig/debian/watch
+++ incron-0.5.7/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://www.aiken.cz/download/util/incron/incron-([.0-9]*)\.tar\.gz
--- incron-0.5.7.orig/debian/changelog
+++ incron-0.5.7/debian/changelog
@@ -0,0 +1,32 @@
+incron (0.5.7-1~bpo40+1) etch-backports; urgency=low
+
+  * Rebuilt for etch.
+  * Forward-port correct_inotify_syscalls patch from 0.5.6 because etch does
+    not have sys/inotify.h.
+
+ -- martin f. krafft <madduck@debian.org>  Sun, 23 Sep 2007 15:30:27 +0200
+
+incron (0.5.7-1) unstable; urgency=low
+
+  * New upstream release (Closes: #418851)
+  * Switch from dpatch to quilt
+  * Remove patch related to inotify syscalls (not needed since
+    libc6 >= 2.6.x)
+  * Add patch to fix FTBFS with GCC 4.3 (Closes: #419269)
+  * Fix lintian warning on "make clean"
+
+ -- Emmanuel Bouthenot <kolter@openics.org>  Fri, 07 Sep 2007 13:17:48 +0200
+
+incron (0.5.5-2) unstable; urgency=low
+
+  * missing dependency on adduser (Closes: #431510)
+
+ -- Emmanuel Bouthenot <kolter@openics.org>  Tue, 03 Jul 2007 12:44:21 +0200
+
+incron (0.5.5-1) unstable; urgency=low
+
+  * Initial release (Closes: #409173)
+
+ -- Emmanuel Bouthenot <kolter@openics.org>  Sat, 17 Feb 2007 11:03:57 +0100
+
+
--- incron-0.5.7.orig/debian/postinst
+++ incron-0.5.7/debian/postinst
@@ -0,0 +1,33 @@
+#!/bin/sh
+# postinst script for incron
+
+set -e
+
+case "$1" in
+    configure|reconfigure)
+	
+        # add group for incrontabs
+	getent group incron > /dev/null 2>&1 || addgroup --system incron
+
+	if ! dpkg-statoverride --list /usr/bin/incrontab > /dev/null ; then
+	    dpkg-statoverride --update --add root incron 2755 /usr/bin/incrontab
+	fi
+
+	if ! dpkg-statoverride --list /var/spool/incron > /dev/null ; then
+	    dpkg-statoverride --update --add root incron 1731 /var/spool/incron
+	fi
+
+	for f in /etc/incron.allow /etc/incron.deny ; do    
+	    if ! dpkg-statoverride --list $f > /dev/null ; then
+		dpkg-statoverride --update --add root incron 640 $f
+	    fi
+	done
+	
+	;;
+    *)
+	;;
+esac
+
+#DEBHELPER#
+
+exit 0
--- incron-0.5.7.orig/debian/manpages
+++ incron-0.5.7/debian/manpages
@@ -0,0 +1,4 @@
+incrontab.1
+incrontab.5
+incrond.8
+incron.conf.5
--- incron-0.5.7.orig/debian/compat
+++ incron-0.5.7/debian/compat
@@ -0,0 +1 @@
+5
--- incron-0.5.7.orig/debian/init.d
+++ incron-0.5.7/debian/init.d
@@ -0,0 +1,64 @@
+#! /bin/sh
+#
+# incron       This init.d script is used to start incron
+#
+
+### BEGIN INIT INFO
+# Provides:          incron
+# Required-Start:    $local_fs $syslog
+# Required-Stop:     $local_fs $syslog
+# Should-Start:
+# Should-Stop:
+# Default-Start:     S 2 3 4 5
+# Default-Stop:      0 6
+# Short-Description: File system events scheduler
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+INCROND=/usr/sbin/incrond
+NAME=incron
+DESC="File system events scheduler"
+INCROND_PID=/var/run/incrond.pid
+INCROND_CONF=/etc/incron.conf
+
+[ -x $INCROND ] || exit 0
+
+# loading lsb functions
+. /lib/lsb/init-functions
+
+case "$1" in
+    start)
+        log_daemon_msg "Starting $DESC"
+        log_progress_msg "$NAME"
+        start_daemon -p $INCROND_PID $INCROND -f $INCROND_CONF
+        log_end_msg "$?"
+        ;;
+
+    stop)
+        log_daemon_msg "Stopping $DESC"
+        log_progress_msg "$NAME"
+        killproc -p $INCROND_PID $INCROND
+        log_end_msg "$?"
+        ;;
+
+    reload)
+        log_daemon_msg "Reloading $DESC"
+        log_progress_msg "$NAME"
+        echo -n
+        log_end_msg "$?"
+        ;;
+
+    restart|force-reload)
+        $0 stop
+        sleep 1
+        $0 start
+        ;;
+
+    *)
+        N=/etc/init.d/$NAME
+        echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
+        exit 1
+        ;;
+esac
+
+exit 0
--- incron-0.5.7.orig/debian/README.Debian
+++ incron-0.5.7/debian/README.Debian
@@ -0,0 +1,14 @@
+incron for Debian
+-----------------
+
+ By default users are not allowed to use incron. To allow or deny some users,
+ take a look at the informations related to /etc/incron.allow and
+ /etc/incron.deny in incrond(8) manpage.
+
+ Users are not allowed to use incron by default because a bad usage of incron
+ with (loops) can make the whole system hanging. See BUGS section in incrond(8)
+ manpage. Be carefull with users allowed to use incron.
+
+ Systems incrontabs goes to /etc/incron.d .
+
+ -- Emmanuel Bouthenot <kolter@openics.org>, Tue, 13 Feb 2007 11:12:57 +0100
--- incron-0.5.7.orig/debian/postrm
+++ incron-0.5.7/debian/postrm
@@ -0,0 +1,27 @@
+#!/bin/sh
+# postrm script for incron
+
+set -e
+
+case "$1" in
+
+    remove)	
+	if dpkg-statoverride --list /usr/bin/incrontab > /dev/null ; then
+	    dpkg-statoverride --remove /usr/bin/incrontab
+	fi	
+	;;
+    purge)
+	for f in /etc/incron.allow /etc/incron.deny /var/spool/incron ; do
+	    if dpkg-statoverride --list $f > /dev/null ; then
+		dpkg-statoverride --remove $f
+	    fi
+	done
+	
+	;;
+    *)
+	;;    
+esac
+
+#DEBHELPER#
+
+exit 0
--- incron-0.5.7.orig/debian/patches/01_gcc_43_fix
+++ incron-0.5.7/debian/patches/01_gcc_43_fix
@@ -0,0 +1,51 @@
+--- a/appargs.cpp
++++ b/appargs.cpp
+@@ -19,6 +19,7 @@
+  * 
+  */
+ 
++#include <string.h>
+ 
+ #include "strtok.h"
+ 
+--- a/icd-main.cpp
++++ b/icd-main.cpp
+@@ -23,6 +23,7 @@
+ #include <errno.h>
+ #include <sys/poll.h>
+ #include <sys/stat.h>
++#include <string.h>
+ 
+ #include "inotify-cxx.h"
+ #include "appinst.h"
+--- a/ict-main.cpp
++++ b/ict-main.cpp
+@@ -25,6 +25,7 @@
+ #include <fcntl.h>
+ #include <stdlib.h>
+ #include <limits.h>
++#include <string.h>
+ 
+ #include "inotify-cxx.h"
+ #include "appargs.h"
+--- a/incroncfg.cpp
++++ b/incroncfg.cpp
+@@ -17,6 +17,8 @@
+ #include <fstream>
+ #include <sstream>
+ 
++#include <string.h>
++
+ #include "incroncfg.h"
+ 
+ 
+--- a/usertable.cpp
++++ b/usertable.cpp
+@@ -25,6 +25,7 @@
+ #include <grp.h>
+ #include <stdlib.h>
+ #include <sys/stat.h>
++#include <string.h>
+ 
+ #include "usertable.h"
+ #include "incroncfg.h"
--- incron-0.5.7.orig/debian/patches/series
+++ incron-0.5.7/debian/patches/series
@@ -0,0 +1,2 @@
+01_gcc_43_fix
+99_correct_inotify_syscalls
--- incron-0.5.7.orig/debian/patches/99_correct_inotify_syscalls
+++ incron-0.5.7/debian/patches/99_correct_inotify_syscalls
@@ -0,0 +1,51 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_correct_inotify_syscalls.dpatch by  <kolter@openics.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Correct inotify syscalls
+
+@DPATCH@
+
+diff -Naur incron-0.5.5/ict-main.cpp incron-0.5.5-new/ict-main.cpp
+--- incron-0.5.5/ict-main.cpp	2007-02-08 23:32:49.000000000 +0100
++++ incron-0.5.5-new/ict-main.cpp	2007-02-09 13:47:55.036595146 +0100
+@@ -21,7 +21,7 @@
+ #include <unistd.h>
+ #include <sys/stat.h>
+ #include <sys/wait.h>
+-#include <sys/inotify.h>
++#include <linux/inotify.h>
+ #include <fcntl.h>
+ #include <stdlib.h>
+ #include <limits.h>
+--- incron-0.5.5/inotify-cxx.h	2007-02-08 23:32:49.000000000 +0100
++++ incron-0.5.5-new/inotify-cxx.h	2007-02-09 13:49:35.590879396 +0100
+@@ -33,12 +33,23 @@
+ 
+ // Please ensure that the following headers take the right place
+ #include <sys/syscall.h>
+-#include <sys/inotify.h>
++#include <linux/inotify.h>
+ 
+-// Use this if syscalls not defined
+-#ifndef __NR_inotify_init
+-#include <sys/inotify-syscalls.h>
+-#endif // __NR_inotify_init
++// define missing inotify calls
++static inline int inotify_init (void)
++{
++    return syscall (__NR_inotify_init);
++}
++
++static inline int inotify_add_watch (int fd, const char *name, __u32 mask)
++{
++    return syscall (__NR_inotify_add_watch, fd, name, mask);
++}
++
++static inline int inotify_rm_watch (int fd, __u32 wd)
++{
++    return syscall (__NR_inotify_rm_watch, fd, wd);
++}
+ 
+ /// Event struct size
+ #define INOTIFY_EVENT_SIZE (sizeof(struct inotify_event))
--- incron-0.5.7.orig/debian/copyright
+++ incron-0.5.7/debian/copyright
@@ -0,0 +1,47 @@
+This package was debianized by Emmanuel Bouthenot <kolter@openics.org> on
+Tue, 13 Feb 2007 09:54:02 +0100.
+
+It was downloaded from http://inotify.aiken.cz/
+
+Upstream Author: Lukas Jelinek <lukas@aiken.cz>
+
+Copyright: 2006-2007, Lukas Jelinek, <lukas@aiken.cz>
+
+License:
+
+  This packages is released under the following licences :
+    + X11-style license
+    + GNU Lesser General Public License, version 2.1
+    + GNU General Public License, version 2
+
+On Debian systems :
+   + the complete text of the GNU General Public License can be
+     found in `/usr/share/common-licenses/GPL'.
+   + the complete text of the GNU General Public License can be
+     found in `/usr/share/common-licenses/LGPL-2.1'.
+
+   + the X11-style license follow :
+
+     Permission is hereby granted, free of charge, to any person
+     obtaining a copy of this software and associated documentation
+     files (the "Software"), to deal in the Software without
+     restriction, including without limitation the rights to use,
+     copy, modify, merge, publish, distribute, sublicense, and/or sell
+     copies of the Software, and to permit persons to whom the
+     Software is furnished to do so, subject to the following
+     conditions:
+
+     The above copyright notice and this permission notice shall be
+     included in all copies or substantial portions of the Software.
+
+     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+     OTHER DEALINGS IN THE SOFTWARE.
+
+The Debian packaging is (C) 2007, Emmanuel Bouthenot <kolter@openics.org> and
+is licensed under the GPL, see above.
--- incron-0.5.7.orig/debian/examples
+++ incron-0.5.7/debian/examples
@@ -0,0 +1 @@
+incron.conf.example
--- incron-0.5.7.orig/patches/99_correct_inotify_syscalls
+++ incron-0.5.7/patches/99_correct_inotify_syscalls
@@ -0,0 +1,46 @@
+Index: incron-0.5.7/ict-main.cpp
+===================================================================
+--- incron-0.5.7.orig/ict-main.cpp	2007-09-23 15:34:29.000000000 +0200
++++ incron-0.5.7/ict-main.cpp	2007-09-23 15:34:29.000000000 +0200
+@@ -21,7 +21,7 @@
+ #include <unistd.h>
+ #include <sys/stat.h>
+ #include <sys/wait.h>
+-#include <sys/inotify.h>
++#include <linux/inotify.h>
+ #include <fcntl.h>
+ #include <stdlib.h>
+ #include <limits.h>
+Index: incron-0.5.7/inotify-cxx.h
+===================================================================
+--- incron-0.5.7.orig/inotify-cxx.h	2007-09-23 15:34:25.000000000 +0200
++++ incron-0.5.7/inotify-cxx.h	2007-09-23 15:34:29.000000000 +0200
+@@ -33,12 +33,23 @@
+ 
+ // Please ensure that the following headers take the right place
+ #include <sys/syscall.h>
+-#include <sys/inotify.h>
++#include <linux/inotify.h>
+ 
+-// Use this if syscalls not defined
+-#ifndef __NR_inotify_init
+-#include <sys/inotify-syscalls.h>
+-#endif // __NR_inotify_init
++// define missing inotify calls
++static inline int inotify_init (void)
++{
++    return syscall (__NR_inotify_init);
++}
++
++static inline int inotify_add_watch (int fd, const char *name, __u32 mask)
++{
++    return syscall (__NR_inotify_add_watch, fd, name, mask);
++}
++
++static inline int inotify_rm_watch (int fd, __u32 wd)
++{
++    return syscall (__NR_inotify_rm_watch, fd, wd);
++}
+ 
+ /// Event struct size
+ #define INOTIFY_EVENT_SIZE (sizeof(struct inotify_event))
