; qt installation script
; by Marcus Comstedt <marcus@lysator.liu.se>

(complete 0)

(select
 (askchoice
  (prompt "\nPlease select the appropriate binary\nthat you want to install\n")
  (choices "68020" "68020+fpu" "68030-68060" "68030+fpu" "68040-68060+fpu")
  (help "By selecting the CPU that matches your machine, you will "
	"get a binary specially optimized for your configuration.  "
	"If you are unsure, select 68020.\n\n" @askchoice-help)
  (default 0))
 (set qt_binary "qt")
 (set qt_binary "qt.020fpu")
 (set qt_binary "qt.030")
 (set qt_binary "qt.030fpu")
 (set qt_binary "qt.040fpu")
)

(complete 5)

(select
 (askchoice
  (prompt "\nDo you want regular or MagicWB icons installed?\n")
  (choices "Regular" "MagicWB")
  (help "Selecting MagicWB will install 8 colour icons using the "
	"Magic Workbench palette.  Selecting regular will "
	"install plain 4 colour icons\n\n" @askchoice-help)
  (default 0))
 (set icondir "")
 (set icondir "MagicWB")
)

(complete 10)

(set bindir
 (askdir
  (prompt "Select the directory where you want to install the executables")
  (help "This should be a directory where you can easily access qt "
	"via Workbench or CLI/Shell.\n\n" @askdir-help)
  (default @default-dest)
  (disk)
 )
)

(set @default-dest bindir)

(complete 15)

(set instopts
 (askoptions
  (prompt "Select which binaries to install")
  (help "qt is the main QuickTime replay program.  flatten is a tool to "
	"convert movies in two-fork format.  Select which of these you want "
	"to install.\n\n" @askoptions-help)
  (choices "qt" "flatten")
 )
)

(complete 20)

(if
 (bitand instopts 1)
 (copyfiles
  (prompt ("\nCopying qt to %s." bindir))
  (source qt_binary)
  (dest bindir)
  (newname "qt")
 )
)

(if
 (bitand instopts 2)
 (copyfiles
  (prompt ("\nCopying flatten to %s." bindir))
  (source "flatten")
  (dest bindir)
  (newname "flatten")
 )
)

(complete 35)

(if
 (bitand instopts 1)
 (copyfiles
  (prompt ("\nCopying qt.info to %s." bindir))
  (source (tackon icondir "qt.info"))
  (dest bindir)
  (newname "qt.info")
  (noposition)
 )
)

(if
 (bitand instopts 2)
 (copyfiles
  (prompt ("\nCopying flatten.info to %s." bindir))
  (source (tackon icondir "flatten.info"))
  (dest bindir)
  (newname "flatten.info")
  (noposition)
 )
)

(complete 55)

(if (askbool (prompt "Do you wish to install the AmigaGuide documentation?")
	(help @askbool-help)
	(default 1))
 (
  (set docdir 
   (askdir
    (prompt "Select the directory where you want the qt documentation")
    (help @askdir-help)
    (default @default-dest)))

  (complete 60)

  (copyfiles
   (prompt ("\nCopying qt.guide to %s." docdir))
   (source "qt.guide")
   (dest docdir))

  (complete 80)

  (copyfiles
   (prompt ("\nCopying qt.guide.info to %s." docdir))
   (source (tackon icondir "qt.guide.info"))
   (dest docdir)
   (noposition))
 )
)

(complete 100)

