Andrey Volk 689a376886 FS-11972: [Build-System] Add Raspberry Pi support. 2019-07-31 19:00:13 +04:00
source mod_curl is back in the packaged game and some weird source dir from debian ;)) 2010-10-15 10:53:48 +02:00
.gitignore Ignore debian/freeswitch-init.provided_by in git 2016-04-28 13:52:11 +00:00
AUTHORS FS-7607 #resolve #comment Update URLs to reflect https protocol on websites and update additional URLs to avoid 301 redirects. 2015-06-03 15:23:40 -05:00
README.Debian Make debian/README files more markdown-like 2014-02-23 22:39:15 +00:00
README.source debian/README.source updated 2015-08-24 10:27:23 -04:00
apt_sources.list FS-8019 debian/ ignored -T option 2015-08-22 20:22:06 -04:00 FS-11972: [Build-System] Add Raspberry Pi support. 2019-07-31 19:00:13 +04:00
changelog debian: version bump 2012-05-24 17:27:28 +00:00
compat debian: add new and vastly improved packaging for Debian 2012-05-05 11:54:05 +00:00
control-modules FS-11727: [mod_mariadb] Add MariaDB (MySQL) support 2019-07-23 20:07:16 +04:00
copyright cleanup unused 2017-11-20 11:30:50 -05:00
docs debian: add new and vastly improved packaging for Debian 2012-05-05 11:54:05 +00:00 debian: add new and vastly improved packaging for Debian 2012-05-05 11:54:05 +00:00
freeswitch-doc.install debian: add new and vastly improved packaging for Debian 2012-05-05 11:54:05 +00:00
freeswitch-mod-java.install.tmpl debian: install freeswitch.jar with mod_java 2012-05-15 07:19:51 +00:00
freeswitch-mod-managed.install.tmpl debian: Handle mod_managed .dll more idiomatically 2013-07-26 21:56:07 +00:00
freeswitch-mod-perl.install.tmpl FS-8426 place into /usr/share/perl5 2015-11-08 00:59:15 +01:00
freeswitch-mod-pocketsphinx.install.tmpl debian: add new and vastly improved packaging for Debian 2012-05-05 11:54:05 +00:00
freeswitch-mod-python.install.tmpl FS-5660 - add to the freeswitch-mod-python debian package 2015-09-17 21:07:40 +02:00
freeswitch-systemd.freeswitch.service FS-11704 "DAEMON_OPTS=-ncwait -nonat" in freeswitch.server causing startup failure 2019-03-12 23:49:16 +04:00
freeswitch-systemd.freeswitch.tmpfile FS-8194 FS-7910 FS-7937 systemd service improvements 2015-10-10 16:08:11 +02:00
freeswitch-sysvinit.freeswitch.default FS-7928 FS-7618 systemd and package build improvements 2015-10-13 22:36:37 +02:00
freeswitch-sysvinit.freeswitch.init FS-7909 working directory is now /var/log/freeswitch 2015-07-31 02:13:55 +02:00
freeswitch-timezones.install Create freeswitch-timezones debian package 2014-06-24 00:39:14 +00:00
freeswitch.dirs fix FS-9298 2018-02-22 22:13:46 +02:00
freeswitch.install Fix FS-9865 2018-10-14 17:25:22 +00:00
freeswitch.postinst FS-8948 #resolve Handle non-existent config in Debian postinst 2016-03-17 17:01:08 +01:00
freeswitch.postrm debian: whitespace 2012-05-06 22:46:36 +00:00
freeswitch.preinst debian: whitespace 2012-05-06 22:46:36 +00:00
freeswitch.prerm FS-8285 2015-10-02 10:06:02 -05:00
gbp.conf debian: don't force-create the orig tarball 2012-05-28 16:35:00 +00:00
libfreeswitch-dev.install debian: don't distribute .la file with libfreeswitch-dev 2012-05-09 23:15:03 +00:00
libfreeswitch1.install debian: separate out libfreeswitch1 2012-05-09 23:15:02 +00:00
license-reconcile.yml FS-10074: [libtiff] remove more libtiff references 2017-03-16 11:29:08 -05:00
python-esl.install FS-6972 Packaging a version of the python ESL wrapper for python. 2015-08-21 10:27:59 -03:00
rules FS-11880: [Core,mod_pgsql] Remove native PostgreSQL support from the core, add mod_pgsql database module. 2019-07-18 00:20:50 +04:00 FS-11972: [Build-System] Add Raspberry Pi support. 2019-07-31 19:00:13 +04:00


FreeSWITCH for Debian


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/  This bootstrap needs to run
before any other step of the packaging, though we do try to
autogenerate it when possible.

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
    git clone /usr/src/freeswitch/src
    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 && ./ -c $my_release)
    sed -i debian/control -e '/^#/d' && sed -i debian/control -e '/^$/N;/^\n$/D'
    mk-build-deps -i
    make -f debian/rules .stamp-configure && make

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

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.
Building in this manner is only supported on Debian jessie, though it
will generate packages for all supported Debian releases. Simply run as root:

    echo "USENETWORK=yes" >$HOME/.pbuilderrc

    ./debian/ build-all -ibn -z9 -aamd64 -cjessie

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/ build-all -ibn -z9 -t

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/ 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/ build-all -dni -z1 -a amd64 -c sid -l "applications/mod_commands"

Getting help with debian/

The debian/ has many options.  You can see the documentation
for these options by running:

    ./debian/ -h

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.

Building Debian packages without

Building the packages without is not recommended as
takes care of many non-trivial details.  If needed, however, the
packages can be built:

    ver="$(cat build/next-release.txt | sed -e 's/-/~/g')~n$(date +%Y%m%dT%H%M%SZ)-1~${distro}+1"
    git clean -fdx && git reset --hard origin/master
    ./build/ "$ver"
    git add && git commit -m "bump to custom v$ver"
    (cd debian && ./ -c $distro)
    dch -b -m -v "$ver" --force-distribution -D "unstable" "Custom build."
    dpkg-buildpackage -b -us -uc -Zxz -z9
    git reset --hard HEAD^

To build for a stable branch, do this:

    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/ "$ver"
    git add && git commit -m "bump to custom v$ver"
    (cd debian && ./ -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

Building the freeswitch-sounds and freeswitch-music packages

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

    git clone
    cd freeswitch-sounds && cat debian/README.source

 -- Travis Cross <>, Wed, 19 Mar 2014 19:07:23 +0000