1
# Copyright (C) 2013 Canonical Ltd.
2
# Author: Colin Watson <cjwatson@ubuntu.com>
4
# This program is free software: you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; version 3 of the License.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
"""Install a Click package."""
18
from __future__ import print_function
20
from optparse import OptionParser
22
from click.install import ClickInstaller
25
# TODO: make configurable in build system or configuration file or similar?
26
default_root = "/opt/click.ubuntu.com"
30
parser = OptionParser("%prog install [options] PACKAGE-FILE")
32
"--root", metavar="PATH", default=default_root,
33
help="set top-level directory to PATH (default: %s)" % default_root)
35
"--force-missing-framework", action="store_true", default=False,
36
help="install despite missing system framework")
37
options, args = parser.parse_args(argv)
39
parser.error("need package file name")
40
package_path = args[0]
41
installer = ClickInstaller(options.root, options.force_missing_framework)
42
installer.install(package_path)