1#!/usr/bin/python 2 3# Copyright 2014 The Chromium OS Authors. All rights reserved. 4# Use of this source code is governed by a BSD-style license that can be 5# found in the LICENSE file. 6 7import os, shutil 8from autotest_lib.client.bin import utils 9 10version = 1 11 12def setup(topdir): 13 """Download TDL library tarball and unpack to src/, then 14 install remaining files/ into src/. 15 @param topdir: The directory of this deps. 16 """ 17 tarball = 'tdl-0.0.2.tar.gz' 18 srcdir = os.path.join(topdir, 'src') 19 filesdir = os.path.join(topdir, 'files') 20 tarball_path = os.path.join(filesdir, tarball) 21 22 shutil.rmtree(srcdir, ignore_errors=True) 23 24 if not os.path.exists(tarball_path): 25 utils.get_file( 26 'http://github.com/greggman/tdl/archive/0.0.2.tar.gz', tarball_path) 27 28 os.mkdir(srcdir) 29 utils.extract_tarball_to_dir(tarball_path, srcdir) 30 os.chdir(srcdir) 31 shutil.copy(os.path.join(filesdir, 'WebGLClear.html'), srcdir) 32 33pwd = os.getcwd() 34utils.update_version(pwd + '/src', True, version, setup, pwd) 35