Add server option to installation

svn: r21039
This commit is contained in:
Nick Hall 2013-01-08 21:54:31 +00:00
parent 622cabe1c2
commit 9979159717

230
setup.py
View File

@ -53,6 +53,11 @@ ALL_LINGUAS = ('bg', 'ca', 'cs', 'da', 'de', 'el', 'en_GB', 'es', 'fi', 'fr', 'h
'pt_PT', 'ru', 'sk', 'sl', 'sq', 'sv', 'uk', 'vi', 'zh_CN') 'pt_PT', 'ru', 'sk', 'sl', 'sq', 'sv', 'uk', 'vi', 'zh_CN')
INTLTOOL_FILES = ('data/tips.xml', 'gramps/plugins/lib/holidays.xml') INTLTOOL_FILES = ('data/tips.xml', 'gramps/plugins/lib/holidays.xml')
server = False
if '--server' in sys.argv:
sys.argv.remove('--server')
server = True
def intltool_version(): def intltool_version():
''' '''
Return the version of intltool as a tuple. Return the version of intltool as a tuple.
@ -312,59 +317,12 @@ class install(_install):
else: else:
update_posix() update_posix()
DOC_FILES = ['AUTHORS', 'COPYING', 'FAQ', 'INSTALL', 'LICENSE', 'NEWS', #-------------------------------------------------------------------------
'README', 'TODO'] #
GEDCOM_FILES = glob.glob(os.path.join('example', 'gedcom', '*.*')) # Packages
GRAMPS_FILES = glob.glob(os.path.join('example', 'gramps', '*.*')) #
PNG_FILES = glob.glob(os.path.join('data', '*.png')) #-------------------------------------------------------------------------
SVG_FILES = glob.glob(os.path.join('data', '*.svg')) package_core = ['gramps',
XML_FILES = glob.glob(os.path.join('data', '*.xml'))
IMAGE_FILES = glob.glob(os.path.join('images', '*.*'))
IMAGE_16 = glob.glob(os.path.join('images', '16x16', '*.png'))
IMAGE_22 = glob.glob(os.path.join('images', '22x22', '*.png'))
IMAGE_48 = glob.glob(os.path.join('images', '48x48', '*.png'))
IMAGE_SC = glob.glob(os.path.join('images', 'scalable', '*.svg'))
data_list = ['gui/glade/*.glade']
# add all subdirs of plugin with glade:
basedir = os.path.join('gramps', 'plugins')
for (dirpath, dirnames, filenames) in os.walk(basedir):
root, subdir = os.path.split(dirpath)
if subdir.startswith("."):
dirnames[:] = []
continue
for dirname in dirnames:
# Skip hidden and system directories:
if dirname.startswith("."):
dirnames.remove(dirname)
#we add to data_list so glade , xml, files are found, we don't need the gramps/ part
data_list.append(dirpath[7:] + '/' + dirname + '/*.glade')
data_list.append(dirpath[7:] + '/' + dirname + '/*.xml')
data_list.append(dirpath[7:] + '/' + dirname + '/*.png')
data_list.append(dirpath[7:] + '/' + dirname + '/*.svg')
data_list.append(dirpath[7:] + '/' + dirname + '/*.css')
data_list.append(dirpath[7:] + '/' + dirname + '/*.html')
data_list.append(dirpath[7:] + '/' + dirname + '/*.js')
data_list.append('plugins/webstuff/images/*.gif')
data_list.append('plugins/webstuff/images/*.ico')
setup(name = 'gramps',
description = ('Gramps (Genealogical Research and Analysis Management '
'Programming System)'),
long_description = ('Gramps (Genealogical Research and Analysis '
'Management Programming System) is a full featured '
'genealogy program supporting a Python based plugin '
'system.'),
version = VERSION,
author = 'Donald N. Allingham',
author_email = 'don@gramps-project.org',
maintainer = 'Gramps Development Team',
maintainer_email = 'benny.malengier@gmail.com',
url = 'http://gramps-project.org',
license = 'GPL v2 or greater',
platforms = ['FreeBSD', 'Linux', 'MacOS', 'Windows'],
cmdclass = {'build': build, 'install': install},
packages = ['gramps',
'gramps.cli', 'gramps.cli',
'gramps.cli.plug', 'gramps.cli.plug',
'gramps.gen.utils.docgen', 'gramps.gen.utils.docgen',
@ -395,21 +353,6 @@ setup(name = 'gramps',
'gramps.gen.simple', 'gramps.gen.simple',
'gramps.gen.utils', 'gramps.gen.utils',
'gramps.gen.utils.docgen', 'gramps.gen.utils.docgen',
'gramps.gui',
'gramps.gui.editors',
'gramps.gui.editors.displaytabs',
'gramps.gui.filters',
'gramps.gui.filters.sidebar',
'gramps.gui.logger',
'gramps.gui.merge',
'gramps.gui.plug',
'gramps.gui.plug.export',
'gramps.gui.plug.quick',
'gramps.gui.plug.report',
'gramps.gui.selectors',
'gramps.gui.views',
'gramps.gui.views.treemodels',
'gramps.gui.widgets',
'gramps.test', 'gramps.test',
'gramps.plugins', 'gramps.plugins',
'gramps.plugins.docgen', 'gramps.plugins.docgen',
@ -429,20 +372,141 @@ setup(name = 'gramps',
'gramps.plugins.view', 'gramps.plugins.view',
'gramps.plugins.webreport', 'gramps.plugins.webreport',
'gramps.plugins.webstuff', 'gramps.plugins.webstuff',
],
package_data={'gramps': data_list},
data_files=[('share/mime-info', ['data/gramps.mime']),
('share/icons/gnome/48x48/mimetypes', PNG_FILES),
('share/icons/gnome/scalable/mimetypes', SVG_FILES),
('share/icons', ['images/gramps.png']),
('share/doc/gramps/example/gedcom', GEDCOM_FILES),
('share/doc/gramps/example/gramps', GRAMPS_FILES),
('share/doc/gramps', DOC_FILES),
('share/gramps', XML_FILES),
('share/gramps/icons/hicolor', IMAGE_FILES),
('share/gramps/icons/hicolor/16x16', IMAGE_16),
('share/gramps/icons/hicolor/22x22', IMAGE_22),
('share/gramps/icons/hicolor/48x48', IMAGE_48),
('share/gramps/icons/hicolor/scalable', IMAGE_SC),
] ]
package_gui = ['gramps.gui',
'gramps.gui.editors',
'gramps.gui.editors.displaytabs',
'gramps.gui.filters',
'gramps.gui.filters.sidebar',
'gramps.gui.logger',
'gramps.gui.merge',
'gramps.gui.plug',
'gramps.gui.plug.export',
'gramps.gui.plug.quick',
'gramps.gui.plug.report',
'gramps.gui.selectors',
'gramps.gui.views',
'gramps.gui.views.treemodels',
'gramps.gui.widgets',
]
package_webapp = ['gramps.webapp',
'gramps.webapp.grampsdb',
'gramps.webapp.grampsdb.templatetags',
'gramps.webapp.grampsdb.view',
]
if server:
packages = package_core + package_webapp
else:
packages = package_core + package_gui
#-------------------------------------------------------------------------
#
# Package data
#
#-------------------------------------------------------------------------
# add all subdirs of plugin with glade:
package_data_core = []
basedir = os.path.join('gramps', 'plugins')
for (dirpath, dirnames, filenames) in os.walk(basedir):
root, subdir = os.path.split(dirpath)
if subdir.startswith("."):
dirnames[:] = []
continue
for dirname in dirnames:
# Skip hidden and system directories:
if dirname.startswith("."):
dirnames.remove(dirname)
#we add to data_list so glade , xml, files are found, we don't need the gramps/ part
package_data_core.append(dirpath[7:] + '/' + dirname + '/*.glade')
package_data_core.append(dirpath[7:] + '/' + dirname + '/*.xml')
package_data_core.append(dirpath[7:] + '/' + dirname + '/*.png')
package_data_core.append(dirpath[7:] + '/' + dirname + '/*.svg')
package_data_core.append(dirpath[7:] + '/' + dirname + '/*.css')
package_data_core.append(dirpath[7:] + '/' + dirname + '/*.html')
package_data_core.append(dirpath[7:] + '/' + dirname + '/*.js')
package_data_core.append('plugins/webstuff/images/*.gif')
package_data_core.append('plugins/webstuff/images/*.ico')
package_data_gui = ['gui/glade/*.glade']
package_data_webapp = ['webapp/*.sql', 'webapp/grampsdb/sql/*.sql']
if server:
package_data = package_data_core + package_data_webapp
else:
package_data = package_data_core + package_data_gui
#-------------------------------------------------------------------------
#
# Resources
#
#-------------------------------------------------------------------------
data_files_core = [('share/mime-info', ['data/gramps.mime']),
('share/icons', ['images/gramps.png'])]
DOC_FILES = ['AUTHORS', 'COPYING', 'FAQ', 'INSTALL', 'LICENSE', 'NEWS',
'README', 'TODO']
GEDCOM_FILES = glob.glob(os.path.join('example', 'gedcom', '*.*'))
GRAMPS_FILES = glob.glob(os.path.join('example', 'gramps', '*.*'))
data_files_core.append(('share/doc/gramps', DOC_FILES))
data_files_core.append(('share/doc/gramps/example/gedcom', GEDCOM_FILES))
data_files_core.append(('share/doc/gramps/example/gramps', GRAMPS_FILES))
PNG_FILES = glob.glob(os.path.join('data', '*.png'))
SVG_FILES = glob.glob(os.path.join('data', '*.svg'))
data_files_core.append(('share/icons/gnome/48x48/mimetypes', PNG_FILES))
data_files_core.append(('share/icons/gnome/scalable/mimetypes', SVG_FILES))
XML_FILES = glob.glob(os.path.join('data', '*.xml'))
data_files_core.append(('share/gramps', XML_FILES))
data_files_gui = []
IMAGE_FILES = glob.glob(os.path.join('images', '*.*'))
IMAGE_16 = glob.glob(os.path.join('images', '16x16', '*.png'))
IMAGE_22 = glob.glob(os.path.join('images', '22x22', '*.png'))
IMAGE_48 = glob.glob(os.path.join('images', '48x48', '*.png'))
IMAGE_SC = glob.glob(os.path.join('images', 'scalable', '*.svg'))
data_files_gui.append(('share/gramps/icons/hicolor', IMAGE_FILES))
data_files_gui.append(('share/gramps/icons/hicolor/16x16', IMAGE_16))
data_files_gui.append(('share/gramps/icons/hicolor/22x22', IMAGE_22))
data_files_gui.append(('share/gramps/icons/hicolor/48x48', IMAGE_48))
data_files_gui.append(('share/gramps/icons/hicolor/scalable', IMAGE_SC))
data_files_webapp = []
TEMPLATE_FILES = glob.glob(os.path.join('data/templates', '*.html'))
data_files_webapp.append(('share/gramps/templates', TEMPLATE_FILES))
ADMIN_FILES = glob.glob(os.path.join('data/templates/admin', '*.html'))
data_files_webapp.append(('share/gramps/templates/admin', ADMIN_FILES))
REG_FILES = glob.glob(os.path.join('data/templates/registration', '*.html'))
data_files_webapp.append(('share/gramps/templates/registration', REG_FILES))
if server:
data_files = data_files_core + data_files_webapp
else:
data_files = data_files_core + data_files_gui
#-------------------------------------------------------------------------
#
# Setup
#
#-------------------------------------------------------------------------
setup(name = 'gramps',
description = ('Gramps (Genealogical Research and Analysis Management '
'Programming System)'),
long_description = ('Gramps (Genealogical Research and Analysis '
'Management Programming System) is a full featured '
'genealogy program supporting a Python based plugin '
'system.'),
version = VERSION,
author = 'Donald N. Allingham',
author_email = 'don@gramps-project.org',
maintainer = 'Gramps Development Team',
maintainer_email = 'benny.malengier@gmail.com',
url = 'http://gramps-project.org',
license = 'GPL v2 or greater',
platforms = ['FreeBSD', 'Linux', 'MacOS', 'Windows'],
cmdclass = {'build': build, 'install': install},
packages = packages,
package_data = {'gramps': package_data},
data_files = data_files
) )