]> git.parisson.com Git - telecaster-cgi.git/commitdiff
add install (for debian)
authoryomguy <yomguy@parisson.com>
Thu, 8 Jul 2010 23:37:00 +0000 (23:37 +0000)
committeryomguy <yomguy@parisson.com>
Thu, 8 Jul 2010 23:37:00 +0000 (23:37 +0000)
install.py [new file with mode: 0644]

diff --git a/install.py b/install.py
new file mode 100644 (file)
index 0000000..ad78dd7
--- /dev/null
@@ -0,0 +1,85 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# Copyright Guillaume Pellerin (2006-2010)
+
+# <yomguy@parisson.com>
+
+# 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 <yomguy@parisson.com>
+
+# ONLY FOR GNU/LINUX Debian
+
+import os, sys
+import platform
+
+if len(sys.argv) == 1:
+    install_dir = '/usr/share/telecaster'
+elif len(sys.argv) > 2:
+    sys.exit('Give just one directory to install the TeleCaster, or none.')
+else:
+    install_dir = sys.argv[1]
+
+if not os.path.exists(install_dir):
+    os.mkdir(install_dir)
+
+os.system('cp -ra ./* ' + install_dir + os.sep)
+
+conf_dir = '/etc'
+if not os.path.exists(conf_dir):
+    os.mkdir(conf_dir)
+os.system('cp -ra ./conf/etc/* ' + conf_dir + os.sep)
+
+init_dir = '/etc/rc2.d'
+init_link = init_dir + os.sep + 'S97jackd'
+if not os.path.exists(init_link):
+    os.system('ln -s /etc/init.d/jackd ' + init_link)
+
+init_link = init_dir + os.sep + 'S99vncserver'
+if not os.path.exists(init_link):
+    os.system('ln -s /etc/init.d/vncserver ' + init_link)
+    
+user = raw_input('Give a user to use the TeleCaster system : ')
+home = os.sep + 'home' + os.sep + user + os.sep
+home_dirs = ['fluxbox', 'vnc']
+
+for dir in home_dirs:
+    home_dir = home + '.' + dir
+    if not os.path.exists(home_dir):
+        os.mkdir(home_dir)
+    os.system('cp ' + conf_dir + os.sep + 'telecaster/home/' + dir + '/* ' + home_dir)
+
+print """
+   Installation successfull !
+   Now configure your apache VirtualHost to get TeleCaster in your browser.
+   Please see conf/etc/apache2/default and README for more infos.
+   """
+