summaryrefslogtreecommitdiff
path: root/devtools/bin/install.sh
diff options
context:
space:
mode:
authorGregory Neil Shapiro <gshapiro@FreeBSD.org>2008-08-28 04:33:50 +0000
committerGregory Neil Shapiro <gshapiro@FreeBSD.org>2008-08-28 04:33:50 +0000
commite8e0e5823adff1aed6bf456d75e58353e6dcf68e (patch)
tree366be2f317b4d052916d4861096c4a53ba6f9a26 /devtools/bin/install.sh
parentaa651f666c6d33d54b6572c19534539ed5ae7637 (diff)
Import sendmail 8.14.3 and clean up svn properties as documented in:vendor/sendmail/8.14.3
Notes
svn path=/vendor/sendmail/dist/; revision=182329 svn path=/vendor/sendmail/8.14.3/; revision=182330; tag=vendor/sendmail/8.14.3
Diffstat (limited to 'devtools/bin/install.sh')
-rwxr-xr-xdevtools/bin/install.sh134
1 files changed, 134 insertions, 0 deletions
diff --git a/devtools/bin/install.sh b/devtools/bin/install.sh
new file mode 100755
index 000000000000..59a3771b6dad
--- /dev/null
+++ b/devtools/bin/install.sh
@@ -0,0 +1,134 @@
+#!/bin/sh
+
+# Copyright (c) 1998, 1999, 2001 Sendmail, Inc. and its suppliers.
+# All rights reserved.
+#
+# By using this file, you agree to the terms and conditions set
+# forth in the LICENSE file which can be found at the top level of
+# the sendmail distribution.
+#
+#
+# $Id: install.sh,v 8.14 2001/03/16 23:37:31 gshapiro Exp $
+
+# Set default program
+program=mv
+owner=""
+group=""
+mode=""
+strip=""
+
+# chown program -- ultrix keeps it in /etc/chown and /usr/etc/chown
+if [ -f /etc/chown ]
+then
+ chown=/etc/chown
+elif [ -f /usr/etc/chown ]
+then
+ chown=/usr/etc/chown
+else
+ chown=chown
+fi
+
+# Check arguments
+while [ ! -z "$1" ]
+do
+ case $1
+ in
+ -o) owner=$2
+ shift; shift
+ ;;
+
+ -g) group=$2
+ shift; shift
+ ;;
+
+ -m) mode=$2
+ shift; shift
+ ;;
+
+ -c) program=cp
+ shift
+ ;;
+
+ -s) strip="strip"
+ shift
+ ;;
+
+ -*) echo $0: Unknown option $1
+ exit 1
+ ;;
+
+ *) break
+ ;;
+ esac
+done
+
+# Check source file
+if [ -z "$1" ]
+then
+ echo "Source file required" >&2
+ exit 1
+elif [ -f $1 -o $1 = /dev/null ]
+then
+ src=$1
+else
+ echo "Source file must be a regular file or /dev/null" >&2
+ exit 1
+fi
+
+# Check destination
+if [ -z "$2" ]
+then
+ echo "Destination required" >&2
+ exit 1
+elif [ -d $2 ]
+then
+ srcfile=`basename $src`
+ dst=$2/$srcfile
+else
+ dst=$2
+fi
+
+# Do install operation
+$program $src $dst
+if [ $? != 0 ]
+then
+ exit 1
+fi
+
+# Strip if requested
+if [ ! -z "$strip" ]
+then
+ $strip $dst
+fi
+
+# Change owner if requested
+if [ ! -z "$owner" ]
+then
+ $chown $owner $dst
+ if [ $? != 0 ]
+ then
+ exit 1
+ fi
+fi
+
+# Change group if requested
+if [ ! -z "$group" ]
+then
+ chgrp $group $dst
+ if [ $? != 0 ]
+ then
+ exit 1
+ fi
+fi
+
+# Change mode if requested
+if [ ! -z "$mode" ]
+then
+ chmod $mode $dst
+ if [ $? != 0 ]
+ then
+ exit 1
+ fi
+fi
+
+exit 0