Index: trunk/Makefile.in
===================================================================
--- trunk/Makefile.in	(revision 34)
+++ trunk/Makefile.in	(revision 40)
@@ -484,4 +484,5 @@
 	    echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`"; \
 	    $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`; \
+	    chmod 0700 $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`; \
 	    echo " ./sstrip $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`"; \
 	    ./sstrip $(DESTDIR)$(sbindir)/`echo $$p|sed 's%samhain%@install_name@%'|sed 's%yule%@install_name@%'`; \
@@ -623,5 +624,5 @@
 	  exit 1; \
 	fi; \
-	make DESTDIR=$$STAGE install-light; \
+	$(MAKE) DESTDIR=$$STAGE install-light; \
 	rm -f $$STAGE/@sbindir@/@install_name@_stealth; \
 	echo "#! /bin/sh"                        > $$STAGE/setup.sh; \
@@ -926,5 +927,5 @@
 	  exit 1; \
 	fi; \
-	make DESTDIR=$$STAGE install-light;
+	$(MAKE) DESTDIR=$$STAGE install-light;
 	$(MAKE) solaris-pkg-finish
 
@@ -936,5 +937,5 @@
 	  exit 1; \
 	fi; \
-	make DESTDIR=$$STAGE install; 
+	$(MAKE) DESTDIR=$$STAGE install; 
 	$(MAKE) solaris-pkg-finish
 
@@ -946,11 +947,46 @@
 	user=`id | sed s,uid=[0123456789]*\(,, | sed s,\).*,,`; \
 	group=`id | sed s,.*gid=[0123456789]*\(,, | sed s,\).*,,`; \
-	cat prototype | grep -v 'none / ' | grep -v 'none /usr ' | \
-	grep -v 'none /usr/local ' | grep -v 'none /usr/bin ' | \
-	grep -v 'none /usr/local/bin ' | grep -v 'none /usr/local/sbin ' | \
-	grep -v 'none /var ' | grep -v 'none /usr/sbin ' | \
+	cat prototype | grep -v 'none / ' | \
+	sed 's,none /etc .*,none /etc ? ? ?,' | \
+	sed 's,none /etc/init.d .*,none /etc/init.d ? ? ?,' | \
+	sed 's,none /usr .*,none /usr ? ? ?,' | \
+	sed 's,none /usr/bin .*,none /usr/bin ? ? ?,' | \
+	sed 's,none /var .*,none /var ? ? ?,' | \
+	sed 's,none /var/lib .*,none /var/lib ? ? ?,' | \
+	sed 's,none /var/log .*,none /var/log ? ? ?,' | \
+	sed 's,none /var/run .*,none /var/run ? ? ?,' | \
+	sed 's,none /usr/sbin .*,none /usr/sbin ? ? ?,' | \
 	sed s,$$user\ $$group,root\ sys,g > prototype.1; \
 	rm -f prototype && mv prototype.1 prototype; \
-	echo "d none /var ? ? ?" >> prototype; \
+	if test -d /usr/local; then \
+		cat prototype | \
+		sed 's,none /usr/local .*,none /usr/local ? ? ?,' >prototype.1;\
+		rm -f prototype && mv prototype.1 prototype; \
+	fi; \
+	if test -d /usr/local/bin; then \
+		cat prototype | \
+		sed 's,none /usr/local/bin .*,none /usr/local/bin ? ? ?,' >prototype.1;\
+		rm -f prototype && mv prototype.1 prototype; \
+	fi; \
+	if test -d /usr/local/sbin; then \
+		cat prototype | \
+		sed 's,none /usr/local/sbin .*,none /usr/local/sbin ? ? ?,' >prototype.1;\
+		rm -f prototype && mv prototype.1 prototype; \
+	fi; \
+	if test -d /usr/local/man; then \
+		cat prototype | \
+		sed 's,none /usr/local/man .*,none /usr/local/man ? ? ?,' >prototype.1;\
+		rm -f prototype && mv prototype.1 prototype; \
+	fi; \
+	if test -d /usr/local/man/man5; then \
+		cat prototype | \
+		sed 's,none /usr/local/man/man5 .*,none /usr/local/man/man5 ? ? ?,' >prototype.1;\
+		rm -f prototype && mv prototype.1 prototype; \
+	fi; \
+	if test -d /usr/local/man/man8; then \
+		cat prototype | \
+		sed 's,none /usr/local/man/man8 .*,none /usr/local/man/man8 ? ? ?,' >prototype.1;\
+		rm -f prototype && mv prototype.1 prototype; \
+	fi; \
 	echo "d none /etc/rc0.d ? ? ?" >> prototype; \
 	echo "d none /etc/rc1.d ? ? ?" >> prototype; \
@@ -975,7 +1011,7 @@
 	  echo; \
 	  cp /tmp/samhain-pkg-staging/@install_name@.pkg $(PACKAGE)-$(VERSION).pkg; \
-	  echo "Package @install_name@.pkg is ready for installation"; \
+	  echo "Package $(PACKAGE)-$(VERSION).pkg is ready for installation"; \
 	  echo; \
-	  rm -r /var/spool/pkg/@install_name@ /tmp/samhain-pkg-staging; \
+	  rm -rf /var/spool/pkg/@install_name@ /tmp/samhain-pkg-staging; \
 	else \
 	  echo; \
@@ -993,6 +1029,6 @@
 	  exit 1; \
 	fi; \
-	make DESTDIR=$$STAGE install; \
-	make DESTDIR=$$STAGE install-boot; \
+	$(MAKE) DESTDIR=$$STAGE install; \
+	$(MAKE) DESTDIR=$$STAGE install-boot; \
 	cp hp_ux.psf $$STAGE; \
 	mkdir $$STAGE/sc; \
@@ -1141,5 +1177,5 @@
 	cp config.h m_comp/; \
 	cp $(srcsrc)/samhain_hide.c m_comp/; \
-	cd m_comp && make modules
+	cd m_comp && $(MAKE) modules
 	@if test -f m_comp/samhain_hide.ko; then \
 	  cp -p m_comp/samhain_hide.ko samhain_hide.ko; \
