Merge pull request #75 from radiorabe/feature/centos-fixes

Problem: Install cleanup needed for CentOS
This commit is contained in:
Robb 2017-03-13 12:36:08 -04:00 committed by GitHub
commit cb4ad730fc
4 changed files with 42 additions and 17 deletions

2
Vagrantfile vendored
View file

@ -46,7 +46,7 @@ Vagrant.configure("2") do |config|
end end
config.vm.define "centos" do |os| config.vm.define "centos" do |os|
os.vm.box = 'centos/7' os.vm.box = 'centos/7'
provision_libretime(os, "centos.sh", installer_args + "--ignore-dependencies --distribution=centos --web-user=apache") provision_libretime(os, "centos.sh", installer_args + "--ignore-dependencies --distribution=centos --web-user=apache --selinux")
end end
def provision_libretime(config, prepare_script, installer_args) def provision_libretime(config, prepare_script, installer_args)

21
install
View file

@ -49,7 +49,10 @@ showhelp () {
-a, --apache -a, --apache
Install apache and deploy a basic configuration for Airtime Install apache and deploy a basic configuration for Airtime
-i, --icecast -i, --icecast
Install Icecast 2 and deploy a basic configuration for Airtime" Install Icecast 2 and deploy a basic configuration for Airtime
--selinux
Run restorecon on directories and files that need tagging to
allow the WEB_USER access."
exit 0 exit 0
} }
@ -67,6 +70,7 @@ postgres="f"
apache="f" apache="f"
icecast="f" icecast="f"
ignore_dependencies="f" ignore_dependencies="f"
selinux="f"
# Interactive # Interactive
_i=1 _i=1
# Verbose # Verbose
@ -223,6 +227,9 @@ while :; do
--web-port=?*) --web-port=?*)
web_port=${1#*=} web_port=${1#*=}
;; ;;
--selinux)
selinux="t"
;;
--) --)
shift shift
break break
@ -747,6 +754,18 @@ if [ "$ignore_dependencies" = "f" ]; then
fi fi
fi fi
# If the user requested it we run restorecon on files that need
# tagging for selinux.
if [ "$selinux" = "t" ]; then
loud "\n-----------------------------------------------------"
loud " * Restoring SELinux Tags * "
loud "-----------------------------------------------------"
verbose "\n * Running restorecon..."
loudCmd "restorecon -Rv /etc/airtime /srv/airtime > /dev/null 2>&1"
verbose "...Done"
fi
verbose "\n * Reloading apache..." verbose "\n * Reloading apache..."
if [ "$dist" != "centos" ]; then if [ "$dist" != "centos" ]; then
loudCmd "service ${apache_bin} reload 2>/dev/null" loudCmd "service ${apache_bin} reload 2>/dev/null"

View file

@ -84,6 +84,7 @@ yum install -y \
php-bcmath \ php-bcmath \
php-mbstring \ php-mbstring \
httpd \ httpd \
fdk-aac \
liquidsoap \ liquidsoap \
silan \ silan \
icecast \ icecast \
@ -94,6 +95,7 @@ yum install -y \
# for pip ssl install # for pip ssl install
yum install -y \ yum install -y \
gcc \
python-devel \ python-devel \
python-lxml \ python-lxml \
openssl-devel openssl-devel

View file

@ -45,26 +45,30 @@ def check_version(~version=liquidsoap.version, major, minor) =
list.nth(v,0) > major or list.nth(v,0) == major and list.nth(v,1) >= minor list.nth(v,0) > major or list.nth(v,0) == major and list.nth(v,1) >= minor
end end
# cue cut fix for liquidsoap <1.2.2
#
# This was most likely broken on 1.1.1 (debian) as well.
#
# adapted from https://github.com/savonet/liquidsoap/issues/390#issuecomment-277562081
#
def fix_cue_in(~cue_in_metadata='liq_cue_in', m) =
# 0.04 might need to be adjusted according to your frame size
if float_of_string(m[cue_in_metadata]) < 0.04 then
[(cue_in_metadata, "0")]
else
[]
end
end
def create_source() def create_source()
l = request.equeue(id="s#{!source_id}", length=0.5) l = request.equeue(id="s#{!source_id}", length=0.5)
l = audio_to_stereo(id="queue_src", l) l = audio_to_stereo(id="queue_src", l)
# cue cut fix for liquidsoap <1.2.2 l = if not check_version(1, 3) then
# map_metadata(fix_cue_in, l)
# This was most likely broken on 1.1.1 (debian) as well. else
# l
# adapted from https://github.com/savonet/liquidsoap/issues/390#issuecomment-277562081
#
if not check_version(1, 3) then
l = map_metadata(fun (~cue_in_metadata='liq_cue_in', m) ->
# 0.04 might need to be adjusted according to your frame size
if float_of_string(m[cue_in_metadata]) < 0.04 then
[(cue_in_metadata, "0")]
else
[]
end
end)
end end
l = cue_cut(l) l = cue_cut(l)
l = amplify(1., override="replay_gain", l) l = amplify(1., override="replay_gain", l)