<html>
<head>
    <base href="https://wiki.asterisk.org/wiki">
            <link rel="stylesheet" href="/wiki/s/2030/1/7/_/styles/combined.css?spaceKey=TOP&amp;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/~kpfleming">Kevin P. Fleming</a>
    </h4>
        <div id="versionComment">
        <b>Comment:</b>
        Moved all Java-related packages to the optional Java section.<br />
    </div>
        <br/>
                         <h4>Changes (7)</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" >apt-get install build-essential <br>apt-get -t testing install python python-dev python-software-properties cmake <br></td></tr>
            <tr><td class="diff-changed-lines" >apt-get install libboost1.40-all-dev liblua5.1-0-dev libdb4.8++-dev <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">libdb4.8-java ant</span> mono-gmcs monodevelop mono-xbuild libssl-dev libexpat1-dev libbz2-dev ruby ruby1.8-dev php5-dev uuid-dev libmcpp-dev <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">libjgoodies-forms-java libjgoodies-looks-java</span> <br></td></tr>
            <tr><td class="diff-unchanged" >apt-get -t lenny-backports install git <br>{noformat} <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >yum install --enablerepo=blackop lua-devel <br>yum install --enablerepo=blackop db4-devel <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">yum install --enablerepo=blackop db4-java <br></td></tr>
            <tr><td class="diff-unchanged" >yum install --enablerepo=blackop jpackage-utils <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">yum install --disablerepo=blackop ant <br></td></tr>
            <tr><td class="diff-unchanged" >yum install mono-devel <br>yum install openssl-devel <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >#* Ubuntu 10.04 <br>{noformat} <br></td></tr>
            <tr><td class="diff-changed-lines" >apt-get install build-essential libboost1.40-all-dev liblua5.1-0-dev cmake libmcpp-dev libbz2-dev libdb4.8++-dev <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">libdb4.8-java ant libjgoodies-forms-java libjgoodies-looks-java</span> mono-gmcs monodevelop mono-xbuild ruby ruby1.8-dev php5-dev libexpat1-dev libssl-dev git-core <br></td></tr>
            <tr><td class="diff-unchanged" >{noformat} <br># h6.Java Support (optional) <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{noformat} <br>apt-get update <br></td></tr>
            <tr><td class="diff-changed-lines" >apt-get install sun-java6-jdk <span class="diff-added-words"style="background-color: #dfd;">libdb4.8-java ant libjgoodies-forms-java libjgoodies-looks-java</span> <br></td></tr>
            <tr><td class="diff-unchanged" >update-alternatives --config java <br>{noformat} <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >rpm -Uvh ~/rpmbuild/RPMS/`uname \-i`/java-1.6.0-sun-1.6.0.11-1jpp.`uname \-i`.rpm <br>alternatives --config java <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">yum install --enablerepo=blackop db4-java <br>yum install --disablerepo=blackop ant <br></td></tr>
            <tr><td class="diff-unchanged" >{noformat} <br>#* Ubuntu 10.04 <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >add-apt-repository &quot;deb http://archive.canonical.com/ lucid partner&quot; <br>apt-get update <br></td></tr>
            <tr><td class="diff-changed-lines" >apt-get install sun-java6-jdk <span class="diff-added-words"style="background-color: #dfd;">libdb4.8-java ant libjgoodies-forms-java libjgoodies-looks-java</span> <br></td></tr>
            <tr><td class="diff-unchanged" >update-alternatives --config java <br>{noformat} <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" &gt;&gt; /etc/apt/sources.list
echo "deb http://ftp.us.debian.org/debian/ testing main" &gt;&gt; /etc/apt/sources.list
echo -e "Package: *\r\nPin: release a=stable\r\nPin-Priority: 900" &gt;&gt; /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 mono-gmcs monodevelop mono-xbuild libssl-dev libexpat1-dev libbz2-dev ruby ruby1.8-dev php5-dev uuid-dev libmcpp-dev
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 jpackage-utils
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 libboost1.40-all-dev liblua5.1-0-dev cmake libmcpp-dev libbz2-dev libdb4.8++-dev mono-gmcs monodevelop mono-xbuild ruby ruby1.8-dev php5-dev libexpat1-dev libssl-dev 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 libdb4.8-java ant libjgoodies-forms-java libjgoodies-looks-java
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" &gt;&gt; ~/.rpmmacros
echo "%_tmppath %{_topdir}/tmp" &gt;&gt; ~/.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
yum install --enablerepo=blackop db4-java
yum install --disablerepo=blackop ant
</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 libdb4.8-java ant libjgoodies-forms-java libjgoodies-looks-java
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=29&originalVersion=28">View Changes</a>
                |
        <a href="https://wiki.asterisk.org/wiki/display/TOP/Building+-+Linux?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>