50
52
action="store", dest="rootdir",
51
53
help="Install into a different root directory.",
55
parser.add_option("--prefix",
56
action="store", dest="prefix",
57
help="Base prefix to install IVLE into (default: /usr/local).",
59
parser.add_option("--python-site-packages",
60
action="store", dest="python_site_packages",
61
help="Path to Python site packages directory.",
62
default='/usr/lib/python%s/site-packages' % PYTHON_VERSION)
53
63
(options, args) = parser.parse_args(args)
55
65
# Call the real function
56
return __install(dry=options.dry, rootdir=options.rootdir,
66
return __install(prefix=options.prefix,
67
python_site_packages=options.python_site_packages,
68
dry=options.dry, rootdir=options.rootdir,
57
69
nosvnrevno=options.nosvnrevno)
59
def __install(dry=False, rootdir=None, nosvnrevno=False):
60
# We need to import the one in the working copy, not in the system path.
61
confmodule = __import__("ivle/conf/conf")
71
def __install(prefix, python_site_packages, dry=False, rootdir=None,
62
73
install_list = util.InstallList()
64
75
# We need to apply make_install_path with the rootdir to an awful lot of
65
76
# config variables, so make it easy:
66
77
mip = functools.partial(util.make_install_path, rootdir)
68
# Pull the required varibles out of the config
69
lib_path = mip(confmodule.lib_path)
70
share_path = mip(confmodule.share_path)
71
bin_path = mip(confmodule.bin_path)
72
python_site_packages = mip(confmodule.python_site_packages)
79
# Compute the lib_path, share_path and bin_path (copied from
81
lib_path = mip(os.path.join(prefix, 'lib/ivle'))
82
share_path = mip(os.path.join(prefix, 'share/ivle'))
83
bin_path = mip(os.path.join(prefix, 'bin'))
84
python_site_packages = mip(python_site_packages)
74
86
# Must be run as root or a dry run
90
102
timountpath = os.path.join(lib_path, 'timount')
91
103
util.action_copyfile('bin/timount/timount', timountpath, dry)
93
ivleconfpath = mip('/etc/ivle/ivle.conf')
94
util.action_copyfile('etc/ivle.conf', ivleconfpath, dry)
96
105
# Copy in the services (only usrmgt-server is needed on the host, but
97
106
# the jail build requires the rest).
98
107
util.action_copylist(install_list.list_services, share_path, dry)