2021-05-27 15:21:02 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
2020-01-16 14:33:44 +01:00
|
|
|
from __future__ import print_function
|
2014-12-17 22:42:29 +01:00
|
|
|
from setuptools import setup
|
|
|
|
from subprocess import call
|
|
|
|
import sys
|
2014-12-17 23:05:55 +01:00
|
|
|
import os
|
2014-12-17 22:42:29 +01:00
|
|
|
|
2014-12-17 23:05:55 +01:00
|
|
|
script_path = os.path.dirname(os.path.realpath(__file__))
|
2020-01-16 14:33:44 +01:00
|
|
|
print(script_path)
|
2014-12-17 23:05:55 +01:00
|
|
|
os.chdir(script_path)
|
|
|
|
|
|
|
|
# Allows us to avoid installing the upstart init script when deploying on Airtime Pro:
|
2014-12-17 22:42:29 +01:00
|
|
|
if '--no-init-script' in sys.argv:
|
|
|
|
data_files = []
|
|
|
|
sys.argv.remove('--no-init-script') # super hax
|
|
|
|
else:
|
2015-01-15 22:33:33 +01:00
|
|
|
pypo_files = []
|
|
|
|
for root, dirnames, filenames in os.walk('pypo'):
|
|
|
|
for filename in filenames:
|
|
|
|
pypo_files.append(os.path.join(root, filename))
|
2020-01-16 15:32:51 +01:00
|
|
|
|
2015-01-15 22:33:33 +01:00
|
|
|
data_files = [
|
2015-02-13 22:06:59 +01:00
|
|
|
('/etc/init', ['install/upstart/airtime-playout.conf.template']),
|
|
|
|
('/etc/init', ['install/upstart/airtime-liquidsoap.conf.template']),
|
|
|
|
('/etc/init.d', ['install/sysvinit/airtime-playout']),
|
|
|
|
('/etc/init.d', ['install/sysvinit/airtime-liquidsoap']),
|
2015-01-15 22:33:33 +01:00
|
|
|
('/var/log/airtime/pypo', []),
|
2015-01-15 23:33:47 +01:00
|
|
|
('/var/log/airtime/pypo-liquidsoap', []),
|
2015-01-15 22:33:33 +01:00
|
|
|
('/var/tmp/airtime/pypo', []),
|
|
|
|
('/var/tmp/airtime/pypo/cache', []),
|
|
|
|
('/var/tmp/airtime/pypo/files', []),
|
|
|
|
('/var/tmp/airtime/pypo/tmp', []),
|
|
|
|
]
|
2020-01-16 14:33:44 +01:00
|
|
|
print(data_files)
|
2014-12-17 22:42:29 +01:00
|
|
|
|
|
|
|
setup(name='airtime-playout',
|
2014-12-19 15:47:54 +01:00
|
|
|
version='1.0',
|
2014-12-17 23:05:55 +01:00
|
|
|
description='Airtime Playout Engine',
|
2014-12-17 22:42:29 +01:00
|
|
|
url='http://github.com/sourcefabric/Airtime',
|
|
|
|
author='sourcefabric',
|
|
|
|
license='AGPLv3',
|
2015-02-13 22:06:59 +01:00
|
|
|
packages=['pypo', 'pypo.media', 'pypo.media.update',
|
2017-03-28 12:26:11 +02:00
|
|
|
'liquidsoap'],
|
2020-12-26 13:24:10 +01:00
|
|
|
package_data={'': ['**/*.liq', '*.cfg', '*.types']},
|
2014-12-17 22:42:29 +01:00
|
|
|
scripts=[
|
|
|
|
'bin/airtime-playout',
|
2015-01-28 00:43:36 +01:00
|
|
|
'bin/airtime-liquidsoap',
|
|
|
|
'bin/pyponotify'
|
2014-12-17 22:42:29 +01:00
|
|
|
],
|
|
|
|
install_requires=[
|
|
|
|
'amqplib',
|
|
|
|
'anyjson',
|
|
|
|
'argparse',
|
|
|
|
'configobj',
|
|
|
|
'docopt',
|
2018-12-23 11:01:25 +01:00
|
|
|
'future',
|
2014-12-17 22:42:29 +01:00
|
|
|
'kombu',
|
|
|
|
'mutagen',
|
|
|
|
'PyDispatcher',
|
|
|
|
'pyinotify',
|
|
|
|
'pytz',
|
2015-05-23 00:43:05 +02:00
|
|
|
'requests',
|
2020-01-23 11:37:49 +01:00
|
|
|
'defusedxml',
|
|
|
|
'packaging',
|
2014-12-17 22:42:29 +01:00
|
|
|
],
|
|
|
|
zip_safe=False,
|
|
|
|
data_files=data_files)
|
|
|
|
|
2014-12-19 15:47:54 +01:00
|
|
|
# Reload the initctl config so that playout services works
|
2014-12-17 22:42:29 +01:00
|
|
|
if data_files:
|
2020-01-16 14:33:44 +01:00
|
|
|
print("Reloading initctl configuration")
|
2015-02-13 17:32:07 +01:00
|
|
|
#call(['initctl', 'reload-configuration'])
|
2020-01-16 14:33:44 +01:00
|
|
|
print("Run \"sudo service airtime-playout start\" and \"sudo service airtime-liquidsoap start\"")
|