diff --git a/setup.py b/setup.py index b6648ca12..fb622d3f5 100644 --- a/setup.py +++ b/setup.py @@ -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') 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(): ''' Return the version of intltool as a tuple. @@ -311,22 +316,97 @@ class install(_install): 'type processing was not run.') else: update_posix() + +#------------------------------------------------------------------------- +# +# Packages +# +#------------------------------------------------------------------------- +package_core = ['gramps', + 'gramps.cli', + 'gramps.cli.plug', + 'gramps.gen.utils.docgen', + 'gramps.gen', + 'gramps.gen.datehandler', + 'gramps.gen.db', + 'gramps.gen.display', + 'gramps.gen.filters', + 'gramps.gen.filters.rules', + 'gramps.gen.filters.rules.citation', + 'gramps.gen.filters.rules.event', + 'gramps.gen.filters.rules.family', + 'gramps.gen.filters.rules.media', + 'gramps.gen.filters.rules.note', + 'gramps.gen.filters.rules.person', + 'gramps.gen.filters.rules.place', + 'gramps.gen.filters.rules.repository', + 'gramps.gen.filters.rules.source', + 'gramps.gen.lib', + 'gramps.gen.merge', + 'gramps.gen.mime', + 'gramps.gen.plug', + 'gramps.gen.plug.docbackend', + 'gramps.gen.plug.docgen', + 'gramps.gen.plug.menu', + 'gramps.gen.plug.report', + 'gramps.gen.proxy', + 'gramps.gen.simple', + 'gramps.gen.utils', + 'gramps.gen.utils.docgen', + 'gramps.test', + 'gramps.plugins', + 'gramps.plugins.docgen', + 'gramps.plugins.drawreport', + 'gramps.plugins.export', + 'gramps.plugins.gramplet', + 'gramps.plugins.graph', + 'gramps.plugins.importer', + 'gramps.plugins.lib', + 'gramps.plugins.lib.maps', + 'gramps.plugins.mapservices', + 'gramps.plugins.quickview', + 'gramps.plugins.rel', + 'gramps.plugins.sidebar', + 'gramps.plugins.textreport', + 'gramps.plugins.tool', + 'gramps.plugins.view', + 'gramps.plugins.webreport', + 'gramps.plugins.webstuff', + ] +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 -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', '*.*')) -PNG_FILES = glob.glob(os.path.join('data', '*.png')) -SVG_FILES = glob.glob(os.path.join('data', '*.svg')) -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')) +#------------------------------------------------------------------------- +# +# Package data +# +#------------------------------------------------------------------------- -data_list = ['gui/glade/*.glade'] # 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) @@ -338,16 +418,78 @@ for (dirpath, dirnames, filenames) in os.walk(basedir): 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') + 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)'), @@ -364,85 +506,7 @@ setup(name = 'gramps', license = 'GPL v2 or greater', platforms = ['FreeBSD', 'Linux', 'MacOS', 'Windows'], cmdclass = {'build': build, 'install': install}, - packages = ['gramps', - 'gramps.cli', - 'gramps.cli.plug', - 'gramps.gen.utils.docgen', - 'gramps.gen', - 'gramps.gen.datehandler', - 'gramps.gen.db', - 'gramps.gen.display', - 'gramps.gen.filters', - 'gramps.gen.filters.rules', - 'gramps.gen.filters.rules.citation', - 'gramps.gen.filters.rules.event', - 'gramps.gen.filters.rules.family', - 'gramps.gen.filters.rules.media', - 'gramps.gen.filters.rules.note', - 'gramps.gen.filters.rules.person', - 'gramps.gen.filters.rules.place', - 'gramps.gen.filters.rules.repository', - 'gramps.gen.filters.rules.source', - 'gramps.gen.lib', - 'gramps.gen.merge', - 'gramps.gen.mime', - 'gramps.gen.plug', - 'gramps.gen.plug.docbackend', - 'gramps.gen.plug.docgen', - 'gramps.gen.plug.menu', - 'gramps.gen.plug.report', - 'gramps.gen.proxy', - 'gramps.gen.simple', - 'gramps.gen.utils', - '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.plugins', - 'gramps.plugins.docgen', - 'gramps.plugins.drawreport', - 'gramps.plugins.export', - 'gramps.plugins.gramplet', - 'gramps.plugins.graph', - 'gramps.plugins.importer', - 'gramps.plugins.lib', - 'gramps.plugins.lib.maps', - 'gramps.plugins.mapservices', - 'gramps.plugins.quickview', - 'gramps.plugins.rel', - 'gramps.plugins.sidebar', - 'gramps.plugins.textreport', - 'gramps.plugins.tool', - 'gramps.plugins.view', - 'gramps.plugins.webreport', - '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), - ] + packages = packages, + package_data = {'gramps': package_data}, + data_files = data_files )