$OpenBSD: patch-install,v 1.1 2000/06/05 00:04:03 espie Exp $
--- install.orig	Thu Oct  9 14:58:17 1997
+++ install	Mon Jun  5 01:41:11 2000
@@ -1,5 +1,7 @@
 #! /bin/csh -f
 
+set USRBINPATH=${DESTDIR}/usr/local/bin
+
 if ("$#argv" < "1") then
     echo "Usage:	install binary"
     exit 1
@@ -29,11 +31,13 @@ if ("$binary" != "pgpsendmail") then
 	exit 0
     endif
     if ( ! -f $USRBINPATH/$binary ) then
-	cp -p $binary $USRBINPATH
+	cp $binary $USRBINPATH
+	chmod 755 $USRBINPATH/$binary
 	exit 0
     endif
     mv $USRBINPATH/$binary $USRBINPATH/${binary}.old
-    cp -p $binary $USRBINPATH
+    cp $binary $USRBINPATH
+    chmod 755 $USRBINPATH/$binary
     if ("$status" != "0") then
 	mv $USRBINPATH/${binary}.old $USRBINPATH/$binary
 	exit 1
@@ -50,7 +54,7 @@ if (`fgrep -c PATH_SENDMAIL /usr/include
     echo "Single definition of PATH_SENDMAIL not found in /usr/include/paths.h"
     exit 1
 endif
-set tmp = `fgrep PATH_SENDMAIL /usr/include/paths.h | cut -d'"' -f 2`
+set tmp = $(DESTDIR)`fgrep PATH_SENDMAIL /usr/include/paths.h | cut -d'"' -f 2`
 if ( ! -x $tmp ) then
     echo "File: $tmp is not executable"
     exit 1
@@ -73,8 +77,9 @@ if (-f ${sendmail_dir}/pgpsendmail) then
 	echo "You cannot over-write  ${sendmail_dir}/pgpsendmail"
 	exit 1
     endif
-    cp -p pgpsendmail ${sendmail_dir}/pgpsendmail.new
+    cp pgpsendmail ${sendmail_dir}/pgpsendmail.new
     mv -f ${sendmail_dir}/pgpsendmail.new ${sendmail_dir}/pgpsendmail
+    chmod 555 ${sendmail_dir}/pgpsendmail
     echo "PGPsendmail installed as ${sendmail_dir}/pgpsendmail"
     if ("$mortal" == "TRUE") then
 	echo "PGPsendmail will expect the real sendmail is ${sendmail_dir}/sendmail"
@@ -90,30 +95,15 @@ if ( ! -w ${sendmail_dir} ) then
     if ("$?USRBINPATH" != "0") then
 	if (-w $USRBINPATH) then
 	    echo "Writing PGPsendmail as:  $USRBINPATH/pgpsendmail  instead"
-	    cp -p pgpsendmail $USRBINPATH
+	    cp pgpsendmail $USRBINPATH
+	    chmod 555 $USRBINPATH/pgpsendmail
 	    exit 0
 	endif
     endif
     echo "PGPsendmail not installed. Do it yourself."
     exit 2
 endif
-cp -p pgpsendmail ${sendmail_dir}
+cp pgpsendmail ${sendmail_dir}
 cd ${sendmail_dir}
-mv sendmail sendmail.real
-ln -s pgpsendmail sendmail
-
-echo "PGPsendmail installed as ${sendmail_dir}/pgpsendmail"
-if ("$mortal" == "TRUE") then
-    echo "PGPsendmail will expect the real sendmail is ${sendmail_dir}/sendmail"
-else
-    echo "PGPsendmail will expect the real sendmail is ${sendmail_dir}/sendmail.real"
-endif
-
-if ("$USER" == "root") then
-    if ("$?PGPPATH" != "0") then
-	echo "WARNING: Do not restart the  sendmail  daemon while you"
-	echo "still have a PGPPATH environment variable"
-    endif
-endif
-
+chmod 4555 pgpsendmail
 exit 0
