Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
aa610c2a61
|
@ -44,7 +44,7 @@ def download_if_needed(vdi_dir, xml_dir, vm_name, vm_vdi_file, vm_xml_file):
|
|||
local("wget %s/%s/%s -O %s"%(env.vm_download_url, vm_name, vm_xml_file, os.path.join(xml_dir, vm_xml_file)))
|
||||
|
||||
|
||||
def create_fresh_os(vm_name):
|
||||
def create_fresh_os(vm_name, debian=False):
|
||||
|
||||
vm_vdi_file = '%s.vdi'%vm_name
|
||||
vm_xml_file = '%s.xml'%vm_name
|
||||
|
@ -84,6 +84,9 @@ def create_fresh_os(vm_name):
|
|||
env.hosts.append(ip_addr)
|
||||
env.host_string = ip_addr
|
||||
|
||||
if debian:
|
||||
append('/etc/apt/sources.list', "deb http://www.debian-multimedia.org squeeze main non-free", use_sudo=True)
|
||||
|
||||
|
||||
|
||||
def ubuntu_lucid_32(fresh_os=True):
|
||||
|
@ -101,13 +104,17 @@ def ubuntu_natty_32(fresh_os=True):
|
|||
def ubuntu_natty_64(fresh_os=True):
|
||||
if (fresh_os):
|
||||
create_fresh_os('Ubuntu_11.04_64')
|
||||
|
||||
def debian_squeeze_64(fresh_os=True):
|
||||
if (fresh_os):
|
||||
create_fresh_os('Debian_Squeeze_64', debian=True)
|
||||
|
||||
|
||||
def compile_liquidsoap(filename="liquidsoap"):
|
||||
|
||||
sudo('apt-get update')
|
||||
sudo('apt-get upgrade -y')
|
||||
sudo('sudo apt-get install -y libocamlcvs-ocaml-dev ocaml-findlib libao-ocaml-dev libportaudio-ocaml-dev ' + \
|
||||
sudo('apt-get upgrade -y --force-yes')
|
||||
sudo('sudo apt-get install -y --force-yes libocamlcvs-ocaml-dev ocaml-findlib libao-ocaml-dev libportaudio-ocaml-dev ' + \
|
||||
'libmad-ocaml-dev libtaglib-ocaml-dev libalsa-ocaml-dev libtaglib-ocaml-dev libvorbis-ocaml-dev ' + \
|
||||
'libspeex-dev libspeexdsp-dev speex libladspa-ocaml-dev festival festival-dev ' + \
|
||||
'libsamplerate-dev libxmlplaylist-ocaml-dev libxmlrpc-light-ocaml-dev libflac-dev ' + \
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import platform
|
||||
import shutil
|
||||
from subprocess import Popen
|
||||
from subprocess import Popen, PIPE
|
||||
import sys
|
||||
import os
|
||||
sys.path.append('/usr/lib/airtime/api_clients/')
|
||||
|
@ -11,6 +11,7 @@ if os.geteuid() != 0:
|
|||
print "Please run this as root."
|
||||
sys.exit(1)
|
||||
|
||||
"""
|
||||
def is_natty():
|
||||
try:
|
||||
f = open('/etc/lsb-release')
|
||||
|
@ -25,7 +26,27 @@ def is_natty():
|
|||
if split[0] == "DISTRIB_CODENAME" and (split[1] == "natty" or split[1] == "oneiric"):
|
||||
return True
|
||||
return False
|
||||
|
||||
"""
|
||||
|
||||
"""
|
||||
This function returns the codename of the host OS by querying lsb_release.
|
||||
If lsb_release does not exist, or an exception occurs the codename returned
|
||||
is 'unknown'
|
||||
"""
|
||||
def get_os_codename():
|
||||
try:
|
||||
p = Popen("which lsb_release", shell=True)
|
||||
sts = os.waitpid(p.pid, 0)[1]
|
||||
|
||||
if (sts == 0):
|
||||
#lsb_release is available on this system. Let's get the os codename
|
||||
p = Popen("lsb_release -sc", shell=True, stdout=PIPE)
|
||||
return p.communicate()[0].strip('\r\n')
|
||||
except Exception, e:
|
||||
pass
|
||||
|
||||
return "unknown"
|
||||
|
||||
def get_current_script_dir():
|
||||
current_script_dir = os.path.realpath(__file__)
|
||||
index = current_script_dir.rindex('/')
|
||||
|
@ -56,6 +77,9 @@ def generate_liquidsoap_config(ss):
|
|||
|
||||
PATH_INI_FILE = '/etc/airtime/pypo.cfg'
|
||||
|
||||
#any debian/ubuntu codename in this et will automatically use the natty liquidsoap binary
|
||||
codenames_for_natty_binary = set(["natty", "oneiric", "precise", "squeeze"])
|
||||
|
||||
# load config file
|
||||
try:
|
||||
config = ConfigObj(PATH_INI_FILE)
|
||||
|
@ -68,7 +92,10 @@ try:
|
|||
|
||||
#select appropriate liquidsoap file for given system os/architecture
|
||||
architecture = platform.architecture()[0]
|
||||
natty = is_natty()
|
||||
#natty = is_natty()
|
||||
|
||||
codename = get_os_codename()
|
||||
natty = codename in codenames_for_natty_binary
|
||||
|
||||
print "* Detecting system architecture for Liquidsoap"
|
||||
|
||||
|
|
Loading…
Reference in New Issue