From eb3b4323e4458d58cb5339893a20ef1899585d32 Mon Sep 17 00:00:00 2001 From: yomguy Date: Fri, 9 Mar 2012 16:25:17 +0100 Subject: [PATCH] add old install --- install.py | 209 ++++++++++++++++++++++++++++++ telecaster/media/silence_mono.mp3 | Bin 122880 -> 0 bytes telecaster/media/silence_mono.ogg | Bin 4900 -> 0 bytes 3 files changed, 209 insertions(+) create mode 100755 install.py delete mode 100644 telecaster/media/silence_mono.mp3 delete mode 100644 telecaster/media/silence_mono.ogg diff --git a/install.py b/install.py new file mode 100755 index 0000000..f23ae5e --- /dev/null +++ b/install.py @@ -0,0 +1,209 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Copyright Guillaume Pellerin (2006-2010) + +# + +# This software is a computer program whose purpose is to stream audio +# and video data through icecast2 servers. + +# This software is governed by the CeCILL license under French law and +# abiding by the rules of distribution of free software. You can use, +# modify and/ or redistribute the software under the terms of the CeCILL +# license as circulated by CEA, CNRS and INRIA at the following URL +# "http://www.cecill.info". + +# As a counterpart to the access to the source code and rights to copy, +# modify and redistribute granted by the license, users are provided only +# with a limited warranty and the software's author, the holder of the +# economic rights, and the successive licensors have only limited +# liability. + +# In this respect, the user's attention is drawn to the risks associated +# with loading, using, modifying and/or developing or reproducing the +# software by the user in light of its specific status of free software, +# that may mean that it is complicated to manipulate, and that also +# therefore means that it is reserved for developers and experienced +# professionals having in-depth computer knowledge. Users are therefore +# encouraged to load and test the software's suitability as regards their +# requirements in conditions enabling the security of their systems and/or +# data to be ensured and, more generally, to use and operate it in the +# same conditions as regards security. + +# The fact that you are presently reading this means that you have had +# knowledge of the CeCILL license and that you accept its terms. + +# Author: Guillaume Pellerin + +# ONLY FOR GNU/LINUX Debian + +import os, sys +import platform +import shutil +from optparse import OptionParser + + +def cleanup(path): + for root, dirs, files in os.walk(path): + for dir in dirs: + if '.svn' in dir or '.git' in dir: + shutil.rmtree(root + os.sep + dir) + +class Install(object): + + def __init__(self, options): + self.options = options + self.app_dir = os.getcwd() + self.user = 'telecaster' + self.home = '/home/' + self.user + + self.install_dir = '/var/www/telecaster' + self.rss_dir = '/var/www/rss' + self.m3u_dir = '/var/www/m3u' + self.log_dir = '/var/log/telecaster' + self.deefuzzer_log_dir = '/var/log/deefuzzer' + self.conf_dir = '/etc/telecaster' + self.stream_m_conf_dir = '/etc/stream-m' + self.init_dirs = ['/etc/init.d/', '/etc/default/'] + self.daemons = ['jackd', 'vncserver', 'stream-m'] + self.apache_conf = '/etc/apache2/sites-available/telecaster.conf' + + def create_user(self): + if not os.path.exists(self.home): + print 'Please give some informations for the new "telecaster" user :' + os.system('adduser ' + self.user) + os.system('adduser ' + self.user + ' audio') + + def chown(self, dir): + os.system('chown -R ' + self.user + ':' + self.user + ' ' + dir) + + def install_deps(self): + # compiling edcast-jack + os.chdir(self.app_dir + '/vendor/edcast-jack') + os.system('./configure; make; make install') + + # Install DeeFuzzer + os.system('pip install deefuzzer') + + # Install Stream-m + os.chdir(self.app_dir) + os.system('cp -ra vendor/stream-m /usr/local/lib/') + init_link = '/usr/local/bin/stream-m' + if not os.path.islink(init_link): + os.system('ln -s /usr/local/lib/stream-m/bin/stream-m '+init_link) + + def install_app(self): + os.chdir(self.app_dir) + + if os.path.exists(self.install_dir): + shutil.rmtree(self.install_dir) + + shutil.copytree(self.app_dir, self.install_dir,ignore=shutil.ignore_patterns('edcast-jack*', 'deefuzzer*', '*.svn*', '*.bzr*', '*.git')) + os.system('chown -R ' + self.user + ':' + self.user + ' ' + self.install_dir) + os.system('chmod 755 ' + self.install_dir + '/telecaster.py') + + def install_conf(self): + os.chdir(self.app_dir) + + for conf_dir in [self.conf_dir, self.stream_m_conf_dir]: + in_files = os.listdir('conf'+conf_dir) + if not os.path.exists(conf_dir): + os.makedirs(conf_dir) + for file in in_files: + shutil.copy('conf'+conf_dir+os.sep+file, conf_dir+os.sep+file) + self.chown(conf_dir) + + for dir in os.listdir('conf/home'): + home_dir = self.home + '/.' + dir + if not os.path.exists(home_dir): + os.makedirs(home_dir) + os.system('cp -r conf/home/'+dir + '/* ' + home_dir) + self.chown(home_dir) + + shutil.copy('conf'+self.apache_conf, self.apache_conf) + os.system('a2ensite telecaster.conf') + os.system('/etc/init.d/apache2 reload') + + dir = '/etc/pm/' + os.system('cp -r conf' + dir + '* ' + dir) + + def install_init(self): + os.chdir(self.app_dir) + + dirs = [self.rss_dir, self.m3u_dir, self.log_dir, self.deefuzzer_log_dir, self.conf_dir, self.stream_m_conf_dir] + for dir in dirs: + if not os.path.exists(dir): + os.makedirs(dir) + self.chown(dir) + + for init_dir in self.init_dirs: + for daemon in self.daemons: + path = init_dir + daemon + shutil.copy('conf'+path, path) + os.system('sudo chmod 755 '+path) + + init_link = '/etc/rc2.d/S97jackd' + if not os.path.islink(init_link): + os.system('ln -s /etc/init.d/jackd '+init_link) + + init_link = '/etc/rc2.d/S99vncserver' + if not os.path.islink(init_link): + os.system('ln -s /etc/init.d/vncserver '+init_link) + + init_link = '/etc/rc2.d/S98stream-m' + if not os.path.islink(init_link): + os.system('ln -s /etc/init.d/stream-m '+init_link) + + os.system('cp -r conf/usr/* /usr/') + + def run(self): + if self.options['keepinit'] == False: + print 'Installing init files...' + self.install_init() + if self.options['keepmods'] == False: + print 'Installing dependencies...' + self.install_deps() + if self.options['keepconf'] == False: + print 'Installing config files...' + self.install_conf() + print 'Installing application...' + self.install_app() + + +def main(): + parser = OptionParser() + parser.add_option("-c", "--keepconf", dest="keepconf", default=False, action="store_true", + help="do NOT overwrite config files") + parser.add_option("-i", "--keepinit", dest="keepinit", default=False, action="store_true", + help="do NOT overwrite init files") + parser.add_option("-m", "--keepmods", dest="keepmods", default=False, action="store_true", + help="do NOT overwrite or install modules") + + (options, args) = parser.parse_args() + install = Install(vars(options)) + install.run() + + print """ + Installation successfull ! + + Now, please : + - configure your telecaster editing: + /etc/telecaster/telecaster.xml + /etc/telecaster/deefuzzer.xml + + - configure your apache VirtualHost editing /etc/apache2/sites-available/telecaster.conf + + - REBOOT to setup audio and video servers ! + + - use the TeleCaster system browsing http://127.0.0.1/telecaster/telecaster.py + + See README for more infos. + """ + + +if __name__ == '__main__': + main() + + + diff --git a/telecaster/media/silence_mono.mp3 b/telecaster/media/silence_mono.mp3 deleted file mode 100644 index b9514968a43484ea26556a12ffed384e755c50df..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 122880 zcmeI&e}vz40LSs~?T6A2t&~LU8zV_`ciXawY`f07+O>20o}5a~?z>F4?>G1Te$zyz zL?RMNM3yCqL?j}Ui$o+cQ4*0vA`+wZxuuzH&pLa3Za%*EJkD<4*ZtV%@qXUN{`idD zwP|&&cw0B$7;6j{A6!wq?>#WrZ0&2-hqiPY6Qe`LE0+}S)9r)1dWRZ2cJD0ya(VII zXwEf9W;)&G{K%g1@#2N`#rxvhSgSkVuFp32&-CWH_0HmVEB zgF}Oj$&q`D4_6iMLyeI=_Z5FG{-lv!r`tYQeBhe`3Mim}0t)n-z{wL63+G(ZSZjZ~ zc=4*@e+AoX1IO3YR;|7CvMbkJbKUhf+_?Ux4L9F%>&C%Nw{N}U&h0x#@4jbzVsh&K z=?5R4nSJEIqpim}k3aF`Q-_~^_POU@c=4r|UwQSl*N+^1>+N^meeeAbKK$t8W1oEb z+2>z;`PJ9Qzxnq2AAbDl=U;yP?e{iY^S15YF+RF!8y18)|8t=(3Lw>w1>{lw%9MVLC$swP~Ax$)x9P*hQ(nN#FA)m=1O*EJs@|hgc zM1#p8pUELjG?*OnnHlw%9MVLC$swP~Ax$)tmRv;+XsQn{Xky`w zv!DOFkTb8y36*w0Q(n-8WbprA;|ZaW$stWNm>lw%9MVLC$swP~Ax$)x9P*hQ(nN#F zA)m=1O*EJs@|hgcM1#p8pUELjG?*OnnHlw%9MVLC$swP~Ax$)x z9P*hQ(nN#FA)m=1O*EJs@|hgcM1#p8U%w?+k?ZmKzZFxQ&;Q|3XM=Zb^sC5S&J*&4 zP+)lmlS5Z;3P=+TCWm|`hcwY(a>!?LND~bvhkPc7G|^yk$Y*j$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