VirtualBox

source: vbox/trunk/src/VBox/Installer/common/vboxapisetup.py@ 20327

Last change on this file since 20327 was 20173, checked in by vboxsync, 16 years ago

OSE fix

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1# Copyright (C) 2009 Sun Microsystems, Inc.
2#
3# This file is part of VirtualBox Open Source Edition (OSE), as
4# available from http://www.virtualbox.org. This file is free software;
5# you can redistribute it and/or modify it under the terms of the GNU
6# General Public License (GPL) as published by the Free Software
7# Foundation, in version 2 as it comes in the "COPYING" file of the
8# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
9# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
10#
11# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
12# Clara, CA 95054 USA or visit http://www.sun.com if you need
13# additional information or have any questions.
14#
15
16import os,sys
17from distutils.core import setup
18
19def patchWith(file,install):
20 newFile=file+".new"
21 oldF = open(file, 'r')
22 newF = open(newFile, 'w')
23 for line in oldF:
24 line=line.replace("%VBOX_INSTALL_PATH%",install)
25 newF.write(line)
26 newF.close()
27 oldF.close()
28 os.rename(newFile, file)
29
30# See http://docs.python.org/distutils/index.html
31def main(argv):
32 vboxDest=os.environ.get("VBOX_INSTALL_PATH", None)
33 if vboxDest is None:
34 raise Exception("No VBOX_INSTALL_PATH defined, exiting")
35 vboxVersion=os.environ.get("VBOX_VERSION", None)
36 if vboxVersion is None:
37 # Should we use VBox version for binding module versioning?
38 vboxVersion = "1.0"
39 #raise Exception("No VBOX_VERSION defined, exiting")
40 patchWith(os.path.join(os.path.dirname(sys.argv[0]), 'vboxapi', '__init__.py'), vboxDest)
41 setup(name='vboxapi',
42 version=vboxVersion,
43 description='Python interface to VirtualBox',
44 author='Sun Microsystems',
45 author_email='[email protected]',
46 url='http://www.virtualbox.org',
47 packages=['vboxapi']
48 )
49
50
51if __name__ == '__main__':
52 main(sys.argv)
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette