You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

vncinstall 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #!/bin/sh
  2. #
  3. # Copyright (C) 2002-2005 RealVNC Ltd.
  4. #
  5. # This is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. #
  10. # This software is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. # GNU General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this software; if not, write to the Free Software
  17. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  18. # USA.
  19. #
  20. #
  21. # vncinstall - copy the VNC programs to an installation directory.
  22. # Also tries to install the manual pages somewhere sensible.
  23. #
  24. if [ $# -lt 1 -o $# -gt 3 -o ! -d "$1" ]; then
  25. echo "usage: $0 <installation-directory> [<man-page-directory>] [<module-directory>]"
  26. echo "e.g. $0 /usr/local/bin"
  27. exit 1
  28. fi
  29. dst=$1
  30. shift
  31. if [ $# -gt 0 ]; then
  32. mandst="$1/man1"
  33. shift
  34. if [ $# -gt 0 ]; then
  35. moduledst=$1
  36. shift
  37. else
  38. moduledst=/usr/X11R6/lib/modules/extensions
  39. fi
  40. else
  41. if [ "`basename $dst`" = bin ]; then
  42. mandst="`dirname $dst`/man/man1"
  43. if [ ! -d "$mandst" -a "$dst" = /usr/bin ]; then
  44. mandst=/usr/share/man/man1
  45. fi
  46. fi
  47. fi
  48. if [ "$mandst" != "" ]; then
  49. if [ ! -d "$mandst" -o ! -w "$mandst" ]; then
  50. echo "Can't install manual pages to $mandst"
  51. mandst=""
  52. fi
  53. fi
  54. for f in xc/programs/Xserver/Xvnc vncviewer/vncviewer vncpasswd/vncpasswd \
  55. vncconfig/vncconfig vncserver x0vncserver/x0vncserver; do
  56. if [ ! -f $f ]; then
  57. echo "Couldn't find $f"
  58. else
  59. if cmp -s $f $dst/`basename $f`; then
  60. echo "`basename $f` hasn't changed"
  61. else
  62. echo "Copying $f to $dst"
  63. cp -pf $f $dst
  64. chmod 0555 $dst/`basename $f`
  65. fi
  66. if [ -f $f.man ]; then
  67. if [ "$mandst" != "" -a -d "$mandst" ]; then
  68. if cmp -s $f.man $mandst/`basename $f.1`; then
  69. echo "`basename $f.man` hasn't changed"
  70. else
  71. echo "Copying $f.man to $mandst/`basename $f.1`"
  72. cp -pf $f.man $mandst/`basename $f.1`
  73. chmod 0444 $mandst/`basename $f.1`
  74. fi
  75. fi
  76. fi
  77. fi
  78. done
  79. vncModule=xc/programs/Xserver/vnc/module/vnc.so
  80. if [ -f "$vncModule" -a -d "$moduledst" ]; then
  81. if cmp -s $vncModule $moduledst/`basename $vncModule`; then
  82. echo "`basename $vncModule` hasn't changed"
  83. else
  84. echo "Copying $vncModule to $moduledst"
  85. cp -pf $vncModule $moduledst
  86. chmod 0555 $moduledst/`basename $vncModule`
  87. fi
  88. fi