patch-install 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. $OpenBSD: patch-install,v 1.2 2011/01/16 19:58:18 naddy Exp $
  2. --- install.orig Sun Jan 18 16:37:13 2009
  3. +++ install Sun Jan 16 17:25:16 2011
  4. @@ -12,27 +12,11 @@ PREFIX=${PREFIX:-/usr/local}
  5. # INSTALLATION CODE (do not touch):
  6. BINDIR=$PREFIX/bin
  7. -LIBDIR=$PREFIX/lib/fte
  8. +LIBDIR=$PREFIX/share/fte
  9. CONFIGDIR=$LIBDIR/config
  10. LOCALCONFIGDIR=$LIBDIR/localconfig
  11. -# To do some of this stuff, you should be root...
  12. -if [ -z "$INSTALL_NONROOT" ]
  13. -then
  14. - id | grep "^uid=0(" > /dev/null
  15. - if [ $? -ne 0 ]
  16. - then
  17. - echo "We don't recommend installing as non-root. To try anyway,"
  18. - echo "export INSTALL_NONROOT=1 before running the install."
  19. - echo "NOTE: You should also export PREFIX=/your/home/dir/fte to"
  20. - echo "give this a chance of working."
  21. - exit 1
  22. - fi
  23. -else
  24. - echo "Root-check bypassed - installing at your own risk"
  25. -fi
  26. -
  27. # Ensure everything is made.
  28. make -e all
  29. if [ $? -ne 0 ]
  30. @@ -45,9 +29,9 @@ fi
  31. rm -rf $CONFIGDIR
  32. # Make the directories we'll need.
  33. -mkdir -p $BINDIR
  34. -mkdir -p $LIBDIR
  35. -mkdir -p $LOCALCONFIGDIR
  36. +${BSD_INSTALL_PROGRAM_DIR} $BINDIR
  37. +${BSD_INSTALL_DATA_DIR} $LIBDIR
  38. +${BSD_INSTALL_DATA_DIR} $LOCALCONFIGDIR
  39. # Set up our binaries.
  40. for file in fte xfte cfte sfte vfte nfte
  41. @@ -58,29 +42,16 @@ do
  42. # if this is the right directory for this file, use it.
  43. if [ -f $dir/$file ]
  44. then
  45. - # try to copy it.
  46. - cp $dir/$file $BINDIR 2> /dev/null
  47. - # if that doesn't work, force it.
  48. - # NOTE: This may crash any running copy of FTE on some platforms
  49. - # AIX, Linux: confirmed okay
  50. - # Sun: confirmed crash
  51. - if [ $? -ne 0 ]
  52. - then
  53. - # Unix has the nice capability of being able to unlink
  54. - # in-use files.
  55. - echo "Forcing $file"
  56. - rm -f $BINDIR/$file
  57. - cp $dir/$file $BINDIR
  58. - fi
  59. + ${BSD_INSTALL_PROGRAM} $dir/$file $BINDIR 2> /dev/null
  60. fi
  61. done
  62. done
  63. # Copy our configuration.
  64. cp -r config $LIBDIR
  65. +rm $CONFIGDIR/*.orig
  66. # Somehow things may not all be properly readable by everyone.
  67. -chmod a+r $CONFIGDIR/*
  68. -chmod a+r $CONFIGDIR/*/*
  69. +chmod -R a+r $CONFIGDIR
  70. # Any CVS directory that is copied over should be uncopied over.
  71. rm -rf `find $CONFIGDIR -type d -name CVS`