📄 install-package.in
字号:
echo "**Error making directory $dest**" errs=`expr $errs + 1` if [ $failmode = "hard" ] ; then exit $rc ; fi echo "Failed to create directory $path_to_date" exit 1 else # Note that we store in inverse order dirlist="$1 $dirlist" fi $Show chmod $XMODE $path_to_date rc=$? if [ $rc != 0 ] ; then echo "**Error setting mode to $XMODE on directory $path_to_date**" errs=`expr $errs + 1` if [ $chmodfailmode = "hard" ] ; then exit $rc ; fi fi fi donefi}## This is a version of FixupFile that handles @...@ instead of #...#.# This is a little trickier, since this file itself is processed by# with @...@ replacements. We take advantage of the fact that [char] # matches the same things as char.# This has a few more fields than FixupFile#FixupFileForInstall() { # Change the FIRST libpath to the new form. This allows # the LIB_PATH to contain multiple names, as long as the MPICH libpath # is firstif [ -d $DESTDIR$2 ] ; then dest=$DESTDIR$2/`basename $1` destfile=$2/`basename $1`else dest=$DESTDIR$2 destfile=$2fiif [ $replace = 0 -a -f $dest ] ; then if [ $verbose = 1 ] ; then echo "$dest exists; not changed" ; fielif [ -d $1 ] ; then echo "$1 is a directory; not copied"else if [ -f $dest ] ; then $Show $RM $dest ; fi if [ $just_testing = 0 ] ; then sed \ -e "s%^GUI_LIBDIR=.*%GUI_LIBDIR=$libdir%g" \ $1 > $dest rc=$? if [ $rc != 0 ] ; then echo "**Error fixing up file $dest**" errs=`expr $errs + 1` if [ $failmode = "hard" ] ; then exit $rc ; fi else # store the destination filename copied filelist="$filelist $destfile" fi else if [ $verbose = 1 ] ; then echo "Fixup $1.in and copy to $dest" ; fi fifiif [ -z "$3" ] ; then mode=$MODEelse mode=$3fi$Show chmod $mode $destrc=$?if [ $rc != 0 ] ; then echo "**Error setting mode on file $dest**" errs=`expr $errs + 1` if [ $failmode = "hard" ] ; then exit $rc ; fifi}################################################################################ End of Routines###############################################################################if [ ! -n "$prefix" ] ; then echo "Set an installation location with -prefix=<location> ." exit 1fiif [ $verbose = 1 ] ; then echo "Install into $prefix"fiif [ -d $DESTDIR$prefix ] ; then if [ $verbose = 1 ] ; then echo "using existing directory $DESTDIR$prefix" fielse MkDir $prefixfiif [ "$prefix_override" = 1 ] ; then libdir=$prefix/lib bindir=$prefix/bin sbindir=$prefix/sbin docdir=$prefix/doc etcdir=$prefix/etc sharedir=$prefix/share logfilesdir=$prefix/logfiles if [ $appendUninstall = 0 ] ; then UNINSTALLFILE=$DESTDIR${sbindir}/${UNINSTALL_base} fifiif [ $appendUninstall = 0 ] ; then if [ "$copymode" = "core" -o "$copymode" = "optional" ] ; then UNINSTALLFILE="/dev/null" fifi# echo "UNINSTALLFILE = $UNINSTALLFILE"# check if $UNINSTALLFILE lives under $sbindiruninstall_dirname=`dirname $UNINSTALLFILE`if [ "$uninstall_dirname" = "$DESTDIR$sbindir" ] ; then if [ ! -d $DESTDIR$sbindir ] ; then echo "Creating ${pkgname}'s sbin" MkDir $sbindir fifiif [ "$copymode" = "all" -o "$copymode" = "core" ] ; then for type in lib doc logfiles etc ; do fromdir_name=${type}build_dir todir_name=${type}dir eval fromdir_value=\$"$fromdir_name" eval todir_value=\$"$todir_name" if [ -n "$fromdir_value" ] ; then if [ -d $fromdir_value ] ; then echo "Copying ${pkgname}'s $type" if [ $verbose = 1 ] ; then echo "$fromdir_value -> $DESTDIR$todir_value" fi CopyDirRecurP $fromdir_value $todir_value $MODE fi fi donefiif [ "$copymode" = "all" ] ; then if [ -n "$PKGS" ] ; then if [ ! -d $DESTDIR$sharedir ] ; then echo "Creating ${pkgname}'s share" MkDir $sharedir fi fi for type in share ; do fromdir_name=${type}build_dir todir_name=${type}dir eval fromdir_value=\$"$fromdir_name" eval todir_value=\$"$todir_name" if [ -n "$fromdir_value" ] ; then if [ -d $fromdir_value ] ; then echo "Copying ${pkgname}'s $type" if [ $verbose = 1 ] ; then echo "$fromdir_value -> $DESTDIR$todir_value" fi CopyDirRecurP $fromdir_value $todir_value $MODE fi fi donefiif [ "$copymode" = "all" -o "$copymode" = "core" ] ; then EXEFILES="@EXEFILES@" if [ -n "$binbuild_dir" ] ; then if [ -d $binbuild_dir ] ; then echo "Creating ${pkgname}'s bin" MkDir $bindir for exefile in $EXEFILES ; do if [ -x $binbuild_dir/$exefile ] ; then FixupFileForInstall $binbuild_dir/$exefile \ $bindir/$exefile $XMODE fi done fi fifi if [ "$copymode" = "all" -o "$copymode" = "optional" ] ; then CopyFileP $top_srcdir/COPYRIGHT $prefix CopyFileP $top_srcdir/CHANGES $prefix CopyFileP $top_srcdir/FAQ $prefix CopyFileP $top_srcdir/README.sdk $prefix CopyFileP $top_srcdir/README.rte $prefixfi# Remove old uninstall file & Prepare the UNINSTALLFILE for appendingif [ $appendUninstall = 0 -a -f $UNINSTALLFILE ] ; then $RM $UNINSTALLFILEfi## Open an uninstall file and force strong echo if one does NOT existif [ ! -f $UNINSTALLFILE ] ; then cat > $UNINSTALLFILE <<EOF#! /bin/shset -xEOFfiif [ "$UNINSTALLFILE" != "/dev/null" ] ; then chmod u+x $UNINSTALLFILEfi# Install subpackages as specified in $PKGSif [ "$copymode" = "core" ] ; then for pkg in $PKGS ; do if [ -d $binbuild_dir/../$pkg ] ; then if [ "X$pkg" = "Xtrace_rlog" ] ; then ( cd $binbuild_dir/../$pkg && \ if [ -x ./sbin/install-package ] ; then \ ./sbin/install-package -prefix=$prefix \ -uninstall=$UNINSTALLFILE \ -mode=$MODE -xmode=$XMODE ; \ fi ) fi fi donefiif [ "$copymode" = "all" ] ; then for pkg in $PKGS ; do if [ -d $binbuild_dir/../$pkg ] ; then if [ "X$pkg" = "Xtrace_rlog" ] ; then ( cd $binbuild_dir/../$pkg && \ if [ -x ./sbin/install-package ] ; then \ ./sbin/install-package -prefix=$prefix \ -uninstall=$UNINSTALLFILE \ -mode=$MODE -xmode=$XMODE ; \ fi ) else ( cd $binbuild_dir/../$pkg && \ if [ -x ./sbin/install-package \ -a -d $DESTDIR$sharedir ] ; then \ ./sbin/install-package -prefix=$sharedir/$pkg \ -uninstall=$UNINSTALLFILE \ -mode=$MODE -xmode=$XMODE ; \ fi ) fi fi donefi# Add the files to be removed to the UNINSTALLFILEfor file in $filelist ; do echo "$RM $file" >> $UNINSTALLFILEdoneecho "$RM $UNINSTALLFILE" >> $UNINSTALLFILE# Add the directories to be removed to the UNINSTALLFILEfor dir in $dirlist ; do echo "if [ -d $dir ] ; then rmdir $dir ; fi" >> $UNINSTALLFILEdone#echo "Installed ${pkgname} in $DESTDIR$prefix"echo "$UNINSTALLFILE may be used to remove the installation"#if [ $errs -gt 0 ] ; then rc=1else rc=0fiexit $rc
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -