Compile icecast in the Unix-Like Environment: Difference between revisions

From TestingMediawiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 2: Line 2:


<pre style="overflow:auto;width:80%;"><nowiki>
<pre style="overflow:auto;width:80%;"><nowiki>
cd ~
#!/bin/bash
 
mkdir testCompile
mkdir testCompile
cd testCompile
cd testCompile
Line 11: Line 12:
cd ..
cd ..


wget http://www.libsdl.org/release/SDL-1.0.8.tar.gz
gragAndUntar ()
wget http://www.vorbis.com/files/1.0.1/unix/libvorbis-1.0.1.tar.gz
{
wget http://www.vorbis.com/files/1.0.1/unix/libogg-1.1.tar.gz
if wget $1
wget http://downloads.xiph.org/releases/icecast/icecast-2.2.0.tar.gz
then echo "grab $1"
wget ftp://xmlsoft.org/libxml2-2.6.17.tar.gz
else exit 1
wget ftp://xmlsoft.org/libxslt-1.1.12.tar.gz
fi
wget http://downloads.xiph.org/releases/theora/libtheora-1.0alpha4.tar.gz
if tar -zxvf $2
then echo "untar $1"
else exit 1
fi
}


tar -zxvf SDL-1.0.8.tar.gz
gragAndUntar "http://www.libsdl.org/release/SDL-1.0.8.tar.gz" "SDL-1.0.8.tar.gz"
tar -zxvf libvorbis-1.0.1.tar.gz
gragAndUntar "http://www.vorbis.com/files/1.0.1/unix/libvorbis-1.0.1.tar.gz" "libvorbis-1.0.1.tar.gz"
tar -zxvf libogg-1.1.tar.gz
gragAndUntar "http://www.vorbis.com/files/1.0.1/unix/libogg-1.1.tar.gz" "libogg-1.1.tar.gz"
tar -zxvf icecast-2.2.0.tar.gz
gragAndUntar "http://downloads.xiph.org/releases/icecast/icecast-2.2.0.tar.gz" "icecast-2.2.0.tar.gz"
tar -zxvf libxml2-2.6.17.tar.gz
gragAndUntar "ftp://xmlsoft.org/libxml2-2.6.17.tar.gz" "libxml2-2.6.17.tar.gz"
tar -zxvf libxslt-1.1.12.tar.gz
gragAndUntar "ftp://xmlsoft.org/libxslt-1.1.12.tar.gz" "libxslt-1.1.12.tar.gz"
tar -zxvf libtheora-1.0alpha4.tar.gz
gragAndUntar "http://downloads.xiph.org/releases/theora/libtheora-1.0alpha4.tar.gz" "libtheora-1.0alpha4.tar.gz"


makeInstall ()
makeInstall ()
{
{
cd $1
if cd $1
./configure $2
then echo "working in $1"
make -j 4
else exit 1
make install
fi
if ./configure $2
then echo "configured $1"
else exit 1
fi
if [ -z "$3" ]
then
if make -j 4 $3
then echo "maked $1"
else exit 1
fi
else
if make -j 4
then echo "maked $1"
else exit 1
fi
fi
if make install
then echo "make installed $1"
else exit 1
fi
cd $testCompilePath
cd $testCompilePath
}
}
Line 45: Line 70:
makeInstall "libvorbis-1.0.1" "--prefix=$installPath --with-ogg=$installPath --disable-oggtest"
makeInstall "libvorbis-1.0.1" "--prefix=$installPath --with-ogg=$installPath --disable-oggtest"
makeInstall "libtheora-1.0alpha4" "--prefix=$installPath --with-ogg=$installPath --with-vorbis=$installPath --with-sdl-prefix=$installPath --disable-oggtest --disable-vorbistest --disable-sdltest"
makeInstall "libtheora-1.0alpha4" "--prefix=$installPath --with-ogg=$installPath --with-vorbis=$installPath --with-sdl-prefix=$installPath --disable-oggtest --disable-vorbistest --disable-sdltest"
makeInstall "icecast-2.2.0" "--prefix=$installPath --with-xslt-config=$testCompilePath/libxslt-1.1.12/xslt-config --with-vorbis=$installPath --with-theora=$installPath"
makeInstall "icecast-2.2.0" "--prefix=$installPath --with-xslt-config=$testCompilePath/libxslt-1.1.12/xslt-config --with-vorbis=$installPath --with-theora=$installPath" "static"
cp $installPath/bin/icecast $testCompilePath
cp $installPath/bin/icecast ../
cd ..
rm -R -f $testCompilePath
 


</nowiki></pre>
</nowiki></pre>

Revision as of 18:09, 15 June 2005

暫存:在 *nix 下編譯 icecast 麻瓜用教學 ( 作者 AndCycle )

#!/bin/bash

mkdir testCompile
cd testCompile
testCompilePath=`pwd`
mkdir install
cd install
installPath=`pwd`
cd ..

gragAndUntar ()
{
	if wget $1
	then echo "grab $1"
	else exit 1
	fi
	if tar -zxvf $2
	then echo "untar $1"
	else exit 1
	fi
}

gragAndUntar "http://www.libsdl.org/release/SDL-1.0.8.tar.gz" "SDL-1.0.8.tar.gz"
gragAndUntar "http://www.vorbis.com/files/1.0.1/unix/libvorbis-1.0.1.tar.gz" "libvorbis-1.0.1.tar.gz"
gragAndUntar "http://www.vorbis.com/files/1.0.1/unix/libogg-1.1.tar.gz" "libogg-1.1.tar.gz"
gragAndUntar "http://downloads.xiph.org/releases/icecast/icecast-2.2.0.tar.gz" "icecast-2.2.0.tar.gz"
gragAndUntar "ftp://xmlsoft.org/libxml2-2.6.17.tar.gz" "libxml2-2.6.17.tar.gz"
gragAndUntar "ftp://xmlsoft.org/libxslt-1.1.12.tar.gz" "libxslt-1.1.12.tar.gz"
gragAndUntar "http://downloads.xiph.org/releases/theora/libtheora-1.0alpha4.tar.gz" "libtheora-1.0alpha4.tar.gz"

makeInstall ()
{
	if cd $1
	then echo "working in $1"
	else exit 1
	fi
	if ./configure $2
	then echo "configured $1"
	else exit 1
	fi
	if [ -z "$3" ]
	then
		if make -j 4 $3
		then echo "maked $1"
		else exit 1
		fi
	else
		if make -j 4
		then echo "maked $1"
		else exit 1
		fi
	fi
	if make install
	then echo "make installed $1"
	else exit 1
	fi
	cd $testCompilePath
}

makeInstall "libxml2-2.6.17" "--prefix=$installPath"
makeInstall "libxslt-1.1.12" "--prefix=$installPath --with-libxml-prefix=$installPath"
cd libxslt-1.1.12
chmod +x xslt-config
cd $testCompilePath
makeInstall "SDL-1.0.8" "--prefix=$installPath"
makeInstall "libogg-1.1" "--prefix=$installPath"
makeInstall "libvorbis-1.0.1" "--prefix=$installPath --with-ogg=$installPath --disable-oggtest"
makeInstall "libtheora-1.0alpha4" "--prefix=$installPath --with-ogg=$installPath --with-vorbis=$installPath --with-sdl-prefix=$installPath --disable-oggtest --disable-vorbistest --disable-sdltest"
makeInstall "icecast-2.2.0" "--prefix=$installPath --with-xslt-config=$testCompilePath/libxslt-1.1.12/xslt-config --with-vorbis=$installPath --with-theora=$installPath" "static"
cp $installPath/bin/icecast ../
cd ..
rm -R -f $testCompilePath