fah-control/setup.py

129 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',
2018-04-05 22:58:10 +02:00
CFBundleIdentifier = 'org.foldingathome.fahcontrol',
2014-03-29 10:02:09 +01:00
CFBundleSignature = '????',
2018-04-05 22:58:10 +02:00
NSHumanReadableCopyright = 'Copyright 2010-2018 foldingathome.org',
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
2016-12-16 19:33:29 +01:00
# Change base to 'Console' for debugging
2014-03-29 10:02:09 +01:00
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()
2018-05-07 22:57:26 +02:00
version.split('.')
except: version = '0.0.0'
2014-03-29 10:02:09 +01:00
2018-05-07 22:57:26 +02:00
if not os.path.exists('fah/Version.py'):
2014-03-29 10:02:09 +01:00
open('fah/Version.py', 'w').write('version = \'%s\'\n' % version)
description = \
'''Folding@home is a distributed computing project using volunteered
2018-04-05 22:58:10 +02:00
computer resources.
2014-03-29 10:02:09 +01:00
'''
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',
2018-04-05 22:58:10 +02:00
url = 'https://foldingathome.org/',
2014-03-29 10:02:09 +01:00
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())