sudo apt-get install devscripts debhelper wget -cS http://downloads.xiph.org/releases/icecast/icecast-2.4.0.tar.gz cp icecast-2.4.0.tar.gz icecast_2.4.0.orig.tar.gz tar xvf icecast-2.4.0.tar.gz cd icecast-2.4.0 mkdir debian mcedit debian/control
Source: icecast Maintainer: Maintainer Name <MaintName@MailService> Package: icecast Architecture: i386 Depends: libc6 (>= 2.3.6-6~), libcurl3-gnutls (>= 7.16.2), libogg0 (>= 1.0rc3), libspeex1 (>= 1.2~beta3-1), libssl1.0.0 (>= 1.0.0), libtheora0 (>= 0.0.0.alpha7.dfsg), libvorbis0a (>= 1.1.2), libxml2 (>= 2.7.4), libxslt1.1 (>= 1.1.25) Section: sound Priority: extra Homepage: Homepage: http://www.icecast.org/ Description: streaming media server Icecast is a versatile multimedia streaming server which can create (for instance) a private jukebox or "Internet radio station". It supports Ogg streaming using the Vorbis and Theora codecs, as well as other formats such as MP3, AAC, or NSV, and is compatible with most media players.
dch --create -v 2.4.0-1 --package icecast mcedit debian/rules
#!/usr/bin/make -f %: dh $@
Примечание: в файле “debian/rules” перед строкой dh $@v
стоит один знак табуляции, а не пробелы!
debuild -us -uc cd .. sudo dpkg -i icecast_2.4.0-1_i386.deb
Для ретрансляции потока на примере канала “Acid Jazz” на MyRadio.com.ua использовался следующий скрипт:
#!/bin/bash RUNNING_INSTANCES=`pidof -x listen-newjazz.sh` pkill -TERM -x -f "curl --connect-timeout 10 -s -o /var/tmp/ices2/newjazz.fifo http://music.myradio.com.ua:8000/newjazz32.ogg" for PID in "${RUNNING_INSTANCES}" do if [ "$PID" != "$$" ] then # echo "Killing process ${PID}" kill -TERM $PID fi done if [ ! -x "/var/tmp/ices2" ] then mkdir /var/tmp/ices2 fi if [ ! -p "/var/tmp/ices2/newjazz.fifo" ] then mkfifo /var/tmp/ices2/newjazz.fifo fi if [ ! -x "/var/log/ices2" ] then mkdir /var/log/ices2 fi #nohup curl -s http://music.myradio.com.ua:8000/newjazz128.ogg > /var/tmp/ices2/newjazz.fifo 2> /dev/null & nohup curl --connect-timeout 10 -s -o /var/tmp/ices2/newjazz.fifo http://music.myradio.com.ua:8000/newjazz32.ogg 2> /dev/null & sleep 1 echo "/var/tmp/ices2/newjazz.fifo" exit 0
Для возобновления прерванного потока использовался следующий bash-скрипт:
#!/bin/bash #echo $1 2>&1 sleep 5 case $1 in /KropivaRadio-newjazz32.ogg) pkill -TERM -x -f "/usr/bin/ices2 /etc/ices2/ices-myradio-newjazz-script.xml" /usr/bin/ices2 /etc/ices2/ices-myradio-newjazz-script.xml ;; /KropivaRadio-country32.ogg) pkill -TERM -x -f "/usr/bin/ices2 /etc/ices2/ices-myradio-country-script.xml" /usr/bin/ices2 /etc/ices2/ices-myradio-country-script.xml ;; *) exit 0 ;; esac