Setting up a development environment

From SIPfoundry sipx, The Open Source SIP PBX for Linux - Calivia

Jump to: navigation, search


Contents

Introduction

The following instructions apply to Fedora Core (FC5, FC6, F7 and F8) as well as Red Hat Enterprise Linux 5 (RHEL5) and CentOS 5.

For CentOS 4 and Red Hat Enterprise Linux 4 (RHEL4): Setting up a development environment for RHEL4 and CentOS4

NOTES

System Setup Prerequisites

Install Linux with SELinux and Firewall off (unless you know what you are doing). These instructions will assume you've installed the minimal package (e.g. No X libraries, compiler, etc). If you've installed more, that's ok, some of the dependencies you'll be asked to install will simply be ignored by the yum install command.

Disable Firewall

Using the Setup Agent run the firewall configuration tool and disable the Linux firewall. If you want to disable the firewall after the installation finished use this command: system-config-securitylevel-tui.

Disable SELinux

SELinux has to be disabled for sipX because there is currently no selinux policy file availabe. Fedora and CentOS by default enables SELinux.

File: /etc/selinux/config
SELINUX=disabled

Install Build Tools and Dependencies

yum install gcc gcc-c++ autoconf automake libtool subversion doxygen rpm-build zip \
 httpd-devel openssl-devel jpackage-utils which unzip \
 pcre-devel expat-devel unixODBC-devel createrepo \
 jakarta-commons-beanutils jakarta-commons-collections jakarta-commons-net \
 ant log4j junit ant-commons-logging ant-junit ant-trax ant-nodeps \
 mod_ssl postgresql-server libXp zlib-devel postgresql-devel
 
yum install xerces-c-devel ruby ruby-devel ruby-postgres cppunit-devel cppunit

Note: On Fedora also install rpmdevtools. On CentOS install redhat-rpm-config.

yum install rpmdevtools redhat-rpm-config

Additional build dependencies to build the FreeSWITCH conferencing server

yum install alsa-lib-devel curl-devel gnutls-devel lzo-devel \
 mysql-devel ncurses-devel python-devel termcap

Installing Remaining Dependencies

Remaining dependencies are dependencies not available from a standard repository. For the most common platform you can download pre-built dependencies from SIPfoundry. If you are building on a platform not available on SIPfoundry, see Building dependencies (before you build dependencies apply the patches for FC6, F7, F8 or RHEL5/CentOS5 below). don't forget to install the gems once the dependencies are built and installed.

Fedora 6 or greater:

 yum install rubygems rubygem-rake ruby-postgres w3c-libwww-devel cppunit xerces-c-devel
 gem install file-tail     (run this twice if it fails the first time)
 

Install dependencies not available in Fedora standard repositories. Alternatively you can build these yourself see Building dependencies

 sh -c "wget -P /etc/yum.repos.d http://sipxecs.sipfoundry.org/temp/sipXecs/sipxecs-unstable-fc.repo"
 yum install cgicc-devel java-1.5.0-sun-devel ruby-dbi jain-sip

CentOS5/ RHEL5: (includes packages java-sun-1.5, ruby-gems, cgicc, ruby-dbi)

sh -c "wget -P /etc/yum.repos.d http://sipxecs.sipfoundry.org/temp/sipXecs/sipxecs-unstable-centos.repo"
yum install cgicc-devel java-1.5.0-sun-devel ruby-dbi ruby-gems w3c-libwww-devel cppunit ruby-postgres xerces-c-devel jain-sip jakarta-commons-net
gem install rake 
gem install file-tail

If you want to run unit tests you'll also need named (tests will be skipped if named is not found):

yum install bind

Patch for FC6, F7, F8 and RHEL5/CentOS5

Important note: Patch for FC6, F7 and RHEL5/CentOS5. In the most recent fully updated version of FC6 that file no longer existed, so it is possible Red Hat fixed this issue. Check before you proceed.

On FC6, F7 and RHEL5 there is a problem in that the RPM packaging mechanism re-packages the jar files generated by Java. These re-packaged jars then do not work when installed in a system. The symptom is that when you point a browser to your newly installed machine, you get a "server error, cannot connect". To fix this do this on the buildsystem: Apply the following patch to /usr/lib/rpm/redhat/brp-java-repack-jars:

cd /usr/lib/rpm/redhat
patch -p0 < disable.patch
apply to file "brp-java-repack-jars"
File: disable.patch
2a3,5
> # !!!!!!!!!!!!!!!!!!!!! DOUGLAS DISABLING THIS
> exit 0
> 

This patch adds "exit 0" as the second line in the script, effectively disabling this script.

Where next?

See Building from source

Personal tools