File: setup

package info (click to toggle)
gvrng 1.8.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 984 kB
  • ctags: 465
  • sloc: python: 2,573; makefile: 24; sh: 2
file content (52 lines) | stat: -rwxr-xr-x 1,688 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#! /usr/bin/env python
print "\n-------- Installing Guido van Robot Next Generation ---------"

from os.path import exists
import sys,os
from os import makedirs, mkdir, system
import compileall
if os.environ['USER'] != 'root':
    print "Only root can install this"
    sys.exit(1)

if not exists('/usr/local/GvRng'):
    makedirs('/usr/local/GvRng')
if not exists('/usr/local/share/icons'):
    makedirs('/usr/local/share/icons')
if not exists('/usr/local/share/locale'):
    makedirs('/usr/local/share/locale')
if not exists('/usr/local/man/man1'):
    makedirs('/usr/local/man/man1')
    
system('cp -rf *.py /usr/local/GvRng/')
system('cp -rf gui-gtk /usr/local/GvRng')
system('chmod 0755 /usr/local/GvRng/gvrng.py')
system('cp -f gvrngrc /usr/local/GvRng/')
system('cp gvrng.sh /usr/local/bin/gvrng')
system('cp -rf po /usr/local/GvRng/')
system('cp -rf bitmaps /usr/local/GvRng/')


try:
    system('cp -f bitmaps/gvrIcon-big.png /usr/local/share/icons/gvrIcon-big.png')
except Exception,info:
    print info

system('cp -rf docs /usr/local/GvRng/')
system('cp -f docs/gvrng.1.gz /usr/local/man/man1/gvrng.1.gz')
system('cp -rf gvr_progs /usr/local/GvRng/')
system('cp -rf locale/* /usr/local/share/locale')

system('chmod a+rx /usr/local/bin/gvrng')

# python2.3.4 does not support the quiet option for 
# compileall
try:
    print "Trying to compiling modules to bytecode."
    compileall.compile_dir('/usr/local/GvRng',quiet=1)
except:
    compileall.compile_dir('/usr/local/GvRng')
print "Installation complete."
print "To start Guido van Robot -> gvrng [Enter]"
print "Be sure to check the website http://gvr.sf.net, for additional information\nand lessons."
print "\nEnjoy\n"