<html>
<head>
<base href="https://wiki.asterisk.org/wiki">
<link rel="stylesheet" href="/wiki/s/2030/1/7/_/styles/combined.css?spaceKey=TOP&forWysiwyg=true" type="text/css">
</head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
<h2><a href="https://wiki.asterisk.org/wiki/display/TOP/Building+-+Linux">Building - Linux</a></h2>
<h4>Page <b>edited</b> by <a href="https://wiki.asterisk.org/wiki/display/~mmichelson">Mark Michelson</a>
</h4>
<div id="versionComment">
<b>Comment:</b>
Updated the webtatic yum repo URL so that you won't get a 404.<br />
</div>
<br/>
<h4>Changes (1)</h4>
<div id="page-diffs">
<table class="diff" cellpadding="0" cellspacing="0">
<tr><td class="diff-snipped" >...<br></td></tr>
<tr><td class="diff-unchanged" >rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/`uname \-i`/epel-release-5-4.noarch.rpm <br>rpm -Uvh http://blackopsoft.com/el5/RPMS/noarch/blackop-el5-repo-1.0-2.noarch.rpm <br></td></tr>
<tr><td class="diff-changed-lines" >rpm -Uvh http://repo.webtatic.com/yum/centos/5/`uname <span class="diff-changed-words">\-i`/webtatic-release-5-<span class="diff-added-chars"style="background-color: #dfd;">1.</span>noarch.rpm</span> <br></td></tr>
<tr><td class="diff-unchanged" >wget /etc/yum.repos.d/zeroc-ice.repo http://www.zeroc.com/download/Ice/3.4/rhel5/zeroc-ice.repo <br>wget /etc/yum.repos.d/jpackage50.repo http://www.jpackage.org/jpackage50.repo <br></td></tr>
<tr><td class="diff-snipped" >...<br></td></tr>
</table>
</div> <h4>Full Content</h4>
<div class="notificationGreySide">
<h2><a name="Building-Linux-Preface"></a>Preface</h2>
<p>These instructions explain how to build Asterisk SCF on a clean, basic Linux operating system installation.</p>
<h2><a name="Building-Linux-OperatingSystems"></a>Operating Systems</h2>
<p>Asterisk SCF is supported on a wide range of platforms and architectures. This documentation covers installing Asterisk SCF using the following operating systems.</p>
<ul>
        <li>CentOS / Red Hat Enterprise Linux (RHEL) 5.5</li>
        <li>Debian 5.0</li>
        <li>Ubuntu 10.04</li>
</ul>
<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/wiki/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>Oracle/Sun Java is required for Java support in Ice and is not available for all platforms and architectures (OpenJDK is not supported).<br/>
Additional details can be found on the Oracle website at <a href="http://www.oracle.com/technetwork/java/javase/system-configurations-135212.html" class="external-link" rel="nofollow">http://www.oracle.com/technetwork/java/javase/system-configurations-135212.html</a></td></tr></table></div>
<h2><a name="Building-Linux-Installation"></a>Installation</h2>
<ol>
        <li><h6><a name="Building-Linux-Addadditionalrequiredrepositories"></a>Add additional required repositories</h6>
        <ul>
                <li>Debian 5.0<br/>
We'll need the cmake package from the testing repo, however, we'll not want to use the testing repo for much else so we'll need to create an apt preferences file that gives the main repo a higher priority.
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>echo "deb http://www.backports.org/debian lenny-backports main contrib non-free" >> /etc/apt/sources.list
echo "deb http://ftp.us.debian.org/debian/ testing main" >> /etc/apt/sources.list
echo -e "Package: *\r\nPin: release a=stable\r\nPin-Priority: 900" >> /etc/apt/preferences
apt-get update
</pre>
</div></div></li>
                <li>CentOS / RHEL 5.5
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/`uname \-i`/epel-release-5-4.noarch.rpm
rpm -Uvh http://blackopsoft.com/el5/RPMS/noarch/blackop-el5-repo-1.0-2.noarch.rpm
rpm -Uvh http://repo.webtatic.com/yum/centos/5/`uname \-i`/webtatic-release-5-1.noarch.rpm
wget /etc/yum.repos.d/zeroc-ice.repo http://www.zeroc.com/download/Ice/3.4/rhel5/zeroc-ice.repo
wget /etc/yum.repos.d/jpackage50.repo http://www.jpackage.org/jpackage50.repo
</pre>
</div></div></li>
                <li>Ubuntu 10.04
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>apt-get install python-software-properties
add-apt-repository "deb http://archive.canonical.com/ lucid partner"
apt-get update
</pre>
</div></div></li>
        </ul>
        </li>
        <li><h6><a name="Building-Linux-Installrequiredlibrariesandapplications"></a>Install required libraries and applications</h6>
        <ul>
                <li>Debian 5.0
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>apt-get install build-essential
apt-get -t testing install python python-dev python-software-properties cmake
apt-get install libboost1.40-all-dev liblua5.1-0-dev libdb4.8++-dev libdb4.8-java ant mono-gmcs monodevelop mono-xbuild libssl-dev libexpat1-dev libbz2-dev ruby ruby1.8-dev php5-dev uuid-dev libmcpp-dev libjgoodies-forms-java libjgoodies-looks-java
apt-get -t lenny-backports install git
</pre>
</div></div></li>
                <li>CentOS / RHEL 5.5
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>yum groupinstall "Development Tools"
yum install --enablerepo=blackop tcl
yum install --enablerepo=blackop cmake
yum install --enablerepo=blackop boost-devel
yum install --enablerepo=blackop lua-devel
yum install --enablerepo=blackop db4-devel
yum install --enablerepo=blackop db4-java
yum install --enablerepo=blackop jpackage-utils
yum install --disablerepo=blackop ant
yum install mono-devel
yum install openssl-devel
yum install expat-devel
yum install bzip2-devel
yum install ruby
yum install ruby-devel
yum install php5-devel
yum install mcpp-devel
yum install python
yum install python-devel
yum install --enablerepo=webtatic git-all
</pre>
</div></div></li>
                <li>Ubuntu 10.04
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>apt-get install build-essential
apt-get install libboost1.40-all-dev
apt-get install liblua5.1-0-dev
apt-get install cmake
apt-get install libmcpp-dev
apt-get install libbz2-dev
apt-get install libdb4.8++-dev
apt-get install libdb4.8-java
apt-get install ant
apt-get install libjgoodies-forms-java
apt-get install libjgoodies-looks-java
apt-get install mono-gmcs
apt-get install monodevelop
apt-get install mono-xbuild
apt-get install ruby
apt-get install ruby1.8-dev
apt-get install php5-dev
apt-get install libexpat1-dev
apt-get install libssl-dev
apt-get install git-core
</pre>
</div></div></li>
        </ul>
        </li>
        <li><h6><a name="Building-Linux-JavaSupport%28optional%29"></a>Java Support (optional)</h6>
        <ul>
                <li>Debian 5.0<br/>
Append "non-free" to the "lenny main" entries in /etc/apt/sources.list file so they look similar to the ones below.
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>deb http://ftp.us.debian.org/debian/ lenny main non-free
deb-src http://ftp.us.debian.org/debian/ lenny main non-free
</pre>
</div></div>
<p>Finish installing</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>apt-get update
apt-get install sun-java6-jdk
update-alternatives --config java
</pre>
</div></div></li>
                <li>CentOS / RHEL 5.5
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>mkdir -p ~/rpmbuild/{SOURCES,SRPMS,SPECS,RPMS,tmp,BUILD}
touch ~/.rpmmacros
echo "%_topdir /home/user_name/rpmbuild" >> ~/.rpmmacros
echo "%_tmppath %{_topdir}/tmp" >> ~/.rpmmacros
yum install -y rpm-build redhat-rpm-config libXp-devel
</pre>
</div></div>
<p>As there is no official CentOS / Redhat Java repository, you'll need to download the JDK from <a href="https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=jdk-6u11-oth-JPR@CDS-CDS_Developer" class="external-link" rel="nofollow">here</a> and move it into the ~/rpmbuild/SOURCES/ directory. Care must be taken in making sure the jpackage source rpm sun version and the JDK version are identical.</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>cd ~/rpmbuild
wget http://mirrors.dotsrc.org/jpackage/1.7/generic/SRPMS.non-free/java-1.6.0-sun-1.6.0.11-1jpp.nosrc.rpm
rpmbuild --rebuild java-1.6.0-sun-1.6.0.11-1jpp.nosrc.rpm
rpm -Uvh ~/rpmbuild/RPMS/`uname \-i`/java-1.6.0-sun-1.6.0.11-1jpp.`uname \-i`.rpm
alternatives --config java
</pre>
</div></div></li>
                <li>Ubuntu 10.04
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>add-apt-repository "deb http://archive.canonical.com/ lucid partner"
apt-get update
apt-get install sun-java6-jdk
update-alternatives --config java
</pre>
</div></div></li>
        </ul>
        </li>
        <li><h6><a name="Building-Linux-Build%2FInstallIce"></a>Build / Install Ice</h6>
<p>We need to clone Digium's branch of Ice</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>git clone git://git.asterisk.org/asterisk-scf/release/ice
cd ice
</pre>
</div></div>
        <ul>
                <li>With Java support
                <ul>
                        <li>Set class path
                        <ul>
                                <li>Debian 5.0 and Ubuntu 10.04
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>export CLASSPATH=/usr/share/java/libdb4.8-java.jar:/usr/share/java/forms.jar:/usr/share/java/looks.jar
</pre>
</div></div></li>
                                <li>CentOS / RHEL 5.5
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>wget http://www.jgoodies.com/download/libraries/forms/forms-1_3_0.zip
unzip forms-1_3_0.zip
mv forms-1.3.0/forms-1.3.0.jar /usr/share/java/forms.jar
wget http://www.jgoodies.com/download/libraries/looks/looks-2_3_1.zip
unzip looks-2_3_1.zip
mv looks-2.3.1/looks-2.3.1.jar /usr/share/java/looks.jar
export CLASSPATH=/usr/share/java/db.jar:/usr/share/java/forms.jar:/usr/share/java/looks.jar
</pre>
</div></div></li>
                        </ul>
                        </li>
                        <li>Make
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>make install
cd ..
</pre>
</div></div></li>
                </ul>
                </li>
                <li>With C++ and Python support ONLY
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>cd cpp
make install
cd ../py
make install
cd ../..
</pre>
</div></div></li>
        </ul>
        </li>
        <li><h6><a name="Building-Linux-InstalltheAsteriskSCFsource"></a>Install the Asterisk SCF source</h6>
<p>We need to clone the Asterisk SCF build environment</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>git clone git://git.asterisk.org/asterisk-scf/integration/gitall
cd gitall
./gitall-asterisk-scf.sh
</pre>
</div></div></li>
        <li><h6><a name="Building-Linux-Installthepjsipsource"></a>Install the pjsip source</h6>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>wget http://www.pjsip.org/release/1.8/pjproject-1.8.tar.bz2
tar xvjpf pjproject-1.8.tar.bz2
mv pjproject-1.8 pjproject
</pre>
</div></div></li>
        <li><h6><a name="Building-Linux-BuildAsteriskSCF"></a>Build Asterisk SCF</h6>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
<pre>./cmake/init-cmake.sh
cmake --build ./build
</pre>
</div></div></li>
</ol>
</div>
<div id="commentsSection" class="wiki-content pageSection">
<div style="float: right;">
<a href="https://wiki.asterisk.org/wiki/users/viewnotifications.action" class="grey">Change Notification Preferences</a>
</div>
<a href="https://wiki.asterisk.org/wiki/display/TOP/Building+-+Linux">View Online</a>
|
<a href="https://wiki.asterisk.org/wiki/pages/diffpagesbyversion.action?pageId=5243911&revisedVersion=27&originalVersion=26">View Changes</a>
|
<a href="https://wiki.asterisk.org/wiki/display/TOP/Building+-+Linux?showComments=true&showCommentArea=true#addcomment">Add Comment</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>