libretime/python_apps/airtime_analyzer/setup.py

59 lines
2.0 KiB
Python
Raw Normal View History

2020-01-16 14:33:44 +01:00
from __future__ import print_function
from setuptools import setup
from subprocess import call
import sys
import os
# Change directory since setuptools uses relative paths
script_path = os.path.dirname(os.path.realpath(__file__))
2020-01-16 14:33:44 +01:00
print(script_path)
os.chdir(script_path)
# Allows us to avoid installing the upstart init script when deploying airtime_analyzer
# on Airtime Pro:
if '--no-init-script' in sys.argv:
data_files = []
sys.argv.remove('--no-init-script') # super hax
else:
Vagrant Debian support (and experimental CentOS) This changes the Vagrant setup to support multiple installations as multiple boxes. In addition to Ubuntu Vagrant can now be used to install on Debian as well as on CentOS. I took the chance to clean up the .deb install a bit and backported analyzer and celery to SysV proper so it runs there. Some of the distro specfics were moved to the install script from the python setup scripts to acheive this. For the CentOS support I added a rather involved OS prepare script. In the long term this will be added to the preparing-the-server docs we already have. I had to switch the default port to http-alt (8080). On CentOS 9080 is registered for ocsp and getting it to work for apache without hacking SELinux is hard. I think 8080 is the RFC way to go anyhow. If anyone want to override this it should be rather easy using the --web-port arg and by hacking Vagrantfile. The PyOpenSSL code has been refactored for all the distros that the Vagrantfile now supports. As far as my checks go, I tried this code with all the distros, uploaded a track and downloaded a unicode and a ssl podcast and was able to listen to them in each case. In the experimental CentOS case, the UI is not up to spec since services need to get scheduled through systemctl and the status overview (ie. on the /?config page) do not work properly. They need to be as follows: ``` sudo systemctl start airtime-playout sudo systemctl start airtime-liquidsoap sudo systemctl start airtime_analyzer.service sudo systemctl start airtime-celery.service ```
2017-03-08 12:39:59 +01:00
data_files = [('/etc/init', ['install/upstart/airtime_analyzer.conf']),
('/etc/init.d', ['install/sysvinit/airtime_analyzer'])]
2020-01-16 14:33:44 +01:00
print(data_files)
setup(name='airtime_analyzer',
version='0.1',
description='Airtime Analyzer Worker and File Importer',
url='http://github.com/sourcefabric/Airtime',
author='Albert Santoni',
author_email='albert.santoni@sourcefabric.org',
license='MIT',
packages=['airtime_analyzer'],
scripts=['bin/airtime_analyzer'],
2020-01-16 14:48:17 +01:00
install_requires=[
'mutagen==1.42.0',
'pika~=1.1.0',
2020-01-16 14:48:17 +01:00
'file-magic',
'nose',
'coverage',
'mock',
2020-01-16 15:32:51 +01:00
'python-daemon',
2020-01-16 14:48:17 +01:00
'requests>=2.7.0',
'rgain3==1.0.0',
'pycairo==1.19.1',
'PyGObject<=3.36.1',
2020-01-16 14:48:17 +01:00
# These next 3 are required for requests to support SSL with SNI. Learned this the hard way...
# What sucks is that GCC is required to pip install these.
#'ndg-httpsclient',
#'pyasn1',
#'pyopenssl'
],
zip_safe=False,
data_files=data_files)
# Remind users to reload the initctl config so that "service start airtime_analyzer" works
if data_files:
2020-01-16 14:33:44 +01:00
print("Remember to reload the initctl configuration")
print("Run \"sudo initctl reload-configuration; sudo service airtime_analyzer restart\" now.")
print("Or on Ubuntu Xenial (16.04)")
print("Remember to reload the systemd configuration")
print("Run \"sudo systemctl daemon-reload; sudo service airtime_analyzer restart\" now.")