1#!/usr/bin/python
2
3import os
4from autotest_lib.client.bin import utils
5
6version = 1
7
8def setup(tarball, topdir):
9    srcdir = os.path.join(topdir, 'src')
10    if not os.path.exists(tarball):
11        utils.get_file('http://www.packetfactory.net/libnet/dist/libnet.tar.gz',
12                       tarball)
13    utils.extract_tarball_to_dir(tarball, 'src')
14    os.chdir(srcdir)
15    utils.configure ('--prefix=%s/libnet' % topdir)
16    utils.make()
17    utils.make('install')
18
19    os.chdir(topdir)
20
21pwd = os.getcwd()
22tarball = os.path.join(pwd, 'libnet.tar.gz')
23utils.update_version(pwd+'/src', False, version, setup, tarball, pwd)
24