mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 07:52:35 +03:00
use Babel to compile localizations and include in source tarball
python3-babel was also included in the gitlab-ci docker image:
ffc08dbc1d
This commit is contained in:
parent
57c3c60f0e
commit
49bd5a6462
4 changed files with 71 additions and 19 deletions
38
setup.py
38
setup.py
|
@ -2,14 +2,31 @@
|
|||
|
||||
from setuptools import setup
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import sys
|
||||
|
||||
# workaround issue on OSX or --user installs, where sys.prefix is not an installable location
|
||||
if os.access(sys.prefix, os.W_OK | os.X_OK):
|
||||
data_prefix = sys.prefix
|
||||
else:
|
||||
data_prefix = '.'
|
||||
|
||||
def get_data_files():
|
||||
# workaround issue on OSX or --user installs, where sys.prefix is not an installable location
|
||||
if os.access(sys.prefix, os.W_OK | os.X_OK):
|
||||
data_prefix = sys.prefix
|
||||
else:
|
||||
data_prefix = '.'
|
||||
|
||||
data_files = []
|
||||
with open('MANIFEST.in') as fp:
|
||||
data = fp.read()
|
||||
|
||||
data_files.append((data_prefix + '/share/doc/fdroidserver/examples',
|
||||
['buildserver/config.buildserver.py', ]
|
||||
+ re.findall(r'include (examples/.*)', data)))
|
||||
|
||||
for f in re.findall(r'include (locale/[a-z][a-z][a-zA-Z_]*/LC_MESSAGES/fdroidserver.mo)', data):
|
||||
d = os.path.join(data_prefix, 'share', os.path.dirname(f))
|
||||
data_files.append((d, [f, ]))
|
||||
return data_files
|
||||
|
||||
|
||||
# PyPI accepts reST not Markdown
|
||||
if os.path.exists('README.md'):
|
||||
|
@ -37,16 +54,7 @@ setup(name='fdroidserver',
|
|||
license='AGPL-3.0',
|
||||
packages=['fdroidserver', 'fdroidserver.asynchronousfilereader'],
|
||||
scripts=['fdroid', 'fd-commit', 'makebuildserver'],
|
||||
data_files=[
|
||||
(data_prefix + '/share/doc/fdroidserver/examples',
|
||||
['buildserver/config.buildserver.py',
|
||||
'examples/config.py',
|
||||
'examples/fdroid-icon.png',
|
||||
'examples/makebuildserver.config.py',
|
||||
'examples/opensc-fdroid.cfg',
|
||||
'examples/public-read-only-s3-bucket-policy.json',
|
||||
'examples/template.yml']),
|
||||
],
|
||||
data_files=get_data_files(),
|
||||
python_requires='>=3.4',
|
||||
install_requires=[
|
||||
'clint',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue