# Set up the options and environment opts = Options('custom.py') opts.Add(PathOption('PREFIX', 'prefix for installation directory', '/usr/local')) env = Environment(options = opts) Help(opts.GenerateHelpText(env)) # Build the jarfile env.Java(target = '.', source = 'src') jarfile = env.Jar(target = 'tunnels.jar', source = ['th', 'src/Manifest']) # Start the collection of installation actions installfiles = [] # Set up the installation actions installfiles.append(env.Install('${PREFIX}/share/tunnelhack', [jarfile, 'python/sortscore.py'])) installfiles.append(env.Command('${PREFIX}/share/tunnelhack/scores.txt', 'doc/scores.txt', [Copy('$TARGET', '$SOURCE'), Chmod('$TARGET', 0666)])) installfiles.append(env.Command('${PREFIX}/bin/tunnelhack', 'src/tunnelhack.sh', [Copy('$TARGET', '$SOURCE'), Chmod('$TARGET', 0755)])) # Build the documentation installfiles.extend(SConscript('doc/SConscript', 'env')) # Create the installation alias env.Alias('install', installfiles)