fenrir/setup.py

124 lines
4.2 KiB
Python
Raw Normal View History

#!/bin/python
2017-05-23 17:00:46 +02:00
#https://python-packaging.readthedocs.io/en/latest/minimal.html
2017-10-21 16:03:03 +02:00
import os, glob, sys
import os.path
from shutil import copyfile
from setuptools import find_packages
from setuptools import setup
2018-06-08 00:13:27 +02:00
fenrirVersion = '1.9'
2018-06-08 20:44:33 +02:00
packageVersion = 'post2'
2017-10-21 16:03:03 +02:00
# handle flags for package manager like yaourt and pacaur.
forceSettings = False
if "--force-settings" in sys.argv:
forceSettings = True
sys.argv.remove("--force-settings")
2017-07-25 17:19:40 +02:00
data_files = []
2017-07-25 17:50:59 +02:00
directories = glob.glob('config/*')
2017-07-25 17:19:40 +02:00
for directory in directories:
2017-07-25 17:50:59 +02:00
files = glob.glob(directory+'/*')
destDir = ''
2017-07-25 17:46:38 +02:00
if 'config/punctuation' in directory :
destDir = '/etc/fenrirscreenreader/punctuation'
2017-07-25 17:46:38 +02:00
elif 'config/keyboard' in directory:
destDir = '/etc/fenrirscreenreader/keyboard'
2017-07-25 17:46:38 +02:00
elif 'config/settings' in directory:
destDir = '/etc/fenrirscreenreader/settings'
2017-10-21 16:03:03 +02:00
if not forceSettings:
try:
del(files[files.index('config/settings/settings.conf')])
except:
pass
2017-07-25 17:46:38 +02:00
elif 'config/scripts' in directory:
destDir = '/usr/share/fenrirscreenreader/scripts'
2017-07-25 17:50:59 +02:00
if destDir != '':
data_files.append((destDir, files))
2017-07-25 18:00:06 +02:00
2017-07-26 00:09:17 +02:00
files = glob.glob('config/sound/default/*')
destDir = '/usr/share/sounds/fenrirscreenreader/default'
2017-07-26 00:09:17 +02:00
data_files.append((destDir, files))
files = glob.glob('config/sound//template/*')
destDir = '/usr/share/sounds/fenrirscreenreader/template'
2017-07-26 00:09:17 +02:00
data_files.append((destDir, files))
2017-07-25 23:46:59 +02:00
files = glob.glob('tools/*')
data_files.append(('/usr/share/fenrirscreenreader/tools', files))
2017-08-23 21:35:29 +02:00
data_files.append(('/usr/share/man/man1', ['docu/fenrir.1']))
2017-07-25 17:19:40 +02:00
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
# Application name:
2017-10-02 19:09:25 +02:00
name="fenrir-screenreader",
# Version number:
version=fenrirVersion + '.' + packageVersion,
2017-07-25 10:58:37 +02:00
# description
description="A TTY Screen Reader for Linux.",
2017-07-25 10:58:37 +02:00
long_description=read('README.md'),
2017-07-25 13:50:34 +02:00
keywords=['screenreader', 'a11y', 'accessibility', 'terminal', 'TTY', 'console'],
2017-07-25 10:58:37 +02:00
license="License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
url="https://github.com/chrys87/fenrir/",
2017-07-25 13:48:55 +02:00
download_url = 'https://github.com/chrys87/fenrir/archive/' + fenrirVersion + '.tar.gz',
2017-07-25 10:58:37 +02:00
classifiers=[
"Programming Language :: Python",
2017-08-24 11:42:37 +02:00
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
2017-07-25 10:58:37 +02:00
"Development Status :: 5 - Production/Stable",
2017-07-25 13:48:55 +02:00
"Topic :: Multimedia :: Sound/Audio :: Speech",
2017-07-25 10:58:37 +02:00
"Environment :: Console",
],
# Application author details:
author="Chrys, Storm_dragon, Jeremiah and others",
2017-07-25 10:58:37 +02:00
author_email="chrysg@linux-a11y.org",
# Packages
packages=find_packages('src/'),
package_dir={'': 'src/'},
2018-03-28 18:23:26 +02:00
scripts=['src/fenrir','src/fenrir-daemon'],
# Include additional files into the package
include_package_data=True,
zip_safe=False,
2017-07-25 16:59:19 +02:00
2017-07-25 17:19:40 +02:00
data_files=data_files,
2017-07-25 10:58:37 +02:00
# Dependent packages (distributions)
install_requires=[
"evdev",
2017-08-15 23:49:40 +02:00
"daemonize",
2017-07-25 15:35:49 +02:00
"dbus-python",
2017-07-25 15:58:02 +02:00
"pyudev",
2017-07-25 15:19:13 +02:00
"setuptools",
2017-10-21 00:43:16 +02:00
"pexpect",
2017-10-25 00:48:48 +02:00
"pyttsx3",
2018-03-28 15:40:21 +02:00
"pyte",
],
)
2017-10-21 16:03:03 +02:00
if not forceSettings:
print('')
# create settings file from example if not exist
if not os.path.isfile('/etc/fenrirscreenreader/settings/settings.conf'):
2017-10-21 16:03:03 +02:00
try:
copyfile('/etc/fenrirscreenreader/settings/settings.conf.example', '/etc/fenrirscreenreader/settings/settings.conf')
print('create settings file in /etc/fenrirscreenreader/settings/settings.conf')
2017-10-21 16:03:03 +02:00
except:
pass
else:
print('settings.conf file found. It is not overwritten automatical')
2017-07-26 09:35:08 +02:00
print('')
print('To have Fenrir start at boot:')
2017-07-26 09:35:08 +02:00
print('sudo systemctl enable fenrir')
print('Pulseaudio users may want to run:')
print('/usr/share/fenrirscreenreader/tools/configure_pulse.sh')
print('once as their user account and once as root to configure Pulseaudio.')
print('Please install the following packages manually:')
print('- Speech-dispatcher: for the default speech driver')
print('- Espeak: as basic TTS engine')
print('- BrlTTY: for Braille')
print('- sox: is a player for the generic sound driver')