2012-05-20 04:26:19 +05:30
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
#
|
|
|
|
# Gramps - a GTK+/GNOME based genealogy program
|
|
|
|
#
|
|
|
|
# Copyright (C) 2012 Nick Hall
|
2012-09-30 16:00:08 +05:30
|
|
|
# Copyright (C) 2012 Rob G. Healey
|
|
|
|
# Copyright (C) 2012 Benny Malengier
|
2012-05-20 04:26:19 +05:30
|
|
|
#
|
|
|
|
# This program 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.
|
|
|
|
#
|
|
|
|
# This program 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 this program; if not, write to the Free Software
|
2014-08-09 07:59:07 +05:30
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2012-05-20 04:26:19 +05:30
|
|
|
#
|
|
|
|
|
|
|
|
'''
|
|
|
|
Gramps distutils module.
|
|
|
|
'''
|
2012-09-30 16:00:08 +05:30
|
|
|
|
|
|
|
#check python version first
|
|
|
|
import sys
|
|
|
|
|
2015-03-01 22:07:48 +05:30
|
|
|
if sys.version_info < (3, 2):
|
|
|
|
raise SystemExit("Gramps requires Python 3.2 or later.")
|
2012-09-30 16:00:08 +05:30
|
|
|
|
2012-05-20 18:51:47 +05:30
|
|
|
from distutils import log
|
2013-07-31 23:51:42 +05:30
|
|
|
from distutils.core import setup, Command
|
2012-05-20 04:26:19 +05:30
|
|
|
from distutils.util import convert_path, newer
|
|
|
|
from distutils.command.build import build as _build
|
|
|
|
from distutils.command.install import install as _install
|
|
|
|
import os
|
|
|
|
import glob
|
|
|
|
import codecs
|
2012-11-17 22:14:45 +05:30
|
|
|
import subprocess
|
2012-05-20 19:20:17 +05:30
|
|
|
from stat import ST_MODE
|
2013-03-12 04:13:58 +05:30
|
|
|
from gramps.version import VERSION
|
2013-07-31 23:51:42 +05:30
|
|
|
import unittest
|
2015-06-16 01:33:10 +05:30
|
|
|
import argparse
|
2012-05-20 13:20:25 +05:30
|
|
|
|
2014-07-30 08:03:41 +05:30
|
|
|
# this list MUST be a subset of _LOCALE_NAMES in gen/utils/grampslocale.py
|
|
|
|
# (that is, if you add a new language here, be sure it's in _LOCALE_NAMES too)
|
2014-10-25 01:04:48 +05:30
|
|
|
ALL_LINGUAS = ('ar', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'en_GB',
|
2015-02-13 19:59:58 +05:30
|
|
|
'eo', 'es', 'fi', 'fr', 'he', 'hr', 'hu', 'is', 'it',
|
2014-10-25 01:04:48 +05:30
|
|
|
'ja', 'lt', 'nb', 'nl', 'nn', 'pl', 'pt_BR', 'pt_PT',
|
2017-03-21 00:43:51 +05:30
|
|
|
'ru', 'sk', 'sl', 'sq', 'sr', 'sv', 'ta', 'tr', 'uk', 'vi',
|
2015-02-27 03:49:01 +05:30
|
|
|
'zh_CN', 'zh_HK', 'zh_TW')
|
2016-06-07 14:32:25 +05:30
|
|
|
_FILES = ('data/tips.xml', 'data/holidays.xml')
|
2012-05-20 04:26:19 +05:30
|
|
|
|
2015-12-22 03:42:30 +05:30
|
|
|
svem_flag = '--single-version-externally-managed'
|
|
|
|
if svem_flag in sys.argv:
|
|
|
|
# Die, setuptools, die.
|
|
|
|
sys.argv.remove(svem_flag)
|
|
|
|
|
2015-06-16 01:33:10 +05:30
|
|
|
# check if the resourcepath option is used and store the path
|
|
|
|
# this is for packagers that build out of the source tree
|
|
|
|
# other options to setup.py are passed through
|
|
|
|
resource_path = ''
|
|
|
|
packaging = False
|
|
|
|
argparser = argparse.ArgumentParser(add_help=False)
|
|
|
|
argparser.add_argument("--resourcepath", dest="resource_path")
|
2018-03-25 05:12:49 +05:30
|
|
|
argparser.add_argument("--no-compress-manpages", dest="no_compress_manpages",
|
|
|
|
action="store_true")
|
2015-06-16 01:33:10 +05:30
|
|
|
args, passthrough = argparser.parse_known_args()
|
|
|
|
if args.resource_path:
|
|
|
|
resource_path = args.resource_path
|
|
|
|
packaging = True
|
|
|
|
sys.argv = [sys.argv[0]] + passthrough
|
|
|
|
|
2012-05-20 04:26:19 +05:30
|
|
|
def intltool_version():
|
|
|
|
'''
|
|
|
|
Return the version of intltool as a tuple.
|
|
|
|
'''
|
2013-02-10 23:23:43 +05:30
|
|
|
if sys.platform == 'win32':
|
2018-09-04 07:33:17 +05:30
|
|
|
cmd = ["perl",
|
|
|
|
r"-e print qx(intltool-update --version) =~ m/(\d+.\d+.\d+)/;"]
|
2016-05-18 15:17:34 +05:30
|
|
|
try:
|
|
|
|
ver, ret = subprocess.Popen(cmd ,stdout=subprocess.PIPE,
|
2014-04-10 11:42:25 +05:30
|
|
|
stderr=subprocess.PIPE, shell=True).communicate()
|
2015-03-01 22:07:48 +05:30
|
|
|
ver = ver.decode("utf-8")
|
2013-02-10 23:23:43 +05:30
|
|
|
if ver > "":
|
|
|
|
version_str = ver
|
|
|
|
else:
|
|
|
|
return (0,0,0)
|
|
|
|
except:
|
|
|
|
return (0,0,0)
|
2012-11-18 23:01:39 +05:30
|
|
|
else:
|
2015-10-05 07:44:50 +05:30
|
|
|
cmd = 'intltool-update --version 2> /dev/null' # pathological case
|
2015-03-01 22:07:48 +05:30
|
|
|
retcode, version_str = subprocess.getstatusoutput(cmd)
|
2013-02-10 23:23:43 +05:30
|
|
|
if retcode != 0:
|
|
|
|
return None
|
2015-10-05 07:44:50 +05:30
|
|
|
cmd = 'intltool-update --version 2> /dev/null | head -1 | cut -d" " -f3'
|
|
|
|
retcode, version_str = subprocess.getstatusoutput(cmd)
|
|
|
|
if retcode != 0: # unlikely but just barely imaginable, so leave it
|
|
|
|
return None
|
2013-02-10 23:23:43 +05:30
|
|
|
return tuple([int(num) for num in version_str.split('.')])
|
2012-05-20 04:26:19 +05:30
|
|
|
|
|
|
|
def substitute_variables(filename_in, filename_out, subst_vars):
|
|
|
|
'''
|
|
|
|
Substitute variables in a file.
|
|
|
|
'''
|
|
|
|
f_in = codecs.open(filename_in, encoding='utf-8')
|
|
|
|
f_out = codecs.open(filename_out, encoding='utf-8', mode='w')
|
|
|
|
for line in f_in:
|
|
|
|
for variable, substitution in subst_vars:
|
|
|
|
line = line.replace(variable, substitution)
|
|
|
|
f_out.write(line)
|
|
|
|
f_in.close()
|
|
|
|
f_out.close()
|
|
|
|
|
|
|
|
def build_trans(build_cmd):
|
|
|
|
'''
|
|
|
|
Translate the language files into gramps.mo
|
|
|
|
'''
|
|
|
|
data_files = build_cmd.distribution.data_files
|
|
|
|
for lang in ALL_LINGUAS:
|
|
|
|
po_file = os.path.join('po', lang + '.po')
|
2016-05-18 15:17:34 +05:30
|
|
|
mo_file = os.path.join(build_cmd.build_base, 'mo', lang, 'LC_MESSAGES',
|
2012-12-29 05:55:01 +05:30
|
|
|
'gramps.mo')
|
2016-05-18 15:17:34 +05:30
|
|
|
mo_file_unix = (build_cmd.build_base + '/mo/' + lang +
|
2012-12-29 05:55:01 +05:30
|
|
|
'/LC_MESSAGES/gramps.mo')
|
2012-05-20 04:26:19 +05:30
|
|
|
mo_dir = os.path.dirname(mo_file)
|
|
|
|
if not(os.path.isdir(mo_dir) or os.path.islink(mo_dir)):
|
|
|
|
os.makedirs(mo_dir)
|
|
|
|
|
|
|
|
if newer(po_file, mo_file):
|
|
|
|
cmd = 'msgfmt %s -o %s' % (po_file, mo_file)
|
|
|
|
if os.system(cmd) != 0:
|
2012-12-20 22:10:49 +05:30
|
|
|
os.remove(mo_file)
|
2012-05-20 04:26:19 +05:30
|
|
|
msg = 'ERROR: Building language translation files failed.'
|
2012-12-20 22:10:49 +05:30
|
|
|
ask = msg + '\n Continue building y/n [n] '
|
2015-03-01 22:07:48 +05:30
|
|
|
reply = input(ask)
|
2012-12-20 22:10:49 +05:30
|
|
|
if reply in ['n', 'N']:
|
|
|
|
raise SystemExit(msg)
|
2016-03-01 06:55:16 +05:30
|
|
|
log.info('Compiling %s >> %s', po_file, mo_file)
|
2012-05-20 04:26:19 +05:30
|
|
|
|
2012-09-30 16:00:08 +05:30
|
|
|
#linux specific piece:
|
2012-11-09 22:18:09 +05:30
|
|
|
target = 'share/locale/' + lang + '/LC_MESSAGES'
|
|
|
|
data_files.append((target, [mo_file_unix]))
|
2012-05-20 04:26:19 +05:30
|
|
|
|
|
|
|
def build_man(build_cmd):
|
|
|
|
'''
|
|
|
|
Compresses Gramps manual files
|
|
|
|
'''
|
|
|
|
data_files = build_cmd.distribution.data_files
|
|
|
|
for man_dir, dirs, files in os.walk(os.path.join('data', 'man')):
|
|
|
|
if 'gramps.1.in' in files:
|
|
|
|
filename = os.path.join(man_dir, 'gramps.1.in')
|
|
|
|
newdir = os.path.join(build_cmd.build_base, man_dir)
|
|
|
|
if not(os.path.isdir(newdir) or os.path.islink(newdir)):
|
|
|
|
os.makedirs(newdir)
|
|
|
|
|
|
|
|
newfile = os.path.join(newdir, 'gramps.1')
|
2012-11-17 22:14:45 +05:30
|
|
|
subst_vars = (('@VERSION@', VERSION), )
|
2012-05-20 04:26:19 +05:30
|
|
|
substitute_variables(filename, newfile, subst_vars)
|
|
|
|
|
2018-03-25 05:12:49 +05:30
|
|
|
src = 'gramps.1'
|
|
|
|
if not args.no_compress_manpages:
|
|
|
|
import gzip
|
|
|
|
src += '.gz'
|
|
|
|
man_file_gz = os.path.join(newdir, src)
|
|
|
|
if os.path.exists(man_file_gz):
|
|
|
|
if newer(filename, man_file_gz):
|
|
|
|
os.remove(man_file_gz)
|
|
|
|
else:
|
|
|
|
filename = False
|
|
|
|
os.remove(newfile)
|
|
|
|
|
|
|
|
if filename:
|
|
|
|
#Binary io, so open is OK
|
|
|
|
with open(newfile, 'rb') as f_in,\
|
|
|
|
gzip.open(man_file_gz, 'wb') as f_out:
|
|
|
|
f_out.writelines(f_in)
|
|
|
|
log.info('Compiling %s >> %s', filename, man_file_gz)
|
2012-05-20 04:26:19 +05:30
|
|
|
|
2018-03-25 05:12:49 +05:30
|
|
|
os.remove(newfile)
|
|
|
|
filename = False
|
2012-05-20 04:26:19 +05:30
|
|
|
|
|
|
|
lang = man_dir[8:]
|
2018-03-25 05:12:49 +05:30
|
|
|
src = build_cmd.build_base + '/data/man' + lang + '/' + src
|
2016-02-07 18:49:24 +05:30
|
|
|
target = 'share/man' + lang + '/man1'
|
2012-05-20 04:26:19 +05:30
|
|
|
data_files.append((target, [src]))
|
|
|
|
|
|
|
|
def build_intl(build_cmd):
|
|
|
|
'''
|
|
|
|
Merge translation files into desktop and mime files
|
|
|
|
'''
|
2016-06-07 14:32:25 +05:30
|
|
|
for filename in _FILES:
|
|
|
|
filename = convert_path(filename)
|
|
|
|
strip_files(filename + '.in', filename, ['_tip', '_name'])
|
|
|
|
|
2015-10-05 07:44:50 +05:30
|
|
|
i_v = intltool_version()
|
|
|
|
if i_v is None or i_v < (0, 25, 0):
|
2016-06-07 14:32:25 +05:30
|
|
|
log.info('No intltool or version < 0.25.0, build_intl is aborting')
|
2012-05-20 04:26:19 +05:30
|
|
|
return
|
|
|
|
data_files = build_cmd.distribution.data_files
|
|
|
|
base = build_cmd.build_base
|
|
|
|
|
2012-11-09 22:18:09 +05:30
|
|
|
merge_files = (('data/gramps.desktop', 'share/applications', '-d'),
|
|
|
|
('data/gramps.keys', 'share/mime-info', '-k'),
|
2013-10-07 13:58:57 +05:30
|
|
|
('data/gramps.xml', 'share/mime/packages', '-x'),
|
2016-05-08 18:43:46 +05:30
|
|
|
('data/gramps.appdata.xml', 'share/metainfo', '-x'))
|
2012-05-20 04:26:19 +05:30
|
|
|
|
|
|
|
for filename, target, option in merge_files:
|
2012-11-09 22:18:09 +05:30
|
|
|
filenamelocal = convert_path(filename)
|
|
|
|
newfile = os.path.join(base, filenamelocal)
|
2012-05-20 04:26:19 +05:30
|
|
|
newdir = os.path.dirname(newfile)
|
|
|
|
if not(os.path.isdir(newdir) or os.path.islink(newdir)):
|
|
|
|
os.makedirs(newdir)
|
2012-11-09 22:18:09 +05:30
|
|
|
merge(filenamelocal + '.in', newfile, option)
|
|
|
|
data_files.append((target, [base + '/' + filename]))
|
2012-05-20 04:26:19 +05:30
|
|
|
|
2016-06-07 14:32:25 +05:30
|
|
|
def strip_files(in_file, out_file, mark):
|
|
|
|
'''
|
|
|
|
strip the file of the first character (typically an underscore) in each
|
|
|
|
keyword (in the "mark" argument list) in the file -- so this method is an
|
|
|
|
Alternative to intltool-merge command.
|
|
|
|
'''
|
|
|
|
if (not os.path.exists(out_file) and os.path.exists(in_file)):
|
|
|
|
old = open(in_file, 'r', encoding='utf-8')
|
|
|
|
with open(out_file, 'w', encoding='utf-8', errors='strict') as fb:
|
|
|
|
for line in old:
|
|
|
|
for marker in mark:
|
|
|
|
line = line.replace(marker, marker[1:])
|
|
|
|
fb.write(line)
|
|
|
|
old.close()
|
|
|
|
log.info('Compiling %s >> %s', in_file, out_file)
|
2012-05-20 04:26:19 +05:30
|
|
|
|
|
|
|
def merge(in_file, out_file, option, po_dir='po', cache=True):
|
|
|
|
'''
|
|
|
|
Run the intltool-merge command.
|
|
|
|
'''
|
|
|
|
option += ' -u'
|
|
|
|
if cache:
|
|
|
|
cache_file = os.path.join('po', '.intltool-merge-cache')
|
|
|
|
option += ' -c ' + cache_file
|
|
|
|
|
|
|
|
if (not os.path.exists(out_file) and os.path.exists(in_file)):
|
2013-02-10 23:23:43 +05:30
|
|
|
if sys.platform == 'win32':
|
2014-04-05 01:33:51 +05:30
|
|
|
cmd = (('set LC_ALL=C && perl -S intltool-merge %(opt)s %(po_dir)s %(in_file)s '
|
2016-05-18 15:17:34 +05:30
|
|
|
'%(out_file)s') %
|
|
|
|
{'opt' : option,
|
2013-02-10 23:23:43 +05:30
|
|
|
'po_dir' : po_dir,
|
2016-05-18 15:17:34 +05:30
|
|
|
'in_file' : in_file,
|
2013-02-10 23:23:43 +05:30
|
|
|
'out_file' : out_file})
|
|
|
|
else:
|
|
|
|
cmd = (('LC_ALL=C intltool-merge %(opt)s %(po_dir)s %(in_file)s '
|
2016-05-18 15:17:34 +05:30
|
|
|
'%(out_file)s') %
|
|
|
|
{'opt' : option,
|
2012-05-20 04:26:19 +05:30
|
|
|
'po_dir' : po_dir,
|
2016-05-18 15:17:34 +05:30
|
|
|
'in_file' : in_file,
|
2012-05-20 04:26:19 +05:30
|
|
|
'out_file' : out_file})
|
|
|
|
if os.system(cmd) != 0:
|
2016-05-18 15:17:34 +05:30
|
|
|
msg = ('ERROR: %s was not merged into the translation files!\n' %
|
2012-05-20 04:26:19 +05:30
|
|
|
out_file)
|
|
|
|
raise SystemExit(msg)
|
2016-06-07 14:32:25 +05:30
|
|
|
log.info('Compiling %s >> %s', in_file, out_file)
|
2012-05-20 04:26:19 +05:30
|
|
|
|
|
|
|
class build(_build):
|
|
|
|
"""Custom build command."""
|
|
|
|
def run(self):
|
|
|
|
build_trans(self)
|
2013-02-10 23:23:43 +05:30
|
|
|
if not sys.platform == 'win32':
|
|
|
|
build_man(self)
|
2012-05-20 04:26:19 +05:30
|
|
|
build_intl(self)
|
|
|
|
_build.run(self)
|
|
|
|
|
|
|
|
class install(_install):
|
|
|
|
"""Custom install command."""
|
|
|
|
def run(self):
|
2013-03-12 04:13:58 +05:30
|
|
|
resource_file = os.path.join(os.path.dirname(__file__), 'gramps', 'gen',
|
|
|
|
'utils', 'resource-path')
|
2016-06-16 18:50:07 +05:30
|
|
|
with open(resource_file, 'w', encoding='utf-8', errors='strict') as fp:
|
2015-06-16 01:33:10 +05:30
|
|
|
if packaging:
|
|
|
|
path = resource_path
|
|
|
|
else:
|
|
|
|
path = os.path.abspath(os.path.join(self.install_data, 'share'))
|
2013-03-12 04:13:58 +05:30
|
|
|
fp.write(path)
|
|
|
|
|
2012-05-20 04:26:19 +05:30
|
|
|
_install.run(self)
|
2013-03-12 04:13:58 +05:30
|
|
|
|
|
|
|
os.remove(resource_file)
|
|
|
|
|
2013-07-31 23:51:42 +05:30
|
|
|
class test(Command):
|
|
|
|
"""Command to run Gramps unit tests"""
|
|
|
|
description = "run all unit tests"
|
|
|
|
user_options = []
|
|
|
|
|
2014-03-07 05:07:47 +05:30
|
|
|
|
2013-07-31 23:51:42 +05:30
|
|
|
def initialize_options(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def finalize_options(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
def run(self):
|
2014-03-07 05:07:47 +05:30
|
|
|
if not os.path.exists('build'):
|
|
|
|
raise RuntimeError("No build directory. Run `python setup.py build` before trying to run tests.")
|
2013-07-31 23:51:42 +05:30
|
|
|
os.environ['GRAMPS_RESOURCES'] = '.'
|
|
|
|
all_tests = unittest.TestLoader().discover('.', pattern='*_test.py')
|
|
|
|
unittest.TextTestRunner(verbosity=self.verbose).run(all_tests)
|
|
|
|
|
2013-01-09 03:24:31 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# 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',
|
2016-05-18 15:17:34 +05:30
|
|
|
'gramps.plugins',
|
2016-07-05 18:00:58 +05:30
|
|
|
'gramps.plugins.db',
|
|
|
|
'gramps.plugins.db.bsddb',
|
|
|
|
'gramps.plugins.db.dbapi',
|
2016-05-18 15:17:34 +05:30
|
|
|
'gramps.plugins.docgen',
|
|
|
|
'gramps.plugins.drawreport',
|
|
|
|
'gramps.plugins.export',
|
|
|
|
'gramps.plugins.gramplet',
|
2013-01-09 03:24:31 +05:30
|
|
|
'gramps.plugins.graph',
|
2016-05-18 15:17:34 +05:30
|
|
|
'gramps.plugins.importer',
|
|
|
|
'gramps.plugins.lib',
|
|
|
|
'gramps.plugins.lib.maps',
|
|
|
|
'gramps.plugins.mapservices',
|
|
|
|
'gramps.plugins.quickview',
|
|
|
|
'gramps.plugins.rel',
|
|
|
|
'gramps.plugins.sidebar',
|
2013-01-09 03:24:31 +05:30
|
|
|
'gramps.plugins.textreport',
|
2016-05-18 15:17:34 +05:30
|
|
|
'gramps.plugins.tool',
|
|
|
|
'gramps.plugins.view',
|
|
|
|
'gramps.plugins.webreport',
|
2013-01-09 03:24:31 +05:30
|
|
|
'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',
|
|
|
|
]
|
2016-01-07 01:54:27 +05:30
|
|
|
|
|
|
|
packages = package_core + package_gui
|
2012-05-20 04:26:19 +05:30
|
|
|
|
2013-01-09 03:24:31 +05:30
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Package data
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2013-01-03 05:01:07 +05:30
|
|
|
|
2012-09-30 16:00:08 +05:30
|
|
|
# add all subdirs of plugin with glade:
|
2013-01-09 03:24:31 +05:30
|
|
|
package_data_core = []
|
2012-09-30 17:49:14 +05:30
|
|
|
basedir = os.path.join('gramps', 'plugins')
|
2012-09-30 16:00:08 +05:30
|
|
|
for (dirpath, dirnames, filenames) in os.walk(basedir):
|
|
|
|
root, subdir = os.path.split(dirpath)
|
2016-05-18 15:17:34 +05:30
|
|
|
if subdir.startswith("."):
|
2012-09-30 16:00:08 +05:30
|
|
|
dirnames[:] = []
|
|
|
|
continue
|
|
|
|
for dirname in dirnames:
|
|
|
|
# Skip hidden and system directories:
|
|
|
|
if dirname.startswith("."):
|
|
|
|
dirnames.remove(dirname)
|
2012-09-30 17:49:14 +05:30
|
|
|
#we add to data_list so glade , xml, files are found, we don't need the gramps/ part
|
2013-01-09 03:24:31 +05:30
|
|
|
package_data_core.append(dirpath[7:] + '/' + dirname + '/*.glade')
|
|
|
|
package_data_core.append(dirpath[7:] + '/' + dirname + '/*.xml')
|
2016-11-12 19:31:15 +05:30
|
|
|
package_data_core.append(dirpath[7:] + '/' + dirname + '/*.ini')
|
2016-01-07 01:54:27 +05:30
|
|
|
|
2013-03-12 04:13:58 +05:30
|
|
|
package_data_core.append('gen/utils/resource-path')
|
2013-01-09 03:24:31 +05:30
|
|
|
|
|
|
|
package_data_gui = ['gui/glade/*.glade']
|
2016-01-07 01:54:27 +05:30
|
|
|
package_data = package_data_core + package_data_gui
|
2013-01-09 03:24:31 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Resources
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
data_files_core = [('share/mime-info', ['data/gramps.mime']),
|
|
|
|
('share/icons', ['images/gramps.png'])]
|
2016-10-28 02:38:40 +05:30
|
|
|
DOC_FILES = ['AUTHORS', 'COPYING', 'FAQ', 'INSTALL', 'NEWS', 'README.md',
|
|
|
|
'TODO']
|
2013-01-09 03:24:31 +05:30
|
|
|
GEDCOM_FILES = glob.glob(os.path.join('example', 'gedcom', '*.*'))
|
|
|
|
GRAMPS_FILES = glob.glob(os.path.join('example', 'gramps', '*.*'))
|
2013-06-24 04:17:25 +05:30
|
|
|
IMAGE_WEB = glob.glob(os.path.join('images', 'webstuff', '*.png'))
|
|
|
|
IMAGE_WEB.extend(glob.glob(os.path.join('images', 'webstuff','*.ico')))
|
|
|
|
IMAGE_WEB.extend(glob.glob(os.path.join('images', 'webstuff', '*.gif')))
|
|
|
|
CSS_FILES = glob.glob(os.path.join('data', 'css', '*.css'))
|
|
|
|
SWANKY_PURSE = glob.glob(os.path.join('data', 'css', 'swanky-purse', '*.css'))
|
|
|
|
SWANKY_IMG = glob.glob(os.path.join('data', 'css', 'swanky-purse', 'images', '*.png'))
|
2013-01-09 03:24:31 +05:30
|
|
|
data_files_core.append(('share/doc/gramps', DOC_FILES))
|
|
|
|
data_files_core.append(('share/doc/gramps/example/gedcom', GEDCOM_FILES))
|
2013-06-24 04:17:25 +05:30
|
|
|
data_files_core.append(('share/doc/gramps/example/gramps', GRAMPS_FILES))
|
2013-06-24 04:54:02 +05:30
|
|
|
data_files_core.append(('share/gramps/images/webstuff', IMAGE_WEB))
|
2013-06-24 04:17:25 +05:30
|
|
|
data_files_core.append(('share/gramps/css', CSS_FILES))
|
|
|
|
data_files_core.append(('share/gramps/css/swanky-purse', SWANKY_PURSE))
|
|
|
|
data_files_core.append(('share/gramps/css/swanky-purse/images', SWANKY_IMG))
|
2013-01-09 03:24:31 +05:30
|
|
|
|
|
|
|
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))
|
|
|
|
|
2015-07-05 14:49:49 +05:30
|
|
|
DTD_FILES = glob.glob(os.path.join('data', '*.dtd'))
|
|
|
|
RNG_FILES = glob.glob(os.path.join('data', '*.rng'))
|
2013-01-09 03:24:31 +05:30
|
|
|
XML_FILES = glob.glob(os.path.join('data', '*.xml'))
|
|
|
|
data_files_core.append(('share/gramps', XML_FILES))
|
2015-07-05 14:49:49 +05:30
|
|
|
data_files_core.append(('share/gramps', DTD_FILES))
|
|
|
|
data_files_core.append(('share/gramps', RNG_FILES))
|
2012-09-30 16:00:08 +05:30
|
|
|
|
2013-01-09 03:24:31 +05:30
|
|
|
data_files_gui = []
|
|
|
|
IMAGE_FILES = glob.glob(os.path.join('images', '*.*'))
|
2015-05-20 02:53:35 +05:30
|
|
|
THEME = os.path.join('images', 'hicolor')
|
|
|
|
ICON_16 = glob.glob(os.path.join(THEME, '16x16', 'actions', '*.png'))
|
|
|
|
ICON_22 = glob.glob(os.path.join(THEME, '22x22', 'actions', '*.png'))
|
2016-10-08 16:42:51 +05:30
|
|
|
ICON_24 = glob.glob(os.path.join(THEME, '24x24', 'actions', '*.png'))
|
2015-05-20 02:53:35 +05:30
|
|
|
ICON_48 = glob.glob(os.path.join(THEME, '48x48', 'actions', '*.png'))
|
|
|
|
ICON_SC = glob.glob(os.path.join(THEME, 'scalable', 'actions', '*.svg'))
|
2013-03-12 04:14:23 +05:30
|
|
|
data_files_gui.append(('share/gramps/images', IMAGE_FILES))
|
2015-05-20 02:53:35 +05:30
|
|
|
data_files_gui.append(('share/gramps/images/hicolor/16x16/actions', ICON_16))
|
|
|
|
data_files_gui.append(('share/gramps/images/hicolor/22x22/actions', ICON_22))
|
2016-10-08 16:42:51 +05:30
|
|
|
data_files_gui.append(('share/gramps/images/hicolor/24x24/actions', ICON_24))
|
2015-05-20 02:53:35 +05:30
|
|
|
data_files_gui.append(('share/gramps/images/hicolor/48x48/actions', ICON_48))
|
|
|
|
data_files_gui.append(('share/gramps/images/hicolor/scalable/actions', ICON_SC))
|
2013-01-09 03:24:31 +05:30
|
|
|
|
2016-01-07 01:54:27 +05:30
|
|
|
data_files = data_files_core + data_files_gui
|
2013-01-09 03:24:31 +05:30
|
|
|
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Setup
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2016-05-18 15:17:34 +05:30
|
|
|
setup(name = 'gramps',
|
2012-05-20 04:26:19 +05:30
|
|
|
description = ('Gramps (Genealogical Research and Analysis Management '
|
2016-05-18 15:17:34 +05:30
|
|
|
'Programming System)'),
|
2012-05-20 04:26:19 +05:30
|
|
|
long_description = ('Gramps (Genealogical Research and Analysis '
|
2012-09-30 16:00:08 +05:30
|
|
|
'Management Programming System) is a full featured '
|
2012-05-20 04:26:19 +05:30
|
|
|
'genealogy program supporting a Python based plugin '
|
|
|
|
'system.'),
|
2016-05-18 15:17:34 +05:30
|
|
|
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',
|
2012-05-20 04:26:19 +05:30
|
|
|
platforms = ['FreeBSD', 'Linux', 'MacOS', 'Windows'],
|
2013-07-31 23:51:42 +05:30
|
|
|
cmdclass = {'build': build, 'install': install, 'test': test},
|
2013-01-09 03:24:31 +05:30
|
|
|
packages = packages,
|
|
|
|
package_data = {'gramps': package_data},
|
2013-02-01 04:00:02 +05:30
|
|
|
data_files = data_files,
|
2015-03-16 07:43:24 +05:30
|
|
|
scripts = ['scripts/gramps'],
|
|
|
|
classifiers = [
|
2017-05-23 23:00:29 +05:30
|
|
|
"Development Status :: 1 - Planning",
|
2015-12-22 01:26:41 +05:30
|
|
|
"Environment :: Console",
|
|
|
|
"Environment :: MacOS X",
|
|
|
|
"Environment :: Plugins",
|
|
|
|
"Environment :: Web Environment",
|
|
|
|
"Environment :: Win32 (MS Windows)",
|
|
|
|
"Environment :: X11 Applications :: GTK",
|
|
|
|
"Intended Audience :: Education",
|
|
|
|
"Intended Audience :: End Users/Desktop",
|
|
|
|
"Intended Audience :: Other Audience",
|
|
|
|
"Intended Audience :: Science/Research",
|
|
|
|
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
|
|
|
|
"Natural Language :: Arabic",
|
|
|
|
"Natural Language :: Bulgarian",
|
|
|
|
"Natural Language :: Catalan",
|
|
|
|
"Natural Language :: Chinese (Simplified)",
|
|
|
|
"Natural Language :: Croatian",
|
|
|
|
"Natural Language :: Czech",
|
|
|
|
"Natural Language :: Danish",
|
|
|
|
"Natural Language :: Dutch",
|
|
|
|
"Natural Language :: English",
|
|
|
|
"Natural Language :: Esperanto",
|
|
|
|
"Natural Language :: Finnish",
|
|
|
|
"Natural Language :: French",
|
|
|
|
"Natural Language :: German",
|
|
|
|
"Natural Language :: Greek",
|
|
|
|
"Natural Language :: Hebrew",
|
|
|
|
"Natural Language :: Hungarian",
|
2016-03-03 13:56:39 +05:30
|
|
|
"Natural Language :: Icelandic",
|
2015-12-22 01:26:41 +05:30
|
|
|
"Natural Language :: Italian",
|
|
|
|
"Natural Language :: Japanese",
|
|
|
|
"Natural Language :: Macedonian",
|
|
|
|
"Natural Language :: Norwegian",
|
|
|
|
"Natural Language :: Polish",
|
|
|
|
"Natural Language :: Portuguese",
|
|
|
|
"Natural Language :: Portuguese (Brazilian)",
|
|
|
|
"Natural Language :: Romanian",
|
|
|
|
"Natural Language :: Russian",
|
|
|
|
"Natural Language :: Serbian",
|
|
|
|
"Natural Language :: Slovak",
|
|
|
|
"Natural Language :: Slovenian",
|
|
|
|
"Natural Language :: Spanish",
|
|
|
|
"Natural Language :: Swedish",
|
|
|
|
"Natural Language :: Turkish",
|
|
|
|
"Natural Language :: Vietnamese",
|
|
|
|
"Operating System :: MacOS",
|
|
|
|
"Operating System :: Microsoft :: Windows",
|
|
|
|
"Operating System :: Other OS",
|
|
|
|
"Operating System :: POSIX :: BSD",
|
|
|
|
"Operating System :: POSIX :: Linux",
|
|
|
|
"Operating System :: POSIX :: SunOS/Solaris",
|
|
|
|
"Operating System :: Unix",
|
|
|
|
"Programming Language :: Python",
|
|
|
|
"Programming Language :: Python :: 3",
|
|
|
|
"Topic :: Database",
|
|
|
|
"Topic :: Desktop Environment :: Gnome",
|
|
|
|
"Topic :: Education",
|
|
|
|
"Topic :: Scientific/Engineering :: Visualization",
|
|
|
|
"Topic :: Sociology :: Genealogy",
|
2015-03-16 07:43:24 +05:30
|
|
|
]
|
2012-05-20 04:26:19 +05:30
|
|
|
)
|