fah-control/setup.py

128 lines
3.5 KiB
Python
Raw Normal View History

2014-03-29 10:02:09 +01:00
import sys
import os
import inspect
dir = os.path.dirname(inspect.getfile(inspect.currentframe()))
if dir == '': dir = '.'
print 'dir =', dir
os.chdir(dir)
# Convert glade data
2016-07-06 02:00:49 +02:00
in_file = 'fah/FAHControl.glade'
out_file = 'fah/FAHControl_glade.py'
if os.path.exists(in_file):
input = None
output = None
try:
input = open(in_file, 'r')
output = open(out_file, 'w')
output.write('# -*- coding: utf8 -*-\n\n')
output.write('glade_data = """')
output.write(input.read())
output.write('"""\n')
finally:
if input is not None: input.close()
if output is not None: output.close()
2014-03-29 10:02:09 +01:00
# Bootstrap
try:
import ez_setup
ez_setup.use_setuptools()
except: pass
app = 'FAHControl'
if sys.platform == 'darwin':
from setuptools import setup
plist = dict(
CFBundleDisplayName = 'FAHControl',
CFBundleIdentifier = 'edu.stanford.folding.fahcontrol',
CFBundleSignature = '????',
2016-07-01 03:18:04 +02:00
NSHumanReadableCopyright = 'Copyright 2010-2016 Stanford University',
2014-03-29 10:02:09 +01:00
)
options = dict(
argv_emulation = False,
includes = 'cairo, pango, pangocairo, atk, gobject, gio',
iconfile = 'images/FAHControl.icns',
resources = ['/opt/local/share/themes'],
plist = plist,
)
extra_opts = dict(
app = [app],
options = {'py2app': options},
setup_requires = ['py2app'],
)
# Hack around py2app problem with python scripts with out .py extension.
from py2app.util import PY_SUFFIXES
PY_SUFFIXES.append('')
elif sys.platform == 'win32':
from cx_Freeze import setup, Executable
e = Executable(app, base = 'Win32GUI', icon = 'images/FAHControl.ico')
2016-03-04 23:19:25 +01:00
options = {
'build_exe': {
'build_exe': 'gui',
'includes': 'gtk'
}
}
2014-03-29 10:02:09 +01:00
extra_opts = dict(executables = [e], options = options)
else:
from setuptools import setup, find_packages
extra_opts = dict(
packages = find_packages(),
scripts = [app],
data_files = [('/usr/share/pixmaps', ['images/FAHControl.png'])],
install_requires = 'gtk2 >= 2.14.0',
2015-04-28 00:36:32 +02:00
include_package_data = True,
2014-03-29 10:02:09 +01:00
)
try:
2014-04-09 18:56:49 +02:00
version = open('version.txt').read().strip()
2014-03-29 10:02:09 +01:00
except: version = None
if version is not None:
open('fah/Version.py', 'w').write('version = \'%s\'\n' % version)
description = \
'''Folding@home is a distributed computing project using volunteered
computer resources run by Pandegroup of Stanford University.
'''
short_description = '''
This package contains FAHControl, a graphical monitor and control
utility for the Folding@home client. It gives an overview of running
projects on the local and optional (remote) machines. Starting,
stopping and pausing of the running projects is also possible, as is
viewing the logs. It provides an Advanced view with
additional information and settings for enthusiasts and gurus.'''
description += short_description
setup(
name = 'FAHControl',
version = version,
description = 'Folding@home Client Control',
long_description = description,
author = 'Joseph Coffland',
author_email = 'joseph@cauldrondevelopment.com',
license = 'GNU General Public License version 3',
keywords = 'protein, molecular dynamics, simulation',
url = 'http://folding.stanford.edu/',
package_data = {'fah': ['*.glade']},
**extra_opts)
2015-04-28 00:36:32 +02:00
if sys.platform == 'darwin':
with open('package-description.txt', 'w') as f:
f.write(short_description.strip())
2014-03-29 10:02:09 +01:00