2012-02-23 20:03:09 -05:00
|
|
|
FreeSWITCH for Debian
|
2014-02-23 12:11:21 -05:00
|
|
|
=====================
|
2012-02-23 20:03:09 -05:00
|
|
|
|
2014-02-23 12:44:59 -05:00
|
|
|
Introduction
|
|
|
|
------------
|
|
|
|
|
2012-02-23 20:03:09 -05:00
|
|
|
Because FreeSWITCH has so many modules it was necessary to create a
|
|
|
|
system to autogenerate the majority of the packaging. This in done
|
|
|
|
mostly in the file debian/bootstrap.sh. This bootstrap needs to run
|
|
|
|
before any other step of the packaging, though we do try to
|
|
|
|
autogenerate it when possible.
|
|
|
|
|
2014-02-23 12:44:59 -05:00
|
|
|
Getting the FreeSWITCH sources
|
|
|
|
------------------------------
|
|
|
|
|
|
|
|
Everything that follows will assume that you're in the base directory
|
|
|
|
of a FreeSWITCH git repository. You can achieve this with:
|
|
|
|
|
|
|
|
aptitude update && aptitude install -y git
|
|
|
|
mkdir -p /usr/src/freeswitch
|
2015-06-03 16:23:40 -04:00
|
|
|
git clone https://freeswitch.org/stash/scm/fs/freeswitch.git /usr/src/freeswitch/src
|
2014-02-23 12:44:59 -05:00
|
|
|
cd /usr/src/freeswitch/src
|
|
|
|
|
|
|
|
Ensuring you have a clean build directory
|
|
|
|
-----------------------------------------
|
|
|
|
|
|
|
|
Every time you start over, you should make sure your build directory
|
|
|
|
is perfectly clean and clear of untracked files. You can accomplish
|
|
|
|
this with:
|
|
|
|
|
|
|
|
git clean -fdx && git reset --hard origin/master
|
|
|
|
|
|
|
|
Using the packaging to do a normal build
|
|
|
|
----------------------------------------
|
|
|
|
|
|
|
|
Let's say you don't want to build the Debian packages; you just want
|
|
|
|
to build FS. You'll need certain dependencies installed on your
|
|
|
|
system to do this. And you probably want to configure FS in the same
|
|
|
|
way we do for the packaging. You can let the packaging files do this
|
|
|
|
work for you so you don't have to manually keep track of which
|
|
|
|
dependencies are required to build FS. Build as follows:
|
|
|
|
|
|
|
|
aptitude update && aptitude install -y devscripts equivs build-essential
|
|
|
|
my_release=$(awk '/deb .*\/debian/{print $3; exit}' /etc/apt/sources.list)
|
|
|
|
(cd debian && ./bootstrap.sh -c $my_release)
|
2014-02-23 13:07:16 -05:00
|
|
|
sed -i debian/control -e '/^#/d' && sed -i debian/control -e '/^$/N;/^\n$/D'
|
2014-02-23 12:44:59 -05:00
|
|
|
mk-build-deps -i
|
|
|
|
make -f debian/rules .stamp-configure && make
|
|
|
|
|
2014-02-23 13:05:25 -05:00
|
|
|
The debian/modules.conf file
|
|
|
|
----------------------------
|
|
|
|
|
|
|
|
If the file debian/modules.conf is present, we read that file and only
|
|
|
|
build and package the files listed there. Otherwise, we build every
|
|
|
|
module except the ones that either should not be packaged, or for
|
|
|
|
which we don't yet have good packaging.
|
|
|
|
|
|
|
|
The format of debian/modules.conf is:
|
|
|
|
|
|
|
|
## comments should start with two hash characters
|
|
|
|
<category>/<module_name>
|
|
|
|
|
2014-02-23 12:44:59 -05:00
|
|
|
Building the Debian packaging
|
|
|
|
-----------------------------
|
|
|
|
|
|
|
|
If you want actualy Debian binary or source packages to upload to your
|
|
|
|
own repository, you'll need to build them as described here. We have
|
|
|
|
some fancy automatic tools to accomplish this. The tools allow you to
|
|
|
|
start from a very bare Debian image and generate working packages.
|
2014-02-23 13:08:40 -05:00
|
|
|
Building in this manner is only supported on Debian sid, though it
|
|
|
|
will generate packages for all supported Debian releases. Simply run:
|
2014-02-23 12:44:59 -05:00
|
|
|
|
|
|
|
./debian/util.sh build-all -ibn -z9
|
|
|
|
|
2014-11-20 20:32:59 -05:00
|
|
|
Building on Ubuntu
|
|
|
|
------------------
|
|
|
|
|
|
|
|
Building on supported Ubuntu releases requires the main and universe
|
|
|
|
APT components in the pbuilder chroot. You should enable the universe
|
|
|
|
component in your system's APT sources.list and use the -t option to
|
|
|
|
use your system sources in the chroot:
|
|
|
|
|
|
|
|
./debian/util.sh build-all -ibn -z9 -t
|
|
|
|
|
2014-02-23 12:44:59 -05:00
|
|
|
Building only some modules
|
|
|
|
--------------------------
|
|
|
|
|
|
|
|
If you don't need all the modules to build, create a modules.conf file
|
|
|
|
outside of your source tree and pass the -f option to build-all. e.g.:
|
|
|
|
|
|
|
|
echo "applications/mod_commands" > /tmp/modules.conf
|
|
|
|
./debian/util.sh build-all -ibn -z9 -f /tmp/modules.conf
|
|
|
|
|
|
|
|
Testing a particular module under packaging
|
|
|
|
-------------------------------------------
|
|
|
|
|
|
|
|
If you need to build a small set of modules for compile testing in the
|
|
|
|
pbuilder environment, you can run:
|
|
|
|
|
|
|
|
./debian/util.sh build-all -dni -z1 -a amd64 -c sid -l "applications/mod_commands"
|
|
|
|
|
|
|
|
Getting help with debian/util.sh
|
|
|
|
--------------------------------
|
|
|
|
|
|
|
|
The debian/util.sh has many options. You can see the documentation
|
|
|
|
for these options by running:
|
|
|
|
|
|
|
|
./debian/util.sh -h
|
|
|
|
|
2014-02-23 13:05:25 -05:00
|
|
|
The debian/control-modules file
|
|
|
|
-------------------------------
|
|
|
|
|
|
|
|
The build dependencies, runtime dependencies, and other details about
|
|
|
|
modules can be configured in the debian/control-modules file. Even
|
|
|
|
though this file looks a bit like a debian control file and has a
|
|
|
|
similar format, we are parsing this file ourselves so the format is a
|
|
|
|
bit more restricted.
|
|
|
|
|
|
|
|
debian/control-modules currently supports the following fields:
|
|
|
|
|
|
|
|
# lines that begin with the hash character are comments
|
|
|
|
#
|
|
|
|
# every block must start with a Module field
|
|
|
|
Module: <category>/<module_name>
|
|
|
|
Description: <short description>
|
|
|
|
<long description> # empty lines with "."s are not yet supported
|
|
|
|
Build-Depends: <build deps for this module>
|
|
|
|
Depends: <runtime deps for this module>
|
|
|
|
Recommends: <recommended packages>
|
|
|
|
Suggests: <suggested packages>
|
|
|
|
Distro-Conflicts: <distributions on which this module should not be built> # not yet implemented
|
|
|
|
|
|
|
|
During bootstrap we build a file control-modules.gen. If the
|
|
|
|
control-modules file is properly formatted, this generated file should
|
|
|
|
be identical. This is a sanity check mechanism for our parsing, as
|
|
|
|
well as a way to automatically reorganize the file.
|
|
|
|
|
2014-02-23 12:44:59 -05:00
|
|
|
Building Debian packages without util.sh
|
|
|
|
----------------------------------------
|
|
|
|
|
|
|
|
Building the packages without util.sh is not recommended as util.sh
|
|
|
|
takes care of many non-trivial details. If needed, however, the
|
|
|
|
packages can be built:
|
2012-02-23 20:03:09 -05:00
|
|
|
|
2014-02-23 12:11:21 -05:00
|
|
|
distro=sid
|
|
|
|
ver="$(cat build/next-release.txt | sed -e 's/-/~/g')~n$(date +%Y%m%dT%H%M%SZ)-1~${distro}+1"
|
2014-02-23 12:44:59 -05:00
|
|
|
git clean -fdx && git reset --hard origin/master
|
2014-02-23 12:11:21 -05:00
|
|
|
./build/set-fs-version.sh "$ver"
|
2014-03-19 15:08:17 -04:00
|
|
|
git add configure.ac && git commit -m "bump to custom v$ver"
|
2014-02-23 12:11:21 -05:00
|
|
|
(cd debian && ./bootstrap.sh -c $distro)
|
|
|
|
dch -b -m -v "$ver" --force-distribution -D "unstable" "Custom build."
|
|
|
|
dpkg-buildpackage -b -us -uc -Zxz -z9
|
|
|
|
git reset --hard HEAD^
|
2012-02-23 20:03:09 -05:00
|
|
|
|
2012-09-04 10:53:34 -04:00
|
|
|
To build for a stable branch, do this:
|
|
|
|
|
2014-02-23 12:11:21 -05:00
|
|
|
distro=sid # update as needed
|
|
|
|
stable_ver="1.2.1" # update as needed
|
|
|
|
ver="$(echo "$stable_ver" | sed -e 's/-/~/g')~n$(date +%Y%m%dT%H%M%SZ)-1~${distro}+1"
|
|
|
|
git clean -fdx && git reset --hard refs/tags/v${stable_ver}
|
|
|
|
./build/set-fs-version.sh "$ver"
|
2014-03-19 15:08:17 -04:00
|
|
|
git add configure.ac && git commit -m "bump to custom v$ver"
|
2014-02-23 12:11:21 -05:00
|
|
|
(cd debian && ./bootstrap.sh -c $distro)
|
|
|
|
dch -b -m -v "$ver" --force-distribution -D "unstable" "Custom build."
|
|
|
|
dpkg-buildpackage -b -us -uc -Zxz -z9
|
|
|
|
git reset --hard origin/master
|
2012-09-04 10:53:34 -04:00
|
|
|
|
2014-02-23 12:44:59 -05:00
|
|
|
Building the freeswitch-sounds and freeswitch-music packages
|
|
|
|
------------------------------------------------------------
|
2014-01-17 15:06:14 -05:00
|
|
|
|
2012-08-20 04:18:02 -04:00
|
|
|
The source packages for sounds and music on hold are maintained in a
|
|
|
|
separate repository. Each set of sounds has a separate version number
|
|
|
|
and the processing of the sounds is quite different from what we're
|
|
|
|
doing here, so trying to maintain a merged debian/ between FreeSWITCH
|
|
|
|
and the sounds and music would be a mess.
|
|
|
|
|
|
|
|
To build the Debian packages for freeswitch-sounds-* and
|
|
|
|
freeswitch-music-*:
|
|
|
|
|
2014-02-23 12:11:21 -05:00
|
|
|
git clone https://github.com/traviscross/freeswitch-sounds.git
|
|
|
|
cd freeswitch-sounds && cat debian/README.source
|
2012-08-20 04:18:02 -04:00
|
|
|
|
2014-03-19 15:08:17 -04:00
|
|
|
-- Travis Cross <tc@traviscross.com>, Wed, 19 Mar 2014 19:07:23 +0000
|