Index: /trunk/COPYING
===================================================================
--- /trunk/COPYING	(revision 530)
+++ /trunk/COPYING	(revision 531)
@@ -19,4 +19,5 @@
 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 
+On Debian-based systems, see /usr/share/common-licenses
 
 Incorporated code
Index: /trunk/Makefile.in
===================================================================
--- /trunk/Makefile.in	(revision 530)
+++ /trunk/Makefile.in	(revision 531)
@@ -846,5 +846,9 @@
 		maintainer="$(DEFAULT_MAINTAINER)"; \
 	fi; \
-	echo "$(PACKAGE) ($(VERSION)-$(BUILD_NUM)) stable; urgency=low" > debian/changelog; \
+	codename=`lsb_release -a 2>/dev/null | grep Codename | cut -f 2`; \
+	if test "x$$codename" = x; then \
+		codename="stable"; \
+	fi; \
+	echo "$(PACKAGE) ($(VERSION)-$(BUILD_NUM)) $$codename; urgency=low" > debian/changelog; \
 	echo >> debian/changelog; \
 	echo "  * Initial release." >> debian/changelog; \
@@ -856,5 +860,6 @@
 	echo "End:" >> debian/changelog; \
 	cp   $(top_srcdir)/COPYING  debian/copyright; \
-	touch debian/README.debian; \
+	echo "9" > debian/compat; \
+	echo "Nothing to see here." > debian/README.debian; \
 	echo "Document: @install_name@-manual" > debian/@install_name@.doc-base; \
 	echo "Title: @install_name@ Manual" >> debian/@install_name@.doc-base; \
@@ -885,5 +890,5 @@
 	echo "Package: @install_name@" >> debian/control; \
 	echo "Architecture: any" >> debian/control; \
-	echo "Depends: libc6" >> debian/control; \
+	echo "Depends: \$${shlibs:Depends}, \$${misc:Depends}" >> debian/control; \
 	echo "Description: File integrity checker"  >> debian/control; \
 	echo " A file integrity checker"  >> debian/control; \
@@ -897,5 +902,5 @@
 	  echo "Package $$DEBFILE built."; \
 	  cp $$DEBFILE ./$(PACKAGE)-$(VERSION)-$(BUILD_NUM).deb; \
-	  ln -s ./$(PACKAGE)-$(VERSION)-$(BUILD_NUM).deb ./$(PACKAGE)-$(VERSION).deb; \
+	  ln --backup=numbered -fs ./$(PACKAGE)-$(VERSION)-$(BUILD_NUM).deb ./$(PACKAGE)-$(VERSION).deb; \
 	fi; \
 	echo
Index: /trunk/configure.ac
===================================================================
--- /trunk/configure.ac	(revision 530)
+++ /trunk/configure.ac	(revision 531)
@@ -72,5 +72,6 @@
 	   ;;
 	esac
-        ;;
+	LDFLAGS="${LDFLAGS} -Wl,--as-needed"
+	;;
 	
 	*osf*)
Index: /trunk/docs/Changelog
===================================================================
--- /trunk/docs/Changelog	(revision 530)
+++ /trunk/docs/Changelog	(revision 531)
@@ -2,4 +2,5 @@
 	* fix 'clobbered by..' compiler warning is src/sh_portcheck.c
 	* fix compiler warning because of deprecated _BSD_SOURCE macro
+	* fix 'make deb' for Debian stretch (reported by Alasdair)
 
 4.2.3:
Index: /trunk/init/samhain.startLSB.in
===================================================================
--- /trunk/init/samhain.startLSB.in	(revision 530)
+++ /trunk/init/samhain.startLSB.in	(revision 531)
@@ -3,6 +3,6 @@
 ### BEGIN INIT INFO
 # Provides: @install_name@
-# Required-Start: $syslog $network
-# Required-Stop: $syslog $network
+# Required-Start: $syslog $network $remote_fs
+# Required-Stop: $syslog $network $remote_fs
 # Default-Start: 2 3 4 5
 # Default-Stop: 0 1 6
Index: /trunk/init/samhain.startLinux.in
===================================================================
--- /trunk/init/samhain.startLinux.in	(revision 530)
+++ /trunk/init/samhain.startLinux.in	(revision 531)
@@ -12,6 +12,6 @@
 ### BEGIN INIT INFO
 # Provides: @install_name@
-# Required-Start: $syslog $network
-# Required-Stop: $syslog $network
+# Required-Start: $syslog $network $remote_fs
+# Required-Stop: $syslog $network $remote_fs
 # Default-Start: 2 3 4 5
 # Default-Stop: 0 1 6
Index: /trunk/rules.deb-light.in
===================================================================
--- /trunk/rules.deb-light.in	(revision 530)
+++ /trunk/rules.deb-light.in	(revision 531)
@@ -12,5 +12,5 @@
 
 # This is the debhelper compatability version to use.
-export DH_COMPAT=4
+export DH_COMPAT=9
 
 package=@install_name@
Index: /trunk/rules.deb.in
===================================================================
--- /trunk/rules.deb.in	(revision 530)
+++ /trunk/rules.deb.in	(revision 531)
@@ -12,5 +12,5 @@
 
 # This is the debhelper compatability version to use.
-export DH_COMPAT=4
+export DH_COMPAT=9
 
 package=@install_name@
