OpenPBX.org How to build on OSX/Darwin

HOW TO BUILD OPENPBX.ORG ON MAC OS X

Tested with OS X 10.4 on iMac PPC 800
Tested with OS X 10.4.8 on and MacBook Pro and G4 PowerBook

PREPARATION


You will need to install Apple's Xcode developers tools before trying to compile anything. You can download them from http://developer.apple.com. A free membership is required. Or they can be found on any Mac OS X system install disk.

First open a terminal window or enable ssh and login from a remote host.

we will install openpbx.org in /usr/local/openpbx.org.
everything will be contained in that directory.

$ sudo mkdir -p /usr/local/openpbx.org

we will download and build everything in our home directory in a newly created directory called "dev"

$ cd ~/
$ mkdir dev
$ cd dev

BUILDING LIBTIFF

first download libtiff:

$ curl -O ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.8.2.tar.gz

$ tar zxf tiff-3.8.2.tar.gz
$ cd tiff-3.8.2

$ CFLAGS="-I/usr/local/openpbx.org/include" LDFLAGS="-L/usr/local/openpbx.org/lib" \
./configure --prefix=/usr/local/openpbx.org
$ make
$ sudo make install

BUILDING LIBSPANDSP

download spandsp-0.0.3pre27.tar.gz

$ cd ~/dev
$ curl -O http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.3pre27.tgz
$ tar zxf spandsp-0.0.3pre27.tgz
$ cd spandsp-0.0.3/

$ CFLAGS="-I/usr/local/openpbx.org/include" LDFLAGS="-L/usr/local/openpbx.org/lib" \
./configure --prefix=/usr/local/openpbx.org
$ make
$ sudo make install

BUILDING READLINE


(editline has been replaced by readline)

$ cd ~/dev
$ curl -O ftp://ftp.gnu.org/pub/gnu/readline/readline-5.2.tar.gz
$ tar zxf readline-5.2.tar.gz
$ cd readline-5.2

$ CFLAGS="-I/usr/local/openpbx.org/include" LDFLAGS="-L/usr/local/openpbx.org/lib" \
./configure --prefix=/usr/local/openpbx.org
$ make
$ sudo make install


Create openpbx user and group


To avoid some of the errors in the OpenPBX "make install" step: Do this first:

$ sudo niutil -list / /groups
$ sudo niutil -list / /users
check the lists and pick an unused user and group. (example: 700)

$ sudo niutil -create / /groups/openpbx
$ sudo niutil -createprop / /groups/openpbx gid 700
$ sudo niutil -createprop / /groups/openpbx passwd "*"
$ sudo niutil -createprop / /groups/openpbx users
$ sudo niutil -appendprop / /groups/openpbx users openpbx

$ sudo niutil -create / /users/openpbx
$ sudo niutil -createprop / /users/openpbx uid 700
$ sudo niutil -createprop / /users/openpbx realname "CallWeaver"
$ sudo niutil -createprop / /users/openpbx shell "/bin/bash"
$ sudo niutil -createprop / /users/openpbx gid 700
$ sudo niutil -createprop / /users/openpbx passwd "*"
$ sudo passwd openpbx


this creates the user and group that OpenPBX is looking for, so it
can install the sample configuration in:
/usr/local/openpbx.org/etc



BUILDING OPENPBX.ORG


Download the main tarball:

$ cd ~/dev
$ curl -O http://www.openpbx.org/releases/openpbx.org-1.2_rc3.tar.gz
$ tar zxf openpbx.org-1.2_rc3.tar.gz
$ cd openpbx.org-1.2_rc3

$ CFLAGS="-I/usr/local/openpbx.org/include" LDFLAGS="-L/usr/local/openpbx.org/lib" \
\
./configure \
--enable-iax-trunking=yes \
--enable-t38=yes \
--prefix=/usr/local/openpbx.org \
\
--enable-debug=yes \
--enable-do-crash=yes \
--enable-frame-tracing=yes \
--enable-valgrind=yes \
--enable-debug=yes \
--enable-debug-scheduler=yes \
--enable-stack-backtraces=yes \
--disable-optimization

NB: The second part, starting from --enable-debug on is optional

$ make
$ sudo make install

If you get and error like: Invalid argument chown: openpbx: that might mean that the user and group named openpbx does not exist



You may need to change the permissions:


$ sudo chown -R openpbx:openpbx /usr/local/openpbx.org/etc/
$ sudo chown -R openpbx:openpbx /usr/local/openpbx.org/log/

STARTING OPENPBX.ORG

Let's become root

$ sudo -s

Let's switch to the openpbx.org binary directory

$ cd /usr/local/openpbx.org/sbin

and start the openpbx executable

$ ./openpbx

Let's connect to the console

$ ./openpbx -rvvv

NB: If the last command does not work, then start openpbx again
using "./openpbx -c -g" and read the output to see what the problem is

Written by Massimo "CtRiX" Cetra
Updated by Mark Engelhardt to pertain to RC3




More info

OpenPBX.org wiki on VoIP-Info.org | CallWeaver home page | CallWeaver wiki | OpenPBX SVN repository and bugtracker

HOW TO BUILD OPENPBX.ORG ON MAC OS X

Tested with OS X 10.4 on iMac PPC 800
Tested with OS X 10.4.8 on and MacBook Pro and G4 PowerBook

PREPARATION


You will need to install Apple's Xcode developers tools before trying to compile anything. You can download them from http://developer.apple.com. A free membership is required. Or they can be found on any Mac OS X system install disk.

First open a terminal window or enable ssh and login from a remote host.

we will install openpbx.org in /usr/local/openpbx.org.
everything will be contained in that directory.

$ sudo mkdir -p /usr/local/openpbx.org

we will download and build everything in our home directory in a newly created directory called "dev"

$ cd ~/
$ mkdir dev
$ cd dev

BUILDING LIBTIFF

first download libtiff:

$ curl -O ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.8.2.tar.gz

$ tar zxf tiff-3.8.2.tar.gz
$ cd tiff-3.8.2

$ CFLAGS="-I/usr/local/openpbx.org/include" LDFLAGS="-L/usr/local/openpbx.org/lib" \
./configure --prefix=/usr/local/openpbx.org
$ make
$ sudo make install

BUILDING LIBSPANDSP

download spandsp-0.0.3pre27.tar.gz

$ cd ~/dev
$ curl -O http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.3pre27.tgz
$ tar zxf spandsp-0.0.3pre27.tgz
$ cd spandsp-0.0.3/

$ CFLAGS="-I/usr/local/openpbx.org/include" LDFLAGS="-L/usr/local/openpbx.org/lib" \
./configure --prefix=/usr/local/openpbx.org
$ make
$ sudo make install

BUILDING READLINE


(editline has been replaced by readline)

$ cd ~/dev
$ curl -O ftp://ftp.gnu.org/pub/gnu/readline/readline-5.2.tar.gz
$ tar zxf readline-5.2.tar.gz
$ cd readline-5.2

$ CFLAGS="-I/usr/local/openpbx.org/include" LDFLAGS="-L/usr/local/openpbx.org/lib" \
./configure --prefix=/usr/local/openpbx.org
$ make
$ sudo make install


Create openpbx user and group


To avoid some of the errors in the OpenPBX "make install" step: Do this first:

$ sudo niutil -list / /groups
$ sudo niutil -list / /users
check the lists and pick an unused user and group. (example: 700)

$ sudo niutil -create / /groups/openpbx
$ sudo niutil -createprop / /groups/openpbx gid 700
$ sudo niutil -createprop / /groups/openpbx passwd "*"
$ sudo niutil -createprop / /groups/openpbx users
$ sudo niutil -appendprop / /groups/openpbx users openpbx

$ sudo niutil -create / /users/openpbx
$ sudo niutil -createprop / /users/openpbx uid 700
$ sudo niutil -createprop / /users/openpbx realname "CallWeaver"
$ sudo niutil -createprop / /users/openpbx shell "/bin/bash"
$ sudo niutil -createprop / /users/openpbx gid 700
$ sudo niutil -createprop / /users/openpbx passwd "*"
$ sudo passwd openpbx


this creates the user and group that OpenPBX is looking for, so it
can install the sample configuration in:
/usr/local/openpbx.org/etc



BUILDING OPENPBX.ORG


Download the main tarball:

$ cd ~/dev
$ curl -O http://www.openpbx.org/releases/openpbx.org-1.2_rc3.tar.gz
$ tar zxf openpbx.org-1.2_rc3.tar.gz
$ cd openpbx.org-1.2_rc3

$ CFLAGS="-I/usr/local/openpbx.org/include" LDFLAGS="-L/usr/local/openpbx.org/lib" \
\
./configure \
--enable-iax-trunking=yes \
--enable-t38=yes \
--prefix=/usr/local/openpbx.org \
\
--enable-debug=yes \
--enable-do-crash=yes \
--enable-frame-tracing=yes \
--enable-valgrind=yes \
--enable-debug=yes \
--enable-debug-scheduler=yes \
--enable-stack-backtraces=yes \
--disable-optimization

NB: The second part, starting from --enable-debug on is optional

$ make
$ sudo make install

If you get and error like: Invalid argument chown: openpbx: that might mean that the user and group named openpbx does not exist



You may need to change the permissions:


$ sudo chown -R openpbx:openpbx /usr/local/openpbx.org/etc/
$ sudo chown -R openpbx:openpbx /usr/local/openpbx.org/log/

STARTING OPENPBX.ORG

Let's become root

$ sudo -s

Let's switch to the openpbx.org binary directory

$ cd /usr/local/openpbx.org/sbin

and start the openpbx executable

$ ./openpbx

Let's connect to the console

$ ./openpbx -rvvv

NB: If the last command does not work, then start openpbx again
using "./openpbx -c -g" and read the output to see what the problem is

Written by Massimo "CtRiX" Cetra
Updated by Mark Engelhardt to pertain to RC3




More info

OpenPBX.org wiki on VoIP-Info.org | CallWeaver home page | CallWeaver wiki | OpenPBX SVN repository and bugtracker

Created by: STS, Last modification: Thu 04 of Jan, 2007 (07:43 UTC) by coppice
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+