Call Us Today! 877.742.2583

Page tree
Skip to end of metadata
Go to start of metadata


This page explains how to build FreeSWITCH Debian packages for other architectures, like ARM or MIPS.

 Click here to expand Table of Contents

Building procedure

The following instructions build Debian 8 packages for architectures that are not available from official FreeSWITCH repositories. The FreeSWITCH package build process depends on prerequisite libraries which are expected to be available from a package repository via HTTP. So, you need to set up your own Debian package repository, create your own PGP key, and upload the dependency packages onto it.

# Get the architecture name. 
export MY_HOST_ARCH=`dpkg-architecture -q DEB_HOST_ARCH`

apt-get update && apt-get install -y git curl screen aptitude reprepro make sox flac

# create a PGP key for signing your repository
mkdir ~/.gnupg/
cat >~/.gnupg/gpg.conf <<'EOT'
default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 BZIP2 ZLIB ZIP Uncompressed
cert-digest-algo SHA512
personal-digest-preferences SHA512
apt-get install -y rng-tools
rngd -r /dev/urandom
gpg --gen-key

gpg --list-public-keys
# further on, AEEA3C42 is my public key, and you need to use yours

# optionally remove passphrase
gpg --edit-key AEEA3C42

# the build process may take several hours, so screen is a good way to avoid terminal interruptions
screen -RL

# build the dependency libraries. The process may take a long time, so use Ctrl-A Ctrl-D to detach from the screen if needed

mkdir /usr/src/freeswitch-video-deps
git clone /usr/src/freeswitch-video-deps/src
/usr/src/freeswitch-video-deps/src/debian/sd-repo-builder --arch=${MY_HOST_ARCH} \
  --dir=/usr/src/freeswitch-sd --repo=/var/local/freeswitch-unstable-${MY_HOST_ARCH} --sign=AEEA3C42

# build the sound packages and add them to the repo manually

mkdir /usr/src/freeswitch-sounds
cd /usr/src/freeswitch-sounds
git clone music-default
cd music-default
./debian/ -p freeswitch-music-default
./debian/rules get-orig-source
tar -xv --strip-components=1 -f *_*.orig.tar.xz && mv *_*.orig.tar.xz ../
dpkg-buildpackage -uc -us -Zxz -z1

cd /usr/src/freeswitch-sounds
git clone sounds-en-us-callie
cd sounds-en-us-callie
./debian/ -p freeswitch-sounds-en-us-callie
./debian/rules get-orig-source
tar -xv --strip-components=1 -f *_*.orig.tar.xz && mv *_*.orig.tar.xz ../
dpkg-buildpackage -uc -us -Zxz -z1

reprepro -Vb /var/local/freeswitch-unstable-${MY_HOST_ARCH} includedeb jessie /usr/src/freeswitch-sounds/*.deb

# set up the HTTP repository 

# publish the repo to your web server
rsync -av --delete /var/local/freeswitch-unstable-${MY_HOST_ARCH} USER@WEBSERVER.EXAMPLE.COM:/srv/www/www.EXAMPLE.COM/debian

# publish your PGP key
gpg --armor --output EXAMPLE.COM.gpg.key --export AEEA3C42

# add the repo to your sources list
vi /etc/apt/sources.list
# add a line pointing to your server, like 
# deb http://www.EXAMPLE.COM/debian/freeswitch-unstable-armhf/ jessie main

# import the key 
curl http://www.EXAMPLE.COM/debian/EXAMPLE.COM.gpg.key | apt-key add -

# check that there are no errors
apt-get update 

# Build FreeSWITCH packages

# we need our own copy of public PGP keys and sources.list
apt-key exportall >/root/debian_keyring.asc

vi /root/sources.list 
# supply a sources list that has the Debian packages for your architecture and a link to your custom repo:
# deb jessie main contrib non-free
# deb http://www.EXAMPLE.COM/debian/freeswitch-unstable-armhf/ jessie main

mkdir /usr/src/freeswitch-debs
git clone /usr/src/freeswitch-debs/freeswitch
cd /usr/src/freeswitch-debs/freeswitch
fgrep -v 'mod_sangoma_codec' build/modules.conf.most  >/root/modules.conf.${MY_HOST_ARCH}  
./debian/ build-all -bijn -z1 -a ${MY_HOST_ARCH} -c jessie \
  -f /root/modules.conf.${MY_HOST_ARCH} -T /root/sources.list -K /root/debian_keyring.asc

reprepro -Vb /var/local/freeswitch-unstable-${MY_HOST_ARCH} includedeb jessie /usr/src/freeswitch-debs/*.deb
rsync -av --delete /var/local/freeswitch-unstable-${MY_HOST_ARCH} USER@WEBSERVER.EXAMPLE.COM:/srv/www/www.EXAMPLE.COM/debian

After finishing this scenario, you should be able to install the packages onto your target hosts, following the standard installation sequence (with the only exception that you need to import your own PGP key and the repo URL).

FreeSWITCH maintainers strictly discourage publishing third-party repositories, for obvious reasons of security and reliability.

  • No labels