--- iwatch-0.2.2.orig/debian/postinst +++ iwatch-0.2.2/debian/postinst @@ -0,0 +1,15 @@ +#!/bin/sh +# postinst script for iwatch + +set -e + +if [ -x "/etc/init.d/iwatch" ]; then + update-rc.d iwatch defaults >/dev/null + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d iwatch restart + else + /etc/init.d/iwatch restart + fi +fi + +#DEBHELPER# --- iwatch-0.2.2.orig/debian/iwatch.1 +++ iwatch-0.2.2/debian/iwatch.1 @@ -0,0 +1,91 @@ +.TH IWATCH 1 +.SH NAME +iwatch \- a realtime filesystem monitor / monitor any changes in directories/files specified +.SH SYNOPSIS +.B iwatch +.RI [ options ] +.SH DESCRIPTION +This manual page documents briefly the +.B iwatch +command. iWatch is a realtime filesystem monitoring program. It's a simple perl +script to monitor changes in specific directories/files and send email +notification immediately. It reads the dir/file list from xml config file +and needs inotify support in kernel (Linux Kernel >= 2.6.13). +.SH OPTIONS +Usage for daemon mode of iWatch: +.TP +.B "iwatch [-d] [-f ] [-v] [-p ]" +.TP +In the daemon mode iWatch has the following options: +.TP +.B \-d +Execute the application as daemon. iWatch will run in foregroud +without this option. +.TP +.B \-f +Specify alternative configuration file. Default is /etc/iwatch/iwatch.xml. +.TP +.B \-p +Specify an alternate pid file (default: /var/run/iwatch.pid) +.TP +.B \-v +Be verbose. +.TP +Usage for command line mode of iWatch: +.TP +.B "iwatch [-c command] [-e event[,event[,..]]] [-h|--help] [-m ] [-r] [-s ] [-t ] [-v] [--version] [-x exception] [-X ] " +.TP +In the command line mode iWatch has the following options: +.TP +.B \-c +You can specify a command to be executed if an event occurs. For details +about the string format take a look at /usr/share/doc/iwatch/README.gz. +.TP +.B \-C +Specify the charset (default is utf-8). +.TP +.B \-e +Events list. For details about possible events take a look at /usr/share/doc/iwatch/README.gz. +.TP +.B \-h, \-\-help +Print help message. +.TP +.B \-m +Contact point's email address. Without this option, iwatch will not send +any email notification (obviously). +.TP +.B \-r +Recursivity of the watched directory. +.TP +.B \-s on|off +Enable or disable reports to the syslog (default is off/disabled). +.TP +.B \-t +Filter string (regex) to compare with the filename or directory name. +.TP +.B \-x +Specify the file or directory which should not be watched. +.TP +.B \-X +Specify a regex string as exception. +.SH USAGE EXAMPLES +.TP +.B % iwatch /tmp +Monitor changes in /tmp directory with default events. +.TP +.B % iwatch \-r \-e access,create \-m root@localhost \-x /etc/mail /etc +Monitor only access and create events in /etc directory recursively +with /etc/mail as exception and send email notification to cahya@localhost. +.TP +.B % iwatch \-r \-c "(w;ps -ef)|mail -s '%f was changed' root@localhost" /bin +Monitor /bin directory recursively and execute the command. +.TP +.B % iwatch \-r \-X '\.svn' ~/projects +Monitor ~/projects directory recursively, but exclude any .svn directories +inside. This can't be done with a normal '\-x' option since '\-x' can +only exclude the defined path. +.SH AUTHOR +iwatch was written by Cahya Wirawan . +.PP +This manual page was written by Michael Prokop +for the Debian project (but may be used by others). --- iwatch-0.2.2.orig/debian/copyright +++ iwatch-0.2.2/debian/copyright @@ -0,0 +1,31 @@ +This package was debianized by Michael Prokop on +Fri, 11 Aug 2006 19:03:20 +0200. + +It was downloaded from http://sourceforge.net/projects/iwatch + +Upstream Author: Cahya Wirawan + +Copyright: © 2006, Cahya Wirawan + +License: + + 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. + + This package 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 package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + 02110-1301, USA. + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL-2'. + +The Debian packaging is © 2006, Michael Prokop and +is licensed under the GPL, see above. --- iwatch-0.2.2.orig/debian/NEWS +++ iwatch-0.2.2/debian/NEWS @@ -0,0 +1,22 @@ +iwatch (0.2.1-1) unstable; urgency=low + + If you did *not* modify the configuration file + /etc/iwatch.xml on your own you don't have to do anything + (because the maintainer script of this package takes care of + the situation). Just be aware of the fact that the new place + of the default configuration file is /etc/iwatch/iwatch.xml + now. + + To avoid pollution of /etc and because upstream ships more + than just one configuration file with the new release the + iwatch Debian package provides the configuration files inside + a new directory named /etc/iwatch/. + + So if you are using a customized /etc/iwatch.xml + configuration file please make sure you put it to + /etc/iwatch/iwatch.xml instead and make sure it validates + according to /etc/iwatch/iwatch.dtd (check out + /etc/iwatch/iwatch.xml to get an idea). You can remove + /etc/iwatch.xml afterwards. + + -- Michael Prokop Tue, 12 Jun 2007 11:30:42 +0200 --- iwatch-0.2.2.orig/debian/preinst +++ iwatch-0.2.2/debian/preinst @@ -0,0 +1,30 @@ +#!/bin/sh -e + +# Remove a no-longer used conffile +# Solution and code taken from http://wiki.debian.org/DpkgConffileHandling +rm_conffile() { + PKGNAME="$1" + CONFFILE="$2" + + if [ -e "$CONFFILE" ]; then + md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" + old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`" + if [ "$md5sum" != "$old_md5sum" ]; then + echo "Obsolete conffile $CONFFILE has been modified by you." + echo "Saving as $CONFFILE.dpkg-bak ..." + mv -f "$CONFFILE" "$CONFFILE".dpkg-bak + else + echo "Removing obsolete conffile $CONFFILE ..." + rm -f "$CONFFILE" + fi + fi +} + +case "$1" in +install|upgrade) + if dpkg --compare-versions "$2" le "0.2.1-1"; then + rm_conffile iwatch "/etc/iwatch.xml" + fi +esac + +#DEBHELPER# --- iwatch-0.2.2.orig/debian/initscript +++ iwatch-0.2.2/debian/initscript @@ -0,0 +1,89 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: iwatch +# Required-Start: $remote_fs +# Required-Stop: $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start iwatch, realtime filesystem monitoring program using inotify +### END INIT INFO +set -eu +############################################################################## +IWATCHD=/usr/bin/iwatch +PATH="/sbin:/bin" +DEBIANCONFIG=/etc/default/iwatch +PIDFILE=/var/run/iwatch.pid + +test -x $IWATCHD || exit 0 + +CONFIG_FILE=/etc/iwatch/iwatch.xml +START_DAEMON=true +test -f $DEBIANCONFIG && . $DEBIANCONFIG + +. /lib/lsb/init-functions + +is_true() +{ + case "${1:-}" in + [Yy]es|[Yy]|1|[Tt]|[Tt]rue) return 0;; + *) return 1; + esac +} +############################################################################## + +case "${1:-}" in + start) + if [ -f "$PIDFILE" ] ; then + log_warning_msg "Warning: iwatch daemon already running, doing nothing therefore." + exit 0 + fi + + if is_true $START_DAEMON; then + log_daemon_msg "Starting iwatch daemon" "iwatch" + set +e + $IWATCHD -f $CONFIG_FILE -p $PIDFILE -d + RC=$? + set -e + log_end_msg $RC + else + log_warning_msg "Not starting iwatch daemon as startup is deactivated via /etc/default/iwatch" + fi + ;; + + stop) + if [ -f "$PIDFILE" ] ; then + log_daemon_msg "Stopping iwatch daemon" "iwatch" + set +e + start-stop-daemon -K -p $PIDFILE + RC=$? + rm -f $PIDFILE + set -e + log_end_msg $RC + fi + ;; + + status) + [ -f "$PIDFILE" ] && PROCESS="$(cat $PIDFILE)" || PROCESS='' + if [ -n "$PROCESS" ] ; then + log_success_msg "iwatch daemon with pid $PROCESS is running." + exit 0 + else + log_warning_msg "Could not find a running iwatch daemon." + exit 1 + fi + ;; + + restart|reload|force-reload) + $0 stop + $0 start + ;; + + *) + echo "Usage: ${0:-} {start|stop|restart|reload|force-reload|status}" >&2 + exit 1 + ;; +esac + +exit 0 + +# vim: ai expandtab --- iwatch-0.2.2.orig/debian/watch +++ iwatch-0.2.2/debian/watch @@ -0,0 +1,6 @@ +# Watch file for iwatch for use with the uscan command + +# Compulsory line, this is a version 3 file +version=3 +# for devscripts >= 2.9 +http://sf.net/iwatch/iwatch-(.*)\.tgz --- iwatch-0.2.2.orig/debian/iwatch.xml +++ iwatch-0.2.2/debian/iwatch.xml @@ -0,0 +1,15 @@ + + + + + + + Operating System + + /bin + /sbin + /etc + /lib + /lib/modules + + --- iwatch-0.2.2.orig/debian/postrm +++ iwatch-0.2.2/debian/postrm @@ -0,0 +1,10 @@ +#!/bin/sh +# postrm script for iwatch + +set -e + +if [ "$1" = "purge" ] ; then + update-rc.d iwatch remove >/dev/null || exit $? +fi + +#DEBHELPER# --- iwatch-0.2.2.orig/debian/iwatch.default +++ iwatch-0.2.2/debian/iwatch.default @@ -0,0 +1,10 @@ +## iwatch configuration file + +# START_DAEMON: +# should iwatch start the iwatch daemon during boot? +START_DAEMON=false + +# CONFIG_FILE: +# configuration file for iwatch daemon +# +CONFIG_FILE=/etc/iwatch/iwatch.xml --- iwatch-0.2.2.orig/debian/compat +++ iwatch-0.2.2/debian/compat @@ -0,0 +1 @@ +5 --- iwatch-0.2.2.orig/debian/docs +++ iwatch-0.2.2/debian/docs @@ -0,0 +1 @@ +README --- iwatch-0.2.2.orig/debian/changelog +++ iwatch-0.2.2/debian/changelog @@ -0,0 +1,153 @@ +iwatch (0.2.2-2) unstable; urgency=low + + * [5678d80] Use CONFIG_FILE variable in initscript. + Thanks to inne for finding (Closes: #615057) + * [1854dc0] Fix spelling in log_daemon_msg stop action. Thanks to + Michael Burgener for reporting + (Closes: #675970) + * [b4ecc22] Bump Standards-Version to 3.9.3 + * [74c5671] Add build-arch + build-indep targets + * [949280b] Add $remote_fs to Required-Start/Required-Stop LSB headers + + -- Michael Prokop Mon, 11 Jun 2012 19:54:14 +0200 + +iwatch (0.2.2-1) unstable; urgency=low + + * New upstream release. + - Addresses the "Fails exec on files containing format chars" + issue. [Closes: #554438] + * Bump Standards-Version to 3.8.3. + * Update debian/copyright to make lintian happy. + * Fix lintian's hyphen-used-as-minus-sign issue in manpage (thanks + for the hint, Rhonda). + * Make package architecture independent. + * Use my Debian mail address as maintainer. + + -- Michael Prokop Tue, 29 Dec 2009 11:50:55 +0100 + +iwatch (0.2.1-3) unstable; urgency=low + + * Fix typo in /etc/iwatch/iwatch.xml, thanks to Hagen Fuchs for + spotting. [Closes: #501738] + * Add Vcs headers. + * Bump Standard-Version to 3.8.0 (no further changes). + * Drop Homepage from Long Description (thanks, Rhonda). + * Add debian/watch file (thanks, Rhonda). + * Drop lintian overrides, readd DEBHELPER to maintainer scripts + (thanks again, Rhonda). + + -- Michael Prokop Mon, 13 Oct 2008 12:43:38 +0200 + +iwatch (0.2.1-2) unstable; urgency=low + + * Use dpkq-query in preinst script for removing deprecated + configuration file as suggested on + http://wiki.debian.org/DpkgConffileHandling + (Thanks for the hint, formorer.) + + -- Michael Prokop Fri, 22 Jun 2007 20:52:02 +0200 + +iwatch (0.2.1-1) unstable; urgency=low + + * New upstream release. [Closes: #428402] + * Replaced Depends libxml-simple-perl with + libxml-simpleobject-libxml-perl due to changes in upstream code. + * Add liblinux-inotify2-perl to Build-Depends. This should fix the + "uninstallable on hppa due to unavailability of + liblinux-inotify2-perl" problem. Thanks for assistance, + Christoph Berg! [Closes: #419317] + * Point homepage URL in long description to the project homepage + itself instead of the sourcefore project website. + * Update and extend manpage. + * Provide iwatch.xml.example in /usr/share/doc/iwatch/examples/. + * Place all configuration files in /etc/iwatch/ (thanks for the hint, + formorer). Upstream will switch to this setup with an upcoming + release as well so we follow 10.7.2 of the Debian Policy Manual. + + -- Michael Prokop Mon, 11 Jun 2007 15:52:27 +0200 + +iwatch (0.1.0-1) unstable; urgency=low + + * New upstream release. + + -- Michael Prokop Wed, 24 Jan 2007 22:42:38 +0100 + +iwatch (0.0.12-3) unstable; urgency=low + + * Upload to Debian pool (Closes: #383191). + + -- Michael Prokop Sat, 2 Dec 2006 22:25:20 +0100 + +iwatch (0.0.12-2) unstable; urgency=low + + * Add postfix to depends (using 'postfix | mail-transport-agent') + to make lintian happy. + + -- Michael Prokop Sat, 18 Nov 2006 16:44:47 +0100 + +iwatch (0.0.12-1) unstable; urgency=low + + * New upstream release. + + -- Michael Prokop Tue, 7 Nov 2006 00:07:27 +0100 + +iwatch (0.0.11-4) unstable; urgency=low + + * Don't start but *re*start iwatch daemon in debian/postinst, + thanks formorer. + + -- Michael Prokop Tue, 24 Oct 2006 12:28:09 +0200 + +iwatch (0.0.11-3) unstable; urgency=low + + * Add mail-transport-agent to Depends. + * Use "${1:-}" in initscript to make 'set -u' happy. + * Added support for option 'status' to initscript. + + -- Michael Prokop Tue, 24 Oct 2006 11:59:46 +0200 + +iwatch (0.0.11-2) unstable; urgency=low + + * Added initscript, thanks to Alexander 'formorer' Wirt for + feedback. + + -- Michael Prokop Sun, 22 Oct 2006 21:26:37 +0200 + +iwatch (0.0.11-1) unstable; urgency=low + + * New upstream release. + + -- Michael Prokop Thu, 28 Sep 2006 12:05:00 +0200 + +iwatch (0.0.9-1) unstable; urgency=low + + * New upstream release. + * Updated manpage according to current implementation. + + -- Michael Prokop Sun, 17 Sep 2006 12:02:57 +0200 + +iwatch (0.0.8-1) unstable; urgency=low + + * New upstream release. + + -- Michael Prokop Sun, 27 Aug 2006 11:34:30 +0200 + +iwatch (0.0.5-1) unstable; urgency=low + + * New upstream release. + - Added libstring-format-perl to depends + - Updated manpage according to upstream's changes + * From upstream's changelog: + - Separate the command in to daemon mode and command line mode. + - You can specify a command to be executed if an event occurs + - You can specify difference events you want to watch. + - You can enable/disable email notification. + + -- Michael Prokop Tue, 15 Aug 2006 10:47:56 +0200 + +iwatch (0.0.3-1) unstable; urgency=low + + * Initial release. + + -- Michael Prokop Fri, 11 Aug 2006 19:03:20 +0200 + --- iwatch-0.2.2.orig/debian/control +++ iwatch-0.2.2/debian/control @@ -0,0 +1,20 @@ +Source: iwatch +Section: admin +Priority: optional +Maintainer: Michael Prokop +Build-Depends: debhelper (>= 5) +Build-Depends-Indep: liblinux-inotify2-perl +Standards-Version: 3.9.3 +Homepage: http://iwatch.sourceforge.net/ +Vcs-git: git://git.grml.org/iwatch.git +Vcs-Browser: http://git.grml.org/?p=iwatch.git + +Package: iwatch +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends}, perl-modules, libevent-perl, liblinux-inotify2-perl, libmail-sendmail-perl, libxml-simpleobject-libxml-perl, postfix | mail-transport-agent +Description: realtime filesystem monitoring program using inotify + iWatch is a realtime filesystem monitoring program. It's a + simple perl script to monitor changes in specific + directories/files and send email notification immediately. It + reads the dir/file list from xml config file and needs inotify + support in kernel (Linux Kernel >= 2.6.13). --- iwatch-0.2.2.orig/debian/rules +++ iwatch-0.2.2/debian/rules @@ -0,0 +1,63 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +build: build-arch build-indep +build-arch: build-stamp +build-indep: build-stamp +build-stamp: + dh_testdir + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs usr/bin etc etc/default etc/init.d var/run etc/iwatch + + # Add here commands to install the package into debian/iwatch. + install -m 755 iwatch debian/iwatch/usr/bin/iwatch + install -m 755 debian/initscript debian/iwatch/etc/init.d/iwatch + install -m 644 debian/iwatch.default debian/iwatch/etc/default/iwatch + install -m 644 debian/iwatch.xml debian/iwatch/etc/iwatch/iwatch.xml + install -m 644 iwatch.dtd debian/iwatch/etc/iwatch/iwatch.dtd + +# Build architecture-dependent files here. +binary-arch: build install +# We have nothing to do by default. + +# Build architecture-independent files here. +binary-indep: build install + dh_testdir + dh_testroot + dh_installchangelogs ChangeLog + dh_installdocs + dh_installexamples iwatch.xml.example + dh_installman debian/iwatch.1 + dh_link + dh_strip + dh_compress + dh_fixperms + dh_perl + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install