Author: bugman Date: Thu Jul 28 15:57:47 2011 New Revision: 13954 URL: http://svn.gna.org/viewcvs/relax?rev=13954&view=rev Log: Added a script for building application packages of relax. This currently supports the building of a stand alone (i.e. no python needed) Mac OS X app. Added: branches/gui_testing/setup.py Added: branches/gui_testing/setup.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/setup.py?rev=13954&view=auto ============================================================================== --- branches/gui_testing/setup.py (added) +++ branches/gui_testing/setup.py Thu Jul 28 15:57:47 2011 @@ -1,0 +1,79 @@ +############################################################################### +# # +# Copyright (C) 2011 Edward d'Auvergne # +# # +# This file is part of the program relax. # +# # +# relax 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. # +# # +# relax is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY 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 relax; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +############################################################################### + +# Module docstring. +"""This script is used to build relax as an application on certain platforms. + +The Mac OS X component was initially generated by py2applet, but has been highly modified. To use this script to build a Mac app, the following command needs to be run: + +Usage: + python setup.py py2app +""" + +# Python module import. +from os import getcwd, listdir, sep +from re import search +import sys + +# relax module imports. +from status import Status; status = Status() + + +# Mac OS X setup. +if 'darwin' in sys.platform: + # Import the setup tools. + from setuptools import setup + + # The relax settings. + APP = ['relax.py'] + OPTIONS = { + 'argv_emulation': True, + 'iconfile': status.install_path + sep + 'graphics' + sep + 'ulysses_shadowless_trans_128x128.icns' + } + + # All files and directories. + DATA_FILES = [] + for name in listdir(getcwd()): + # Skip names starting with '.'. + if search('^\.', name): + continue + + # Blacklist. + blacklist = [ + 'build', + 'dist' + ] + if name in blacklist: + continue + + # Add the file. + DATA_FILES.append(name) + + # Setup. + setup( + app=APP, + data_files=DATA_FILES, + options={ + 'py2app': OPTIONS, + }, + setup_requires=['py2app'] + )