Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
276fa8d99e
airtime_mvc/public
install_full/apache
install_minimal
utils
|
@ -2,7 +2,6 @@ php_value post_max_size 500M
|
|||
php_value upload_max_filesize 500M
|
||||
php_value request_order "GPC"
|
||||
php_value session.gc_probability 0
|
||||
php_value upload_tmp_dir /tmp
|
||||
php_value date.timezone "America/Toronto"
|
||||
php_value phar.readonly Off
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<VirtualHost *:80>
|
||||
ServerAdmin foo@bar.org
|
||||
DocumentRoot /var/www/airtime/public
|
||||
php_admin_value upload_tmp_dir /tmp
|
||||
|
||||
<Directory /var/www/airtime/public>
|
||||
DirectoryIndex index.php
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
|
||||
echo -e "\n******************************** Install Begin *********************************"
|
||||
|
||||
# Absolute path to this script
|
||||
SCRIPT=`readlink -f $0`
|
||||
# Absolute directory this script is in
|
||||
SCRIPTPATH=`dirname $SCRIPT`
|
||||
|
||||
VIRTUAL_ENV_DIR="/usr/lib/airtime/airtime_virtualenv"
|
||||
if [ ! -d "$VIRTUAL_ENV_DIR" ]; then
|
||||
echo -e "\n*** Creating Vitualenv for Airtime ***"
|
||||
|
@ -13,6 +18,17 @@ fi
|
|||
echo -e "\n*** Installing Python Libraries ***"
|
||||
sudo /usr/lib/airtime/airtime_virtualenv/bin/pip install airtime_virtual_env.pybundle -E /usr/lib/airtime/airtime_virtualenv
|
||||
|
||||
echo -e "\n*** Patching Python Libraries ***"
|
||||
PACHES=${SCRIPTPATH}/patches/*
|
||||
for file in $(find $PACHES -print); do
|
||||
if [ -d $file ]; then
|
||||
DIRNAME=$(basename $file)
|
||||
echo -e "\n ---Applying Patches for $DIRNAME---"
|
||||
else
|
||||
sudo patch -N -p0 -i $file
|
||||
fi
|
||||
done
|
||||
cd
|
||||
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
||||
. ${virtualenv_bin}activate
|
||||
|
||||
|
@ -20,11 +36,6 @@ virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
|||
#return with a non-zero return value.
|
||||
set -e
|
||||
|
||||
# Absolute path to this script
|
||||
SCRIPT=`readlink -f $0`
|
||||
# Absolute directory this script is in
|
||||
SCRIPTPATH=`dirname $SCRIPT`
|
||||
|
||||
echo -e "\n*** Creating Pypo User ***"
|
||||
python ${SCRIPTPATH}/../python_apps/create-pypo-user.py
|
||||
|
||||
|
|
|
@ -106,8 +106,6 @@ passthru("python ".__DIR__."/../../python_apps/show-recorder/install/recorder-in
|
|||
echo PHP_EOL."*** Updating Media Monitor ***".PHP_EOL;
|
||||
passthru("python ".__DIR__."/../../python_apps/media-monitor/install/media-monitor-install.py");
|
||||
|
||||
AirtimeIni::CreateMonitFile();
|
||||
|
||||
sleep(4);
|
||||
passthru("airtime-check-system");
|
||||
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
Index: /usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/mutagen/mp3.py
|
||||
===================================================================
|
||||
--- /usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/mutagen/mp3.py (revision 108)
|
||||
+++ /usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/mutagen/mp3.py (working copy)
|
||||
@@ -151,15 +151,16 @@
|
||||
self.sample_rate = self.__RATES[self.version][sample_rate]
|
||||
|
||||
if self.layer == 1:
|
||||
- frame_length = (12 * self.bitrate / self.sample_rate + padding) * 4
|
||||
+ padding *= 4
|
||||
frame_size = 384
|
||||
elif self.version >= 2 and self.layer == 3:
|
||||
- frame_length = 72 * self.bitrate / self.sample_rate + padding
|
||||
frame_size = 576
|
||||
else:
|
||||
- frame_length = 144 * self.bitrate / self.sample_rate + padding
|
||||
frame_size = 1152
|
||||
|
||||
+ frame_length = frame_size / 8 * \
|
||||
+ self.bitrate / self.sample_rate + padding
|
||||
+
|
||||
if check_second:
|
||||
possible = frame_1 + frame_length
|
||||
if possible > len(data) + 4:
|
||||
@@ -172,9 +173,7 @@
|
||||
if frame_data & 0xFFE0 != 0xFFE0:
|
||||
raise HeaderNotFoundError("can't sync to second MPEG frame")
|
||||
|
||||
- frame_count = real_size / float(frame_length)
|
||||
- samples = frame_size * frame_count
|
||||
- self.length = samples / self.sample_rate
|
||||
+ self.length = 8 * real_size / float(self.bitrate)
|
||||
|
||||
# Try to find/parse the Xing header, which trumps the above length
|
||||
# and bitrate calculation.
|
|
@ -0,0 +1,20 @@
|
|||
Index: /usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/mutagen/mp3.py
|
||||
===================================================================
|
||||
--- /usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/mutagen/mp3.py (revision 108)
|
||||
+++ /usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/mutagen/mp3.py (working copy)
|
||||
@@ -209,15 +209,6 @@
|
||||
bytes = struct.unpack('>I', data[xing + 12:xing + 16])[0]
|
||||
self.bitrate = int((bytes * 8) // self.length)
|
||||
|
||||
- # If the bitrate * the length is nowhere near the file
|
||||
- # length, recalculate using the bitrate and file length.
|
||||
- # Don't do this for very small files.
|
||||
- fileobj.seek(2, 0)
|
||||
- size = fileobj.tell()
|
||||
- expected = (self.bitrate / 8) * self.length
|
||||
- if not (size / 2 < expected < size * 2) and size > 2**16:
|
||||
- self.length = size / float(self.bitrate * 8)
|
||||
-
|
||||
def pprint(self):
|
||||
s = "MPEG %s layer %d, %d bps, %s Hz, %.2f seconds" % (
|
||||
self.version, self.layer, self.bitrate, self.sample_rate,
|
|
@ -34,6 +34,31 @@ class AirtimeInstall{
|
|||
chgrp($file, $CC_CONFIG['webServerUser']);
|
||||
}
|
||||
|
||||
public static function CreateSymlinksToUtils()
|
||||
{
|
||||
echo "* Creating /usr/bin symlinks".PHP_EOL;
|
||||
AirtimeInstall::RemoveSymlinks();
|
||||
|
||||
echo "* Installing airtime-import".PHP_EOL;
|
||||
$dir = CONF_DIR_BINARIES."/utils/airtime-import/airtime-import";
|
||||
exec("ln -s $dir /usr/bin/airtime-import");
|
||||
|
||||
echo "* Installing airtime-update-db-settings".PHP_EOL;
|
||||
$dir = CONF_DIR_BINARIES."/utils/airtime-update-db-settings";
|
||||
exec("ln -s $dir /usr/bin/airtime-update-db-settings");
|
||||
|
||||
echo "* Installing airtime-check-system".PHP_EOL;
|
||||
$dir = CONF_DIR_BINARIES."/utils/airtime-check-system";
|
||||
exec("ln -s $dir /usr/bin/airtime-check-system");
|
||||
}
|
||||
|
||||
public static function RemoveSymlinks()
|
||||
{
|
||||
exec("rm -f /usr/bin/airtime-import");
|
||||
exec("rm -f /usr/bin/airtime-update-db-settings");
|
||||
exec("rm -f /usr/bin/airtime-check-system");
|
||||
}
|
||||
|
||||
public static function DbTableExists($p_name)
|
||||
{
|
||||
global $CC_DBC;
|
||||
|
@ -333,6 +358,7 @@ class AirtimeIni{
|
|||
const CONF_FILE_LIQUIDSOAP = "/etc/airtime/liquidsoap.cfg";
|
||||
const CONF_FILE_MEDIAMONITOR = "/etc/airtime/media-monitor.cfg";
|
||||
const CONF_FILE_API_CLIENT = "/etc/airtime/api_client.cfg";
|
||||
const CONF_FILE_MONIT = "/etc/monit/conf.d/airtime-monit.cfg";
|
||||
|
||||
/**
|
||||
* This function updates an INI style config file.
|
||||
|
@ -369,6 +395,13 @@ class AirtimeIni{
|
|||
}
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
public static function CreateMonitFile(){
|
||||
if (!copy(__DIR__."/../../../python_apps/monit/airtime-monit.cfg", AirtimeIni::CONF_FILE_MONIT)){
|
||||
echo "Could not copy airtime-monit.cfg to /etc/monit/conf.d/. Exiting.";
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
public static function ReadPythonConfig($p_filename)
|
||||
{
|
||||
|
@ -661,7 +694,9 @@ AirtimeInstall::MigrateTablesToVersion(__DIR__, '20110713161043');
|
|||
|
||||
AirtimeInstall::InsertCountryDataIntoDatabase();
|
||||
|
||||
AirtimeIni::CreateMonitFile();
|
||||
|
||||
AirtimeInstall::CreateSymlinksToUtils();
|
||||
|
||||
/* create cron file for phone home stat */
|
||||
AirtimeInstall::CreateCronFile();
|
||||
|
|
|
@ -6,7 +6,7 @@ virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
|||
airtime_import_path="/usr/lib/airtime/utils/airtime-import/"
|
||||
airtime_import_script="airtime-import.py"
|
||||
|
||||
api_client_path="/usr/lib/airtime/pypo/"
|
||||
api_client_path="/usr/lib/airtime/"
|
||||
cd ${airtime_import_path}
|
||||
|
||||
exec 2>&1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
#-------------------------------------------------------------------------------
|
||||
# Copyright (c) 2010 Sourcefabric O.P.S.
|
||||
# Copyright (c) 2011 Sourcefabric O.P.S.
|
||||
#
|
||||
# This file is part of the Airtime project.
|
||||
# http://airtime.sourcefabric.org/
|
||||
|
@ -21,7 +21,7 @@
|
|||
#
|
||||
#-------------------------------------------------------------------------------
|
||||
#-------------------------------------------------------------------------------
|
||||
# This script cleans audio files in Airtime.
|
||||
# This script send data to data collection server
|
||||
#
|
||||
# Absolute path to this script
|
||||
SCRIPT=`readlink -f $0`
|
||||
|
|
Loading…
Reference in New Issue