Author: dmeyer Date: Mon Oct 17 20:30:25 2005 New Revision: 7738 Added: trunk/setup.py
Log: add global setup.py Added: trunk/setup.py ============================================================================== --- (empty file) +++ trunk/setup.py Mon Oct 17 20:30:25 2005 @@ -0,0 +1,94 @@ +# -*- coding: iso-8859-1 -*- +# ----------------------------------------------------------------------------- +# setup.py - Setup script for freevo +# ----------------------------------------------------------------------------- +# $Id: setup.py 748 2005-09-11 09:32:17Z dischi $ +# +# ----------------------------------------------------------------------------- +# Freevo - A Home Theater PC framework +# Copyright (C) 2002-2005 Krister Lagerstrom, Dirk Meyer, et al. +# +# First Edition: Dirk Meyer <[EMAIL PROTECTED]> +# Maintainer: Dirk Meyer <[EMAIL PROTECTED]> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MER- +# CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# ----------------------------------------------------------------------------- + +import os +import re +import sys +import distutils.core + +PYNOTIFIER_VERSION = '0.3.9' +PYMBUS_VERSION = '0.8.6' +URL = 'ftp://ftp.mbus.org/tzi/dmn/mbus/python' + +submodules = [ 'freevo-core', 'freevo-ui', 'freevo-tvdev', 'freevo-tvserver' ] + +for a in sys.argv: + if a.startswith('--help'): + distutils.core.setup(name="kaa", version="0.1") + sys.exit(0) + +# Adding base/build/lib to the python path so that all freevo modules +# can find the distribution file of freevo.core +# sys.path.insert(0, '../base/build/lib') + +if sys.argv[1] == 'clean' and len(sys.argv) == 2: + for m in submodules: + build = os.path.join(m, 'build') + if os.path.isdir(build): + print 'removing %s' % build + os.system('rm -rf %s' % build) + version = os.path.join(m, 'src/version.py') + # if os.path.isfile(version): + # print 'removing %s' % version + # os.unlink(version) + +else: + if not os.path.isdir('lib'): + os.makedirs('lib') + + for lib in ('pyMbus', 'pyNotifier'): + lib = '%s-%s' % (lib, globals()['%s_VERSION' % lib.upper()]) + if not os.path.isdir('lib/%s' % lib): + if not os.path.isfile('lib/%s.tar.gz' % lib): + os.system('wget %s/%s.tar.gz -O lib/%s.tar.gz' % (URL, lib, lib)) + os.system('tar -zxvf lib/%s.tar.gz -C lib' % lib) + f = open('lib/%s/setup.py' % lib) + data = '' + for line in f.readlines(): + line = line.replace('version.VERSION', 'VERSION') + m = re.match('from (.*?) import version', line) + if m: + line = 'execfile("%s/version.py")\n' % m.groups()[0] + data += line + f.close() + f = open('lib/%s/setup.py' % lib, 'w') + f.write(data) + f.close() + print '[setup] Entering lib', lib + os.chdir('lib/%s' % lib) + execfile('setup.py') + os.chdir('../..') + print '[setup] Leaving lib', lib + + for m in submodules: + print '[setup] Entering freevo submodule', m + os.chdir(m) + execfile('setup.py') + os.chdir('..') + print '[setup] Leaving freevo submodule', m ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ Freevo-cvslog mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freevo-cvslog
