Make PREFIX work under Cygwin - Take 2

This commit is contained in:
Tom Eastep 2009-07-25 07:44:53 -07:00
parent eed9df1c06
commit 2d45a35c8f
4 changed files with 39 additions and 21 deletions

View File

@ -107,14 +107,6 @@ if [ -z "$RUNLEVELS" ] ; then
RUNLEVELS=""
fi
if [ -z "$OWNER" ] ; then
OWNER=root
fi
if [ -z "$GROUP" ] ; then
GROUP=root
fi
while [ $# -gt 0 ] ; do
case "$1" in
-h|help|?)
@ -138,17 +130,34 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
# Determine where to install the firewall script
#
DEBIAN=
CYGWIN=
case $(uname) in
CYGWIN*)
if [ -z "$PREFIX" ]; then
DEST=
INIT=
fi
OWNER=$(id -un)
GROUP=$(id -gn)
;;
*)
[ -z "$OWNER" ] && OWNER=root
[ -z "$GROUP" ] && GROUP=root
;;
esac
OWNERSHIP="-o $OWNER -g $GROUP"
if [ -n "$PREFIX" ]; then
if [ `id -u` != 0 ] ; then
echo "Not setting file owner/group permissions, not running as root."
OWNERSHIP=""
fi
install -d $OWNERSHIP -m 755 ${PREFIX}/sbin
install -d $OWNERSHIP -m 755 ${PREFIX}${DEST}
if [ `id -u` != 0 ] ; then
echo "Not setting file owner/group permissions, not running as root."
OWNERSHIP=""
fi
install -d $OWNERSHIP -m 755 ${PREFIX}/sbin
install -d $OWNERSHIP -m 755 ${PREFIX}${DEST}
elif [ -d /etc/apt -a -e /usr/bin/dpkg ]; then
DEBIAN=yes
elif [ -f /etc/slackware-version ] ; then

View File

@ -113,8 +113,11 @@ MANDIR=${MANDIR:-"/usr/share/man"}
case $(uname) in
CYGWIN*)
DEST=
INIT=
if [ -z "$PREFIX" ]; then
DEST=
INIT=
fi
OWNER=$(id -un)
GROUP=$(id -gn)
CYGWIN=Yes

View File

@ -133,8 +133,11 @@ DEBIAN=
case $(uname) in
CYGWIN*)
DEST=
INIT=
if [ -z "$PREFIX" ]; then
DEST=
INIT=
fi
OWNER=$(id -un)
GROUP=$(id -gn)
;;

View File

@ -113,8 +113,11 @@ MANDIR=${MANDIR:-"/usr/share/man"}
case $(uname) in
CYGWIN*)
DEST=
INIT=
if [ -z "$PREFIX" ]; then
DEST=
INIT=
fi
OWNER=$(id -un)
GROUP=$(id -gn)
CYGWIN=Yes