--- install.orig 2009-11-08 21:53:11 UTC +++ install @@ -36,12 +36,12 @@ manInstall(){ #$3 = VERSION #makes the man dir if it does not exist - if /bin/[ ! -d "$1/man" ]; then - /bin/mkdir "$1/man" - /bin/chmod 755 "$1/man" + if /bin/[ ! -d "${DESTDIR}$1/man" ]; then + /bin/mkdir "${DESTDIR}$1/man" + /bin/chmod 755 "${DESTDIR}$1/man" fi - manInstallTMPfile=/tmp/`shortRandom``shortRandom``shortRandom`$$`shortRandom` + manInstallTMPfile=_tmpfile /usr/bin/touch $manInstallTMPfile /bin/chmod go-rwx $manInstallTMPfile @@ -72,9 +72,9 @@ manInstall(){ #makes the man section dir if it does not exist - if /bin/[ ! -d $1/man/man$manInstallMANsection ]; then - /bin/mkdir "$1/man/man$manInstallMANsection" - /bin/chmod 755 "$1/man/man$manInstallMANsection" + if /bin/[ ! -d ${DESTDIR}$1/man/man$manInstallMANsection ]; then + /bin/mkdir "${DESTDIR}$1/man/man$manInstallMANsection" + /bin/chmod 755 "${DESTDIR}$1/man/man$manInstallMANsection" fi #echo $line @@ -82,7 +82,7 @@ manInstall(){ #echo $MANsection #echo $MANcenter - manInstallMANfile=`echo $1/man/man$manInstallMANsection/$manInstallMANname.$manInstallMANsection.gz | sed 's/\/\//\//g'` + manInstallMANfile=`echo ${DESTDIR}$1/man/man$manInstallMANsection/$manInstallMANname.$manInstallMANsection.gz | sed 's/\/\//\//g'` /usr/local/bin/pod2man --section="$manInstallMANsection" --release="$3" --name="$manInstallMANname" --center="$manInstallMANcenter" "$manInstallLine" | /usr/bin/gzip > "$manInstallMANfile" @@ -97,17 +97,17 @@ manInstall(){ binInstall(){ #$1 = prefix - if /bin/[ ! -d "$1/bin" ]; then - /bin/mkdir "$1/bin" - if /bin/[ ! -d $1/bin ]; then - echo "$1/bin does not a dir or does not exist and could not be created" + if /bin/[ ! -d "${DESTDIR}$1/bin" ]; then + /bin/mkdir "${DESTDIR}$1/bin" + if /bin/[ ! -d ${DESTDIR}$1/bin ]; then + echo "${DESTDIR}$1/bin does not a dir or does not exist and could not be created" exit 1; fi - /bin/chmod u+rwx "$1/bin" + /bin/chmod u+rwx "${DESTDIR}$1/bin" fi - binInstallTMPfile=/tmp/`shortRandom``shortRandom``shortRandom`$$`shortRandom` + binInstallTMPfile=_tmpfile /usr/bin/touch $binInstallTMPfile /bin/chmod go-rwx $binInstallTMPfile @@ -119,9 +119,9 @@ binInstall(){ while /bin/[ $binInstallCL -le $binInstallNOL ]; do binInstallLine=`getline $binInstallTMPfile $binInstallCL` - /bin/cat "./bin/$binInstallLine" | /usr/bin/sed "s/%%PREFIX%%/"`echo $1 | sed 's/\\//\\\\\//g'`"/g" > "$1/bin/$binInstallLine" + /bin/cat "./bin/$binInstallLine" | /usr/bin/sed "s/%%PREFIX%%/"`echo $1 | sed 's/\\//\\\\\//g'`"/g" > "${DESTDIR}$1/bin/$binInstallLine" - /bin/chmod 755 "$1/bin/$binInstallLine" + /bin/chmod 755 "${DESTDIR}$1/bin/$binInstallLine" binInstallCL=`/bin/expr $binInstallCL + 1` done @@ -132,7 +132,7 @@ binInstall(){ includeInstall(){ #$1 = prefix - includeInstallTMPfile=/tmp/`shortRandom``shortRandom``shortRandom`$$`shortRandom` + includeInstallTMPfile=_tmpfile /usr/bin/touch $includeInstallTMPfile /bin/chmod go-rwx $includeInstallTMPfile @@ -145,13 +145,13 @@ includeInstall(){ includeInstallLine=`getline $includeInstallTMPfile $includeInstallCL` if /bin/[ -d $includeInstallLine ]; then - if /bin/[ ! -d "$1/$includeInstallLine" ]; then - mkdir "$1/$includeInstallLine" - chmod 755 "$1/$includeInstallLine" + if /bin/[ ! -d "${DESTDIR}$1/$includeInstallLine" ]; then + mkdir "${DESTDIR}$1/$includeInstallLine" + chmod 755 "${DESTDIR}$1/$includeInstallLine" fi else - cat "$includeInstallLine" | /usr/bin/sed "s/%%PREFIX%%/"`echo $1 | sed 's/\\//\\\\\//g'`"/g" > "$1/$includeInstallLine" - /bin/chmod 644 "$1/$includeInstallLine" + cat "$includeInstallLine" | /usr/bin/sed "s/%%PREFIX%%/"`echo $1 | sed 's/\\//\\\\\//g'`"/g" > "${DESTDIR}$1/$includeInstallLine" + /bin/chmod 644 "${DESTDIR}$1/$includeInstallLine" fi includeInstallCL=`/bin/expr $includeInstallCL + 1`