--- tcpspy-1.7d.orig/Makefile
+++ tcpspy-1.7d/Makefile
@@ -1,11 +1,15 @@
 # Makefile for tcpspy
 # Tim J. Robbins, 2000
+# Modified for Debian GNU/Linux by Pablo Lorenzzoni
 # $Id: Makefile,v 2.5 2001/04/25 01:40:17 tim Stab $
 
 # You may specify the syslog facility to use here. If in doubt, use LOG_DAEMON
 # or LOG_LOCAL[0-7]. See the syslog(3) manual page for a complete list of
 # facilities.
-CFLAGS+=-DFACILITY=LOG_LOCAL1
+# Edited for Debian GNU/Linux
+# original line:
+#  default: CFLAGS+=-DFACILITY=LOG_LOCAL1
+CFLAGS+=-DFACILITY=LOG_DAEMON
 
 # You may also override the default number of buckets in the connection table
 # here, but this not usually necessary.
@@ -17,8 +21,19 @@
 # Add any other options for the compiler here
 CFLAGS+=-O2 -Wall -W
 
+# Added for Debian GNU/Linux.
+prefix =
+BIN = $(prefix)/usr/sbin
+ETC = $(prefix)/etc
+MANPAGE8 = $(prefix)/usr/share/man/man8
+MANPAGE5 = $(prefix)/usr/share/man/man5
+DOC = $(prefix)/usr/share/doc/tcpspy
 
-default: tcpspy
+
+# Edited for Debian GNU/Linux
+# original line:
+#  default: tcpspy
+default: tcpspy doc
 all: tcpspy doc
 
 tcpspy: log.o rule_lexer.o rule_grammar.o rule.o tcpspy.o
@@ -39,14 +54,30 @@
 tcpspy.o: tcpspy.c
 
 doc:
-	groff -Tps -man tcpspy.8 >tcpspy.ps
-	ps2pdf tcpspy.ps tcpspy.pdf
+	groff -Tps -man tcpspy.8 > tcpspy.ps
+
+# Removed for preventing conflicts with Debian GNU/Linux autobuilders
+# (mainly lack of gs and fonts packages)
+#	ps2pdf tcpspy.ps tcpspy.pdf
+# Added for Debian GNU/Linux (compatibility with the previous version)
+	groff -Thtml -man tcpspy.8 > tcpspy.8.html
 
 clean:
 	rm -f log.o rule_lexer.o rule_grammar.o rule_lexer.c \
 		rule_grammar.c rule_grammar.h rule.o tcpspy.o tcpspy \
-		tcpspy.ps tcpspy.pdf
+		tcpspy.8.html tcpspy.ps tcpspy.pdf
 
-install: tcpspy
-	install -m 644 -D tcpspy.8 /usr/local/man/man8/tcpspy.8
-	install -m 755 -D tcpspy /usr/local/sbin/tcpspy
+# Edited for Debian GNU/Linux
+# original lines:
+# install: tcpspy
+#	install -m 644 -D tcpspy.8 /usr/local/man/man8/tcpspy.8
+#	install -m 755 -D tcpspy /usr/local/sbin/tcpspy
+install: tcpspy doc
+	install -d $(BIN) $(ETC) $(MANPAGE8) $(MANPAGE5)
+	install -m 755 ./tcpspy $(BIN)
+	install -m 644 tcpspy.rules $(ETC)
+	install -m 644 tcpspy.8 $(MANPAGE8)
+	install -m 644 tcpspy.rules.5 $(MANPAGE5)
+	install -d $(DOC)
+	cp -a tcpspy.8.html $(DOC)
+	cp -a tcpspy.ps $(DOC)
