debian: add new and vastly improved packaging for Debian

We now break out each module and component of FreeSWITCH into a
separate individually-installable package.  For each package with
executables or modules, we also build a package that includes the
stripped debugging symbols so that users can be helpful when they
discover bugs in FreeSWITCH.

As of this commit, we successfully build 263 distinct binary packages
starting from a clean minimal image on both Debian Sid and Debian
Squeeze.

To keep this manageable, we include a program that generates the
various Debian packaging files from a consolidated description of the
modules and their metadata.  The program can even generate this
configuration file by walking the FreeSWITCH source tree.

To provide a smooth user experience, we provide meta-packages that
install sensible sets of modules and other components.

All files are installed into the traditional and customary Linux
directories that you would expect in accordance with the Filesystem
Hierarchy Standard (FHS).

This commit also adds support for running FreeSWITCH as a forked
systemd service in Debian.

For more information about the technical details of the source
packaging, how to build the binary packages from source, and how you
can contribute, please read debian/README.source.

To learn about how this packaging affects you as a user and how to use
the finished Debian packages, read debian/README.Debian.

Signed-off-by: Travis Cross <tc@traviscross.com>
This commit is contained in:
Travis Cross 2012-02-24 01:03:09 +00:00
parent 9181e8e51b
commit 4ce0f57a8b
28 changed files with 1917 additions and 0 deletions

1
.gitignore vendored
View File

@ -57,6 +57,7 @@ core.*
!/w32/Setup/inno_setup/vcredist_x86.exe
/.version
/.stamp-*
/a.out.dSYM
/AUTHORS
/ChangeLog

21
debian/.gitignore vendored Normal file
View File

@ -0,0 +1,21 @@
# gitignore
/.stamp-bootstrap
/control
/control-modules.*
/files
/modules.conf
/modules_.conf
/freeswitch-autotools.install
/freeswitch-mod-*.install
/freeswitch-conf-*.install
/freeswitch-sounds-*.install
/*.log
/*.substvars
/*.debhelper
/tmp
/freeswitch/
/freeswitch-dbg/
/freeswitch-dev/
/freeswitch-doc/
/freeswitch-mod-*/
/freeswitch-sounds-*/

18
debian/README.Debian vendored Normal file
View File

@ -0,0 +1,18 @@
FreeSWITCH for Debian
--------------
This debian packaging breaks out every module of freeswitch into a
separate package, so be sure to verify that you are actually
installing all the modules that you need.
As a break from the past, we now install all files into their correct
FHS locations.
This package does not install any configuration for freeswitch into
/etc/freeswitch. We leave you, the system administrator completely
responsible for that directory. If you install one of the conf
packages, it will install the corresponding sample configuration to
/usr/share/freeswitch/conf and you'll need to copy the bits you need
to /etc/freeswitch.
-- Travis Cross <tc@traviscross.com>, Sat, 5 May 2012 06:31:24 +0000

57
debian/README.source vendored Normal file
View File

@ -0,0 +1,57 @@
FreeSWITCH for Debian
--------------
You may be reading this because you're wondering where all the files
are in debian/, such as control.
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.
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.
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>
To build this package, I recommend running the following from the root
directory of your FS git working tree:
mkdir ../sounds
export FS_SOUNDS_DIR=$(pwd)/../sounds
git clean -fdx && git reset --hard HEAD
(cd debian && ./bootstrap.sh)
schedtool -B -e git-buildpackage --git-verbose -us -uc
-- Travis Cross <tc@traviscross.com>, Sat, 5 May 2012 08:04:19 +0000

739
debian/bootstrap.sh vendored Executable file
View File

@ -0,0 +1,739 @@
#!/bin/bash
##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*-
##### Author: Travis Cross <tc@traviscross.com>
mod_dir="../src/mod"
conf_dir="../conf"
fs_description="FreeSWITCH is a scalable open source cross-platform telephony platform designed to route and interconnect popular communication protocols using audio, video, text or any other form of media."
mod_build_depends="."
avoid_mods=(
applications/mod_fax
applications/mod_ladspa
applications/mod_limit
applications/mod_mp4
applications/mod_osp
applications/mod_rad_auth
applications/mod_skel
asr_tts/mod_cepstral
codecs/mod_com_g729
codecs/mod_sangoma_codec
codecs/mod_skel_codec
codecs/mod_voipcodecs
endpoints/mod_gsmopen
endpoints/mod_h323
endpoints/mod_khomp
endpoints/mod_opal
endpoints/mod_portaudio
endpoints/mod_reference
endpoints/mod_unicall
event_handlers/mod_snmp
formats/mod_portaudio_stream
formats/mod_vlc
languages/mod_java
languages/mod_managed
languages/mod_spidermonkey
languages/mod_yaml
sdk/autotools
xml_int/mod_xml_ldap
)
err () {
echo "$0 error: $1" >&2
exit 1
}
xread() {
local xIFS="$IFS"
IFS=''
read $@
local ret=$?
IFS="$xIFS"
return $ret
}
avoid_mod_filter () {
for x in "${avoid_mods[@]}"; do
[ "$1" = "$x" ] && return 1
done
return 0
}
modconf_filter () {
while xread line; do
[ "$1" = "$line" ] && return 0
done < modules.conf
return 1
}
mod_filter () {
if test -f modules.conf; then
modconf_filter $@
else
avoid_mod_filter $@
fi
}
map_fs_modules () {
local filterfn="$1" percatfns="$2" permodfns="$3"
for x in $mod_dir/*; do
if test -d $x; then
category=${x##*/} category_path=$x
for f in $percatfns; do $f; done
for y in $x/*; do
module_name=${y##*/} module_path=$y
module=$category/$module_name
if $filterfn $category/$module; then
[ -f ${y}/module ] && . ${y}/module
for f in $permodfns; do $f; done
fi
unset module_name module_path module
done
unset category category_path
fi
done
}
map_modules() {
local filterfn="$1" percatfns="$2" permodfns="$3"
for x in $parse_dir/*; do
test -d $x || continue
category=${x##*/} category_path=$x
for f in $percatfns; do $f; done
for y in $x/*; do
test -f $y || continue
module=${y##*/} module_path=$y
$filterfn $category/$module || continue
module="" category="" module_name=""
description="" long_description=""
build_depends="" depends="" recommends="" suggests=""
distro_conflicts=""
. $y
[ -n "$description" ] || description="$module_name"
[ -n "$long_description" ] || description="Adds ${module_name}."
for f in $permodfns; do $f; done
unset \
module module_name module_path \
description long_description \
build_depends depends recommends suggests \
distro_conflicts
done
unset category category_path
done
}
map_confs () {
local fs="$1"
for x in $conf_dir/*; do
test ! -d $x && continue
conf=${x##*/} conf_dir=$x
for f in $fs; do $f; done
unset conf conf_dir
done
}
print_source_control () {
cat <<EOF
Source: freeswitch
Section: comm
Priority: optional
Maintainer: Travis Cross <tc@traviscross.com>
Build-Depends:
# for debian
debhelper (>= 8.0.0),
# bootstrapping
automake (>= 1.9), autoconf, libtool,
# core build
build-essential, wget, pkg-config,
# configure options
libssl-dev, unixodbc-dev,
libncurses5-dev, libjpeg8-dev,
python-dev, erlang-dev,
# documentation
doxygen,
# for APR (not essential for build)
uuid-dev, libexpat1-dev, libgdbm-dev, libdb-dev,
# used by many modules
bison, zlib1g-dev,
# module build-depends
$(debian_wrap "${mod_build_depends}")
Standards-Version: 3.9.2
Homepage: http://freeswitch.org/
Vcs-Git: git://git.freeswitch.org/freeswitch
Vcs-Browser: http://git.freeswitch.org/git/freeswitch/
EOF
}
print_core_control () {
cat <<EOF
Package: freeswitch
Architecture: any
Depends: \${shlibs:Depends}, \${perl:Depends}, \${misc:Depends}
Recommends:
Suggests: freeswitch-dbg
Description: Cross-Platform Scalable Multi-Protocol Soft Switch
$(debian_wrap "${fs_description}")
.
This package contains the FreeSWITCH core.
Package: freeswitch-meta-bare
Architecture: any
Depends: \${misc:Depends}, freeswitch (= \${binary:Version})
Recommends:
freeswitch-doc (= \${binary:Version}),
freeswitch-htdocs-slim (= \${binary:Version}),
freeswitch-mod-commands (= \${binary:Version}),
freeswitch-init (= \${binary:Version}),
freeswitch-music (= \${binary:Version}),
freeswitch-sounds (= \${binary:Version})
Suggests:
Description: Cross-Platform Scalable Multi-Protocol Soft Switch
$(debian_wrap "${fs_description}")
.
This is a meta package containing a very bare FreeSWITCH install.
Package: freeswitch-meta-default
Architecture: any
Depends: \${misc:Depends}, freeswitch (= \${binary:Version}),
freeswitch-mod-commands (= \${binary:Version}),
freeswitch-mod-conference (= \${binary:Version}),
freeswitch-mod-db (= \${binary:Version}),
freeswitch-mod-dptools (= \${binary:Version}),
freeswitch-mod-fifo (= \${binary:Version}),
freeswitch-mod-hash (= \${binary:Version}),
freeswitch-mod-spandsp (= \${binary:Version}),
freeswitch-mod-voicemail (= \${binary:Version}),
freeswitch-mod-dialplan-xml (= \${binary:Version}),
freeswitch-mod-loopback (= \${binary:Version}),
freeswitch-mod-sofia (= \${binary:Version}),
freeswitch-mod-local-stream (= \${binary:Version}),
freeswitch-mod-native-file (= \${binary:Version}),
freeswitch-mod-tone-stream (= \${binary:Version}),
freeswitch-mod-lua (= \${binary:Version}),
freeswitch-mod-console (= \${binary:Version}),
freeswitch-mod-say-en (= \${binary:Version})
Recommends:
freeswitch-init (= \${binary:Version}),
freeswitch-meta-codecs (= \${binary:Version}),
freeswitch-music (= \${binary:Version}),
freeswitch-sounds (= \${binary:Version})
Suggests:
freeswitch-mod-cidlookup (= \${binary:Version}),
freeswitch-mod-curl (= \${binary:Version}),
freeswitch-mod-directory (= \${binary:Version}),
freeswitch-mod-enum (= \${binary:Version}),
freeswitch-mod-spy (= \${binary:Version}),
freeswitch-mod-valet-parking (= \${binary:Version})
Description: Cross-Platform Scalable Multi-Protocol Soft Switch
$(debian_wrap "${fs_description}")
.
This is a meta package containing a reasonable basic FreeSWITCH
install.
Package: freeswitch-meta-vanilla
Architecture: any
Depends: \${misc:Depends}, freeswitch (= \${binary:Version}),
freeswitch-mod-console (= \${binary:Version}),
freeswitch-mod-logfile (= \${binary:Version}),
freeswitch-mod-enum (= \${binary:Version}),
freeswitch-mod-cdr-csv (= \${binary:Version}),
freeswitch-mod-event-socket (= \${binary:Version}),
freeswitch-mod-sofia (= \${binary:Version}),
freeswitch-mod-loopback (= \${binary:Version}),
freeswitch-mod-commands (= \${binary:Version}),
freeswitch-mod-conference (= \${binary:Version}),
freeswitch-mod-db (= \${binary:Version}),
freeswitch-mod-dptools (= \${binary:Version}),
freeswitch-mod-expr (= \${binary:Version}),
freeswitch-mod-fifo (= \${binary:Version}),
freeswitch-mod-hash (= \${binary:Version}),
freeswitch-mod-voicemail (= \${binary:Version}),
freeswitch-mod-esf (= \${binary:Version}),
freeswitch-mod-fsv (= \${binary:Version}),
freeswitch-mod-cluechoo (= \${binary:Version}),
freeswitch-mod-valet-parking (= \${binary:Version}),
freeswitch-mod-httapi (= \${binary:Version}),
freeswitch-mod-dialplan-xml (= \${binary:Version}),
freeswitch-mod-dialplan-asterisk (= \${binary:Version}),
freeswitch-mod-spandsp (= \${binary:Version}),
freeswitch-mod-g723-1 (= \${binary:Version}),
freeswitch-mod-g729 (= \${binary:Version}),
freeswitch-mod-amr (= \${binary:Version}),
freeswitch-mod-ilbc (= \${binary:Version}),
freeswitch-mod-speex (= \${binary:Version}),
freeswitch-mod-h26x (= \${binary:Version}),
freeswitch-mod-siren (= \${binary:Version}),
freeswitch-mod-sndfile (= \${binary:Version}),
freeswitch-mod-native-file (= \${binary:Version}),
freeswitch-mod-local-stream (= \${binary:Version}),
freeswitch-mod-tone-stream (= \${binary:Version}),
freeswitch-mod-lua (= \${binary:Version}),
freeswitch-mod-say-en (= \${binary:Version}),
Recommends:
freeswitch-init (= \${binary:Version}),
freeswitch-music (= \${binary:Version}),
freeswitch-sounds (= \${binary:Version}),
freeswitch-conf-vanilla (= \${binary:Version}),
Suggests:
freeswitch-mod-spidermonkey (= \${binary:Version}),
Description: Cross-Platform Scalable Multi-Protocol Soft Switch
$(debian_wrap "${fs_description}")
.
This is a meta package containing the FreeSWITCH modules required to
run the vanilla example configuration.
Package: freeswitch-meta-codecs
Architecture: any
Depends: \${misc:Depends}, freeswitch (= \${binary:Version}),
freeswitch-mod-amr (= \${binary:Version}),
freeswitch-mod-amrwb (= \${binary:Version}),
freeswitch-mod-bv (= \${binary:Version}),
freeswitch-mod-celt (= \${binary:Version}),
freeswitch-mod-codec2 (= \${binary:Version}),
freeswitch-mod-g723-1 (= \${binary:Version}),
freeswitch-mod-g729 (= \${binary:Version}),
freeswitch-mod-h26x (= \${binary:Version}),
freeswitch-mod-ilbc (= \${binary:Version}),
freeswitch-mod-mp4v (= \${binary:Version}),
freeswitch-mod-opus (= \${binary:Version}),
freeswitch-mod-silk (= \${binary:Version}),
freeswitch-mod-siren (= \${binary:Version}),
freeswitch-mod-speex (= \${binary:Version}),
freeswitch-mod-theora (= \${binary:Version})
Description: Cross-Platform Scalable Multi-Protocol Soft Switch
$(debian_wrap "${fs_description}")
.
This is a meta package containing most FreeSWITCH codecs.
Package: freeswitch-dbg
Section: debug
Architecture: any
Depends: \${misc:Depends}, freeswitch (= \${binary:Version})
Description: debugging symbols for FreeSWITCH
$(debian_wrap "${fs_description}")
.
This package contains debugging symbols for FreeSWITCH.
Package: freeswitch-dev
Section: libdevel
Architecture: any
Depends: \${misc:Depends}, freeswitch
Description: development libraries and header files for FreeSWITCH
$(debian_wrap "${fs_description}")
.
This package contains include files for FreeSWITCH.
Package: freeswitch-doc
Architecture: all
Description: documentation for FreeSWITCH
$(debian_wrap "${fs_description}")
.
This package contains Doxygen-produce documentation for FreeSWITCH.
Package: freeswitch-init
Architecture: all
Depends: \${misc:Depends},
freeswitch-sysvinit (= \${binary:Version}),
freeswitch-systemd (= \${binary:Version})
Description: FreeSWITCH startup configuration
$(debian_wrap "${fs_description}")
.
This package contains the system startup configuration for
FreeSWITCH.
Package: freeswitch-sysvinit
Architecture: all
Depends: \${misc:Depends}, lsb-base (>= 3.0-6)
Description: FreeSWITCH SysV init script
$(debian_wrap "${fs_description}")
.
This package contains the SysV init script for FreeSWITCH.
Package: freeswitch-systemd
Architecture: all
Depends: \${misc:Depends}
Description: FreeSWITCH systemd configuration
$(debian_wrap "${fs_description}")
.
This package contains the systemd configuration for FreeSWITCH.
## misc
Package: freeswitch-htdocs-slim
Architecture: all
Depends: \${misc:Depends}
Description: FreeSWITCH htdocs slim player
$(debian_wrap "${fs_description}")
.
This package contains the slim SWF player for FreeSWITCH.
## sounds
Package: freeswitch-music
Architecture: all
Depends: \${misc:Depends},
freeswitch-music-default (= \${binary:Version})
Description: Music on hold audio for FreeSWITCH
$(debian_wrap "${fs_description}")
.
This package contains music on hold audio for FreeSWITCH.
Package: freeswitch-music-default
Architecture: all
Depends: \${misc:Depends},
freeswitch-music-default-8k (= \${binary:Version})
Recommends:
freeswitch-music-default-16k (= \${binary:Version}),
freeswitch-music-default-32k (= \${binary:Version}),
freeswitch-music-default-48k (= \${binary:Version})
Description: Music on hold audio for FreeSWITCH
$(debian_wrap "${fs_description}")
.
This package contains the default music on hold audio for FreeSWITCH.
Package: freeswitch-sounds
Architecture: all
Depends: \${misc:Depends},
freeswitch-sounds-en (= \${binary:Version})
Description: Sounds for FreeSWITCH
$(debian_wrap "${fs_description}")
.
This package contains sounds for FreeSWITCH.
Package: freeswitch-sounds-en
Architecture: all
Depends: \${misc:Depends},
freeswitch-sounds-en-us (= \${binary:Version})
Description: English sounds for FreeSWITCH
$(debian_wrap "${fs_description}")
.
This package contains the English sounds for FreeSWITCH.
Package: freeswitch-sounds-en-us
Architecture: all
Depends: \${misc:Depends},
freeswitch-sounds-en-us-callie (= \${binary:Version})
Description: US English sounds for FreeSWITCH
$(debian_wrap "${fs_description}")
.
This package contains the US/English sounds for FreeSWITCH.
Package: freeswitch-sounds-en-us-callie
Architecture: all
Depends: \${misc:Depends},
freeswitch-sounds-en-us-callie-8k (= \${binary:Version})
Recommends:
freeswitch-sounds-en-us-callie-16k (= \${binary:Version}),
freeswitch-sounds-en-us-callie-32k (= \${binary:Version}),
freeswitch-sounds-en-us-callie-48k (= \${binary:Version})
Description: US English sounds for FreeSWITCH
$(debian_wrap "${fs_description}")
.
This package contains the Callie English sounds for FreeSWITCH.
EOF
}
print_mod_control () {
cat <<EOF
Package: freeswitch-${module_name//_/-}
Architecture: any
$(debian_wrap "Depends: \${shlibs:Depends}, \${misc:Depends}, freeswitch, ${depends}")
$(debian_wrap "Recommends: ${recommends}")
$(debian_wrap "Suggests: freeswitch-${module_name//_/-}-dbg, ${suggests}")
Description: ${description} for FreeSWITCH
$(debian_wrap "${fs_description}")
.
$(debian_wrap "This package contains ${module_name} for FreeSWITCH.")
.
$(debian_wrap "${long_description}")
Package: freeswitch-${module_name//_/-}-dbg
Section: debug
Architecture: any
Depends: \${misc:Depends},
freeswitch-${module_name//_/-} (= \${binary:Version})
Description: ${description} for FreeSWITCH (debug)
$(debian_wrap "${fs_description}")
.
$(debian_wrap "This package contains debugging symbols for ${module_name} for FreeSWITCH.")
.
$(debian_wrap "${long_description}")
EOF
}
print_mod_install () {
cat <<EOF
/usr/lib/freeswitch/mod/${1}.{la,so}
EOF
}
print_conf_control () {
cat <<EOF
Package: freeswitch-conf-${conf//_/-}
Architecture: all
Depends: \${misc:Depends}
Description: FreeSWITCH ${conf} configuration
$(debian_wrap "${fs_description}")
.
$(debian_wrap "This package contains the ${conf} configuration for FreeSWITCH.")
EOF
}
print_conf_install () {
cat <<EOF
conf/${conf} /usr/share/freeswitch/conf
EOF
}
print_music_control () {
cat <<EOF
Package: freeswitch-music-default-${rate_k}
Architecture: all
Depends: \${misc:Depends}
Description: Music on hold audio for FreeSWITCH
$(debian_wrap "${fs_description}")
.
This package contains the default music on hold audio for FreeSWITCH
at a sampling rate of ${rate}Hz.
EOF
}
print_music_install () {
cat <<EOF
/usr/share/freeswitch/sounds/music/${rate}
EOF
}
print_sound_control () {
cat <<EOF
Package: freeswitch-sounds-${sound//\//-}-${rate_k}
Architecture: all
Depends: \${misc:Depends}
Description: ${sound} sounds for FreeSWITCH
$(debian_wrap "${fs_description}")
.
This package contains the ${sound} sounds for FreeSWITCH at a
sampling rate of ${rate}Hz.
EOF
}
print_sound_install () {
cat <<EOF
/usr/share/freeswitch/sounds/${sound_path}/*/${rate}
EOF
}
print_edit_warning () {
echo "#### Do not edit! This file is auto-generated from debian/bootstrap.sh."; echo
}
gencontrol_per_mod () {
print_mod_control "$module_name" "$description" "$long_description" >> control
}
gencontrol_per_cat () {
(echo "## mod/$category"; echo) >> control
}
geninstall_per_mod () {
local f=freeswitch-${module_name//_/-}.install
(print_edit_warning; print_mod_install "$module_name") > $f
test -f $f.tmpl && cat $f.tmpl >> $f
}
genmodules_per_cat () {
echo "## $category" >> modules_.conf
}
genmodules_per_mod () {
echo "$module" >> modules_.conf
}
genconf () {
print_conf_control >> control
local f=freeswitch-conf-${conf//_/-}.install
(print_edit_warning; print_conf_install) > $f
test -f $f.tmpl && cat $f.tmpl >> $f
}
genmusic () {
rate="$1" rate_k="${rate%%000}k"
print_music_control >> control
local f=freeswitch-music-default-${rate_k}.install
(print_edit_warning; print_music_install) > $f
test -f $f.tmpl && cat $f.tmpl >> $f
unset rate rate_k
}
gensound () {
rate="$1" rate_k="${rate%%000}k" sound_path="$2" sound="${2,,}"
language=$(echo $sound | cut -d/ -f1)
country=$(echo $sound | cut -d/ -f2)
speaker=$(echo $sound | cut -d/ -f3)
print_sound_control >> control
local f=freeswitch-sounds-${sound//\//-}-${rate_k}.install
(print_edit_warning; print_sound_install) > $f
test -f $f.tmpl && cat $f.tmpl >> $f
unset rate rate_k sound sound_path language country speaker
}
accumulate_build_depends () {
if [ -n "$build_depends" ]; then
if [ ! "$mod_build_depends" = "." ]; then
mod_build_depends="${mod_build_depends}, ${build_depends}"
else
mod_build_depends="${build_depends}"
fi
fi
}
genmodctl_new_mod() {
grep -e "^Module: ${module}$" control-modules >/dev/null && return 0
cat <<EOF
Module: $module
Description: $description
$long_description
EOF
echo
}
genmodctl_new_cat() {
grep -e "^## mod/${category}$" control-modules >/dev/null && return 0
cat <<EOF
## mod/$category
EOF
}
pre_parse_mod_control() {
local fl=true ll_nl=false ll_descr=false
while xread l; do
if [ -z "$l" ]; then
# is newline
if ! $ll_nl && ! $fl; then
echo
fi
ll_nl=true
continue
elif [ -z "${l##\#*}" ]; then
# is comment
continue
elif [ -z "${l## *}" ]; then
# is continuation line
if ! $ll_descr; then
echo -n "$l"
else
echo -n "Long-Description: $(echo "$l" | sed -e 's/^ *//')"
fi
else
# is header line
$fl || echo
if [ "${l%%:*}" = "Description" ]; then
ll_descr=true
echo "Description: ${l#*: }"
continue
else
echo -n "$l"
fi
fi
fl=false ll_nl=false ll_descr=false
done < control-modules
}
var_escape() {
(echo -n \'; echo -n "$1" | sed -e "s/'/'\\\\''/g"; echo -n \')
}
parse_mod_control() {
pre_parse_mod_control > control-modules.preparse
local category=""
local module_name=""
rm -rf $parse_dir
while xread l; do
if [ -z "$l" ]; then
# is newline
continue
fi
local header="${l%%:*}"
local value="${l#*: }"
if [ "$header" = "Module" ]; then
category="${value%%/*}"
module_name="${value#*/}"
mkdir -p $parse_dir/$category
(echo "module=$(var_escape "$value")"; \
echo "category=$(var_escape "$category")"; \
echo "module_name=$(var_escape "$module_name")"; \
) >> $parse_dir/$category/$module_name
else
([ -n "$category" ] && [ -n "$module_name" ]) \
|| err "unexpected header $header"
local var_name="$(echo "$header" | sed -e 's/-/_/g' | tr '[A-Z]' '[a-z]')"
echo "${var_name}=$(var_escape "$value")" >> $parse_dir/$category/$module_name
fi
done < control-modules.preparse
}
debian_wrap() {
local fl=true
echo "$1" | fold -s -w 69 | while xread l; do
local v="$(echo "$l" | sed -e 's/ *$//g')"
if $fl; then
fl=false
echo "$v"
else
echo " $v"
fi
done
}
genmodctl_cat() {
(echo "## mod/$category"; echo)
}
genmodctl_mod() {
echo "Module: $module"
echo "Description: $description"
echo "$long_description" | fold -s -w 69 | while xread l; do
local v="$(echo "$l" | sed -e 's/ *$//g')"
echo " $v"
done
[ -n "$build_depends" ] && debian_wrap "Build-Depends: $build_depends"
[ -n "$depends" ] && debian_wrap "Depends: $depends"
[ -n "$reccomends" ] && debian_wrap "Recommends: $recommends"
[ -n "$suggests" ] && debian_wrap "Suggests: $suggests"
[ -n "$distro_conflicts" ] && debian_wrap "Distro-Conflicts: $distro_conflicts"
echo
}
echo "Please wait, this takes a few seconds..." >&2
parse_dir=control-modules.parse
map_fs_modules ':' 'genmodctl_new_cat' 'genmodctl_new_mod' >> control-modules
parse_mod_control
(echo "# -*- mode:debian-control -*-"; echo; \
map_modules ':' 'genmodctl_cat' 'genmodctl_mod' \
) > control-modules.gen
print_edit_warning > modules_.conf
map_modules 'mod_filter' '' 'accumulate_build_depends'
> control
(print_edit_warning; print_source_control; print_core_control) >> control
for r in 8000 16000 32000 48000; do genmusic $r; done
for x in 'en/us/callie'; do
for r in 8000 16000 32000 48000; do
gensound $r $x
done
done
(echo "### conf"; echo) >> control
map_confs 'genconf'
(echo "### modules"; echo) >> control
map_modules "mod_filter" \
"gencontrol_per_cat genmodules_per_cat" \
"gencontrol_per_mod geninstall_per_mod genmodules_per_mod"
touch .stamp-bootstrap

11
debian/changelog vendored Normal file
View File

@ -0,0 +1,11 @@
freeswitch (1.2~alpha1-1) unstable; urgency=low
* Initial release of FreeSWITCH in new debian packaging.
* The debian packaging has been completely rewritten from the ground up.
* We now install to the correct locations outlined in the Filesystem
Hierarchy Standard (FHS).
* All modules are packaged separately from the core.
* We have a handy system for autogenerating the final packaging
configuration from a consolidated configuration file.
-- Travis Cross <tc@traviscross.com> Sat, 05 May 2012 07:10:14 +0000

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
8

640
debian/control-modules vendored Normal file
View File

@ -0,0 +1,640 @@
# -*- mode:debian-control -*-
##### Author: Travis Cross <tc@traviscross.com>
## mod/applications
Module: applications/mod_abstraction
Description: Abstraction layer for APIs
This module provides a way to create new API functions via regex
rewriting.
Module: applications/mod_avmd
Description: Advanced voicemail detection
This module attempts to determine when a voicemail system has
answered the call.
Module: applications/mod_blacklist
Description: Blacklist helper
This module provides tools to blacklist callers.
Module: applications/mod_callcenter
Description: Call center
This module implements Automated Call Distribution (ACD) queues.
Module: applications/mod_cidlookup
Description: Caller ID name lookup
This module provides an API for querying caller ID name and location
data.
Module: applications/mod_cluechoo
Description: Clue Choo
This demo module renders a Clue Choo train on the FreeSWITCH console.
Module: applications/mod_commands
Description: Command module
This module provides miscellaneous API commands.
Module: applications/mod_conference
Description: Conference
This module provides multi-party conferencing.
Module: applications/mod_curl
Description: cURL
This module provides an API for making HTTP requests with cURL.
Module: applications/mod_db
Description: DB
This module implements simple db API, group support, and limit db
backend.
Module: applications/mod_directory
Description: Dial by name directory
This module implements a dial-by-name directory IVR.
Module: applications/mod_distributor
Description: Load distributor
This module implements a mechanism for performing load balancing.
Module: applications/mod_dptools
Description: Dialplan tools
This module implements basic dialplan tools.
Module: applications/mod_easyroute
Description: Easyroute
This module does destination lookup based on DID.
Module: applications/mod_enum
Description: ENUM
This module implements ENUM support.
Module: applications/mod_esf
Description: Multicast support
This module adds multi-cast support.
Module: applications/mod_esl
Description: Single ESL
This module adds an API for generating one-off ESL requests.
Module: applications/mod_expr
Description: Expr
This module adds expr support for expression evaluation.
Module: applications/mod_fax
Description: Fax
This module adds fax support provided by Steve Underwood's SpanDSP.
Module: applications/mod_fifo
Description: FIFO
This module adds a first-in first-out queue system.
Module: applications/mod_fsk
Description: Frequency-shift keying
This module adds frequency-shift keying support which can be used to
send and receive caller ID.
Module: applications/mod_fsv
Description: FSV
This module provides dialplan applications for recording and playing
FSV videos.
Module: applications/mod_hash
Description: Hash
This module provides a hash API, a key-value in-memory datastore.
Module: applications/mod_httapi
Description: HT-TAPI Hypertext Telephony API
This module provides an API for controlling the switch by responding
to HTTP requests.
Module: applications/mod_http_cache
Description: HTTP GET with caching
This module provides an API for making HTTP GET requests where the
result is cached.
Module: applications/mod_ladspa
Description: LADSPA
This module provides an API for accessing LADSPA plugins.
Module: applications/mod_lcr
Description: LCR
This module adds a facility for least-cost routing.
Module: applications/mod_limit
Description: Limit compatibility module
This module provides a backward-compatible interface to the DB limit
system.
Module: applications/mod_memcache
Description: Memcache
This module provides an interface to memcache servers.
Module: applications/mod_mongo
Description: MongoDB
This module provides an interface to MongoDB.
Build-Depends: scons, libboost-dev, libboost-system-dev,
libboost-date-time-dev, libboost-thread-dev, libboost-filesystem-dev
Depends: libicu44, libboost-system1.42.0, libboost-date-time1.42.0,
libboost-serialization1.42.0, libboost-thread1.42.0,
libboost-filesystem1.42.0
Module: applications/mod_mp4
Description: MP4 video support
This module adds support for MP4 video playback.
Module: applications/mod_nibblebill
Description: Nibblebill
This module allows for real-time accounting of a cash balance and
using that information for call routing.
Module: applications/mod_osp
Description: Open Settlement Protocol
This module adds support for the Open Settlement Protocol (OSP).
Module: applications/mod_rad_auth
Description: RADIUS AA
This module implements RADIUS Authentication and Authorization.
Module: applications/mod_redis
Description: Redis limit backend
This module provides a mechanism to use Redis as a backend data
store.
Module: applications/mod_rss
Description: RSS browser
This module provides an RSS browser.
Module: applications/mod_skel
Description: Framework demo module
This module demonstrates how to build an add-on module.
Module: applications/mod_sms
Description: Astract SMS
This module provides an abstract facility for interfacing with SMS
systems.
Module: applications/mod_snapshot
Description: Snapshot
This module can record a sliding window of audio and take snapshots
to disk.
Module: applications/mod_snipe_hunt
Description: Snipe hunt
This is a framework demo module.
Module: applications/mod_snom
Description: SNOM specific features
This module implements features specific to SNOM phones.
Module: applications/mod_soundtouch
Description: Soundtouch
This module implements example media bugs.
Module: applications/mod_spandsp
Description: SpanDSP
This module implements spandsp fax, dsp, and codec functionality.
Module: applications/mod_spy
Description: UserSpy
This module adds the ability to monitor the audio of a channel.
Module: applications/mod_stress
Description: Voice stress detection
This module attemps to detect voice stress on an audio channel.
Module: applications/mod_valet_parking
Description: Valet parking
This module implements the valet call parking strategy.
Module: applications/mod_vmd
Description: Voicemail detection
This module detects voicemail beeps at any frequency in O(1) time.
Module: applications/mod_voicemail
Description: Voicemail
This module provides a voicemail system.
Module: applications/mod_voicemail_ivr
Description: Voicemail IVR
This module provides an extensible voicemail IVR system.
## mod/asr_tts
Module: asr_tts/mod_cepstral
Description: mod_cepstral
Adds mod_cepstral.
Module: asr_tts/mod_flite
Description: mod_flite
Adds mod_flite.
Module: asr_tts/mod_pocketsphinx
Description: mod_pocketsphinx
Adds mod_pocketsphinx.
Module: asr_tts/mod_tts_commandline
Description: mod_tts_commandline
Adds mod_tts_commandline.
Module: asr_tts/mod_unimrcp
Description: mod_unimrcp
Adds mod_unimrcp.
## mod/codecs
Module: codecs/mod_amr
Description: mod_amr
Adds mod_amr.
Module: codecs/mod_amrwb
Description: mod_amrwb
Adds mod_amrwb.
Module: codecs/mod_bv
Description: mod_bv
Adds mod_bv.
Module: codecs/mod_celt
Description: mod_celt
Adds mod_celt.
Module: codecs/mod_codec2
Description: mod_codec2
Adds mod_codec2.
Module: codecs/mod_com_g729
Description: mod_com_g729
Adds mod_com_g729.
Module: codecs/mod_dahdi_codec
Description: mod_dahdi_codec
Adds mod_dahdi_codec.
Module: codecs/mod_g723_1
Description: mod_g723_1
Adds mod_g723_1.
Module: codecs/mod_g729
Description: mod_g729
Adds mod_g729.
Module: codecs/mod_h26x
Description: mod_h26x
Adds mod_h26x.
Module: codecs/mod_ilbc
Description: mod_ilbc
Adds mod_ilbc.
Module: codecs/mod_isac
Description: mod_isac
Adds mod_isac.
Module: codecs/mod_mp4v
Description: mod_mp4v
Adds mod_mp4v.
Module: codecs/mod_opus
Description: mod_opus
Adds mod_opus.
Module: codecs/mod_sangoma_codec
Description: mod_sangoma_codec
Adds mod_sangoma_codec.
Module: codecs/mod_silk
Description: mod_silk
Adds mod_silk.
Module: codecs/mod_siren
Description: mod_siren
Adds mod_siren.
Module: codecs/mod_skel_codec
Description: mod_skel_codec
Adds mod_skel_codec.
Module: codecs/mod_speex
Description: mod_speex
Adds mod_speex.
Build-Depends: libogg-dev
Depends: libogg0
Module: codecs/mod_theora
Description: mod_theora
Adds mod_theora.
Module: codecs/mod_voipcodecs
Description: mod_voipcodecs
Adds mod_voipcodecs.
## mod/dialplans
Module: dialplans/mod_dialplan_asterisk
Description: mod_dialplan_asterisk
Adds mod_dialplan_asterisk.
Module: dialplans/mod_dialplan_directory
Description: mod_dialplan_directory
Adds mod_dialplan_directory.
Module: dialplans/mod_dialplan_xml
Description: mod_dialplan_xml
Adds mod_dialplan_xml.
## mod/directories
Module: directories/mod_ldap
Description: mod_ldap
Adds mod_ldap.
## mod/endpoints
Module: endpoints/mod_alsa
Description: mod_alsa
Adds mod_alsa.
Build-Depends: libasound2-dev
Depends: libasound2
Module: endpoints/mod_dingaling
Description: mod_dingaling
Adds mod_dingaling.
Module: endpoints/mod_gsmopen
Description: mod_gsmopen
Adds mod_gsmopen.
Module: endpoints/mod_h323
Description: mod_h323
Adds mod_h323.
Module: endpoints/mod_khomp
Description: mod_khomp
Adds mod_khomp.
Module: endpoints/mod_loopback
Description: mod_loopback
Adds mod_loopback.
Module: endpoints/mod_opal
Description: mod_opal
Adds mod_opal.
Module: endpoints/mod_portaudio
Description: mod_portaudio
Adds mod_portaudio.
Module: endpoints/mod_reference
Description: mod_reference
Adds mod_reference.
Module: endpoints/mod_rtmp
Description: mod_rtmp
Adds mod_rtmp.
Module: endpoints/mod_skinny
Description: mod_skinny
Adds mod_skinny.
Module: endpoints/mod_skypopen
Description: mod_skypopen
Adds mod_skypopen.
Build-Depends: libx11-dev
Depends: libpthread-stubs0
Module: endpoints/mod_sofia
Description: mod_sofia
Adds mod_sofia.
Module: endpoints/mod_unicall
Description: mod_unicall
Adds mod_unicall.
## mod/event_handlers
Module: event_handlers/mod_cdr_csv
Description: mod_cdr_csv
Adds mod_cdr_csv.
Module: event_handlers/mod_cdr_mongodb
Description: mod_cdr_mongodb
Adds mod_cdr_mongodb.
Module: event_handlers/mod_cdr_pg_csv
Description: mod_cdr_pg_csv
Adds mod_cdr_pg_csv.
Build-Depends: libpq-dev
Depends: libpq5
Module: event_handlers/mod_cdr_sqlite
Description: mod_cdr_sqlite
Adds mod_cdr_sqlite.
Module: event_handlers/mod_erlang_event
Description: mod_erlang_event
Adds mod_erlang_event.
Module: event_handlers/mod_event_multicast
Description: mod_event_multicast
Adds mod_event_multicast.
Module: event_handlers/mod_event_socket
Description: mod_event_socket
Adds mod_event_socket.
Module: event_handlers/mod_event_test
Description: mod_event_test
Adds mod_event_test.
Module: event_handlers/mod_event_zmq
Description: mod_event_zmq
Adds mod_event_zmq.
Module: event_handlers/mod_json_cdr
Description: mod_json_cdr
Adds mod_json_cdr.
Module: event_handlers/mod_radius_cdr
Description: mod_radius_cdr
Adds mod_radius_cdr.
Module: event_handlers/mod_snmp
Description: mod_snmp
Adds mod_snmp.
## mod/formats
Module: formats/mod_local_stream
Description: mod_local_stream
Adds mod_local_stream.
Module: formats/mod_native_file
Description: mod_native_file
Adds mod_native_file.
Module: formats/mod_portaudio_stream
Description: mod_portaudio_stream
Adds mod_portaudio_stream.
Module: formats/mod_shell_stream
Description: mod_shell_stream
Adds mod_shell_stream.
Module: formats/mod_shout
Description: mod_shout
Adds mod_shout.
Module: formats/mod_sndfile
Description: mod_sndfile
Adds mod_sndfile.
Module: formats/mod_tone_stream
Description: mod_tone_stream
Adds mod_tone_stream.
Module: formats/mod_vlc
Description: VLC streaming
This module provides VLC streaming.
Build-Depends: libvlc-dev (>= 2.0.0)
Depends: libvlc5
Distro-Conflicts: squeeze
## mod/languages
Module: languages/mod_java
Description: mod_java
Adds mod_java.
Module: languages/mod_lua
Description: mod_lua
Adds mod_lua.
Module: languages/mod_managed
Description: mod_managed
Adds mod_managed.
Module: languages/mod_perl
Description: mod_perl
Adds mod_perl.
Build-Depends: libperl-dev
Depends: libperl5.10
Module: languages/mod_python
Description: mod_python
Adds mod_python.
Module: languages/mod_spidermonkey
Description: mod_spidermonkey
Adds mod_spidermonkey.
Module: languages/mod_yaml
Description: mod_yaml
Adds mod_yaml.
## mod/loggers
Module: loggers/mod_console
Description: mod_console
Adds mod_console.
Module: loggers/mod_logfile
Description: mod_logfile
Adds mod_logfile.
Module: loggers/mod_syslog
Description: mod_syslog
Adds mod_syslog.
## mod/say
Module: say/mod_say_de
Description: mod_say_de
Adds mod_say_de.
Module: say/mod_say_en
Description: mod_say_en
Adds mod_say_en.
Module: say/mod_say_es
Description: mod_say_es
Adds mod_say_es.
Module: say/mod_say_fr
Description: mod_say_fr
Adds mod_say_fr.
Module: say/mod_say_he
Description: mod_say_he
Adds mod_say_he.
Module: say/mod_say_hr
Description: mod_say_hr
Adds mod_say_hr.
Module: say/mod_say_hu
Description: mod_say_hu
Adds mod_say_hu.
Module: say/mod_say_it
Description: mod_say_it
Adds mod_say_it.
Module: say/mod_say_ja
Description: mod_say_ja
Adds mod_say_ja.
Module: say/mod_say_nl
Description: mod_say_nl
Adds mod_say_nl.
Module: say/mod_say_pt
Description: mod_say_pt
Adds mod_say_pt.
Module: say/mod_say_ru
Description: mod_say_ru
Adds mod_say_ru.
Module: say/mod_say_th
Description: mod_say_th
Adds mod_say_th.
Module: say/mod_say_zh
Description: mod_say_zh
Adds mod_say_zh.
## mod/sdk
Module: sdk/autotools
Description: autotools
Adds autotools.
## mod/timers
Module: timers/mod_posix_timer
Description: mod_posix_timer
Adds mod_posix_timer.
Module: timers/mod_timerfd
Description: mod_timerfd
Adds mod_timerfd.
## mod/xml_int
Module: xml_int/mod_xml_cdr
Description: mod_xml_cdr
Adds mod_xml_cdr.
Module: xml_int/mod_xml_curl
Description: mod_xml_curl
Adds mod_xml_curl.
Module: xml_int/mod_xml_ldap
Description: mod_xml_ldap
Adds mod_xml_ldap.
Build-Depends: libsasl2-dev
Depends: libsasl2-modules
Module: xml_int/mod_xml_rpc
Description: mod_xml_rpc
Adds mod_xml_rpc.

8
debian/copyright vendored Normal file
View File

@ -0,0 +1,8 @@
Format: http://dep.debian.net/deps/dep5
Upstream-Name: freeswitch
Source: http://freeswitch.org/
Files: debian/*
Copyright: 2012 Travis Cross <tc@traviscross.com>
License: MPL or GPL2+ (at your option)

17
debian/create-dbg-pkgs.sh vendored Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*-
##### Author: Travis Cross <tc@traviscross.com>
create_dbg_pkgs () {
for x in debian/*; do
test ! -d $x && continue
test "$x" = "tmp" -o "$x" = "source" && continue
test ! "$x" = "${x%-dbg}" && continue
test ! -d $x/usr/lib/debug && continue
mkdir -p $x-dbg/usr/lib
mv $x/usr/lib/debug $x-dbg/usr/lib/
done
}
create_dbg_pkgs

0
debian/docs vendored Normal file
View File

4
debian/freeswitch-dev.install vendored Normal file
View File

@ -0,0 +1,4 @@
/usr/include
/usr/lib/freeswitch/mod/*.la
/usr/lib/*.{a,la}
/usr/lib/pkgconfig

1
debian/freeswitch-doc.docs vendored Normal file
View File

@ -0,0 +1 @@
#DOCS#

1
debian/freeswitch-doc.install vendored Normal file
View File

@ -0,0 +1 @@
#DOCS#

3
debian/freeswitch-htdocs-slim.install vendored Normal file
View File

@ -0,0 +1,3 @@
/usr/share/freeswitch/htdocs/license.txt
/usr/share/freeswitch/htdocs/slim.swf
/usr/share/freeswitch/htdocs/slimtest.htm

View File

@ -0,0 +1 @@
/usr/share/freeswitch/grammar

View File

@ -0,0 +1,35 @@
;;;;; Author: Travis Cross <tc@traviscross.com>
[Unit]
Description=freeswitch
After=syslog.target network.target local-fs.target
[Service]
; service
Type=forking
PIDFile=/run/freeswitch/freeswitch.pid
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /run/freeswitch
ExecStartPre=/bin/chown freeswitch:freeswitch /run/freeswitch
ExecStart=/usr/bin/freeswitch -nc -nonat
TimeoutSec=45s
Restart=always
; exec
WorkingDirectory=/run/freeswitch
User=freeswitch
Group=freeswitch
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000
LimitSTACK=240
LimitRTPRIO=infinity
LimitRTTIME=7000000
IOSchedulingClass=realtime
IOSchedulingPriority=2
CPUSchedulingPolicy=rr
CPUSchedulingPriority=89
UMask=0007
[Install]
WantedBy=multi-user.target

1
debian/freeswitch-systemd.install vendored Normal file
View File

@ -0,0 +1 @@
/lib/systemd/system/freeswitch.service

View File

@ -0,0 +1,2 @@
# /etc/default/freeswitch
DAEMON_OPTS=""

View File

@ -0,0 +1,116 @@
#!/bin/sh
### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*-
### BEGIN INIT INFO
# Provides: freeswitch
# Required-Start: $network $local_fs
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: FreeSWITCH Softswitch
# Description: FreeSWITCH Softswitch
### END INIT INFO
# Author: Travis Cross <tc@traviscross.com>
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC=freeswitch
NAME=freeswitch
DAEMON=/usr/bin/freeswitch
DAEMON_ARGS="-u freeswitch -g freeswitch -rp -nc -nonat"
USER=freeswitch
PIDFILE=/var/run/$NAME/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
WORKDIR=/var/lib/$NAME
[ -x $DAEMON ] || exit 0
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
. /lib/init/vars.sh
. /lib/lsb/init-functions
do_start() {
start-stop-daemon --start --quiet \
--pidfile $PIDFILE --exec $DAEMON --name $NAME --user $USER \
--test > /dev/null \
|| return 1
ulimit -s 240
start-stop-daemon --start --quiet \
--pidfile $PIDFILE --exec $DAEMON --name $NAME --user $USER \
--chdir $WORKDIR -- $DAEMON_ARGS $DAEMON_OPTS \
|| return 2
return 0
}
stop_fs() {
start-stop-daemon --stop --quiet \
--pidfile $PIDFILE --name $NAME --user $USER \
--retry=TERM/30/KILL/5
}
stop_fs_children() {
start-stop-daemon --stop --quiet \
--exec $DAEMON \
--oknodo --retry=0/30/KILL/5
}
do_stop() {
stop_fs
RETVAL="$?"
[ "$RETVAL" -eq 2 ] && return 2
stop_fs_children
[ "$?" -eq 2 ] && return 2
rm -f $PIDFILE
return "$RETVAL"
}
do_reload() {
start-stop-daemon --stop --quiet \
--pidfile $PIDFILE --name $NAME --user $USER \
--signal HUP
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
status)
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
reload|force-reload)
log_daemon_msg "Reloading $DESC" "$NAME"
do_reload
log_end_msg $?
;;
restart)
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1|*) log_end_msg 1 ;;
esac
;;
*) log_end_msg 1 ;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
;;
esac
exit 0

3
debian/freeswitch.install vendored Normal file
View File

@ -0,0 +1,3 @@
/usr/bin
/usr/lib/libfreeswitch.so*
/usr/share/freeswitch/scripts

41
debian/freeswitch.postinst vendored Normal file
View File

@ -0,0 +1,41 @@
#!/bin/sh
set -e
case "$1" in
configure)
if ! getent group freeswitch >/dev/null; then
groupadd --system freeswitch
fi
if ! getent passwd freeswitch >/dev/null; then
useradd --system -g freeswitch -Gaudio \
-d /var/run/freeswitch \
-s /bin/false \
-e '' \
-c 'FreeSWITCH' \
freeswitch
fi
for x in \
/var/lib/freeswitch \
/var/lib/freeswitch/db \
/var/lib/freeswitch/recordings \
/var/lib/freeswitch/storage \
/var/log/freeswitch \
/var/run/freeswitch;
do
mkdir -p $x
chown -R freeswitch:freeswitch $x
chmod -R o-rwx,g+u $x
done
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

30
debian/freeswitch.postrm vendored Normal file
View File

@ -0,0 +1,30 @@
#!/bin/sh
set -e
case "$1" in
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
if [ "$1" = "purge" ]; then
if getent passwd freeswitch >/dev/null; then
userdel freeswitch
fi
if getent group freeswitch >/dev/null; then
groupdel freeswitch
fi
for x in \
/var/lib/freeswitch \
/var/log/freeswitch \
/var/run/freeswitch;
do
rm -rf $x
done
fi
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

18
debian/freeswitch.preinst vendored Normal file
View File

@ -0,0 +1,18 @@
#!/bin/sh
set -e
case "$1" in
install|upgrade)
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

18
debian/freeswitch.prerm vendored Normal file
View File

@ -0,0 +1,18 @@
#!/bin/sh
set -e
case "$1" in
remove|upgrade|deconfigure)
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

13
debian/gbp.conf vendored Normal file
View File

@ -0,0 +1,13 @@
# git-buildpackage
[git-buildpackage]
verbose=True
ignore-branch=True
ignore-new=True
upstream-branch=master
debian-branch=master
upstream-tree=branch
tag=False
force-create=True
compression=xz
compression-level=9ev
builder=debuild --prepend-path=/usr/lib/ccache -eFS_* -eCCACHE_* -i\.git -I.git -Zxz -z9

116
debian/rules vendored Executable file
View File

@ -0,0 +1,116 @@
#!/usr/bin/make -f
# -*- mode:makefile -*-
#export DH_VERBOSE=1
FS_CFLAGS?=-ggdb3 -O2
FS_CPPFLAGS?=
FS_CXXFLAGS?=$(FS_CFLAGS)
FS_INSTALL_SOUNDS?=true
export PATH?=/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export CFLAGS=$(FS_CFLAGS)
export CPPFLAGS=$(FS_CPPFLAGS)
export CXXFLAGS=$(FS_CXXFLAGS)
show_vars= \
echo; \
echo "Making target $@"; \
echo "PATH='$(PATH)'"; \
echo "CFLAGS='$(CFLAGS)'"; \
echo "CXXFLAGS='$(CXXFLAGS)'"; \
echo "CCACHE_DIR='$(CCACHE_DIR)'"; \
echo "FS_INSTALL_SOUNDS='$(FS_INSTALL_SOUNDS)'"; \
echo;
binary:
@$(call show_vars)
dh $@
binary-arch:
@$(call show_vars)
dh $@
binary-indep:
@$(call show_vars)
dh $@
build: debian/.stamp-bootstrap
@$(call show_vars)
dh $@
clean:
dh $@
override_dh_auto_clean:
dh_clean
.stamp-bootstrap:
@$(call show_vars)
./bootstrap.sh -j
touch $@
.stamp-configure: .stamp-bootstrap
@$(call show_vars)
touch noreg
cp debian/modules_.conf modules.conf
./configure -C --enable-portable-binary --disable-dependency-tracking \
--host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
--with-gnu-ld --with-python --with-erlang --with-openssl \
--enable-core-odbc-support --enable-zrtp \
--prefix=/usr --localstatedir=/var \
--sysconfdir=/etc/freeswitch \
--with-modinstdir=/usr/lib/freeswitch/mod \
--with-rundir=/var/run/freeswitch \
--with-logfiledir=/var/log/freeswitch \
--with-dbdir=/var/lib/freeswitch/db \
--with-htdocsdir=/usr/share/freeswitch/htdocs \
--with-soundsdir=/usr/share/freeswitch/sounds \
--with-grammardir=/usr/share/freeswitch/grammar \
--with-scriptdir=/usr/share/freeswitch/scripts \
--with-recordingsdir=/var/lib/freeswitch/recordings
touch $@
override_dh_auto_configure: .stamp-configure
.stamp-build: .stamp-configure
@$(call show_vars)
make
touch $@
override_dh_auto_build: .stamp-build
override_dh_auto_test:
override_dh_strip:
dh_strip -a -k
./debian/create-dbg-pkgs.sh
override_dh_auto_install:
dh_auto_install
-$(FS_INSTALL_SOUNDS) && DESTDIR=debian/tmp make cd-sounds-install cd-moh-install
mkdir -p debian/tmp/lib/systemd/system
install -m0644 debian/freeswitch-systemd.freeswitch.service debian/tmp/lib/systemd/system/freeswitch.service
override_dh_installinit:
dh_installinit -pfreeswitch-sysvinit --name=freeswitch
debian-bootstrap: debian/.stamp-bootstrap
debian/.stamp-bootstrap:
(cd debian && ./bootstrap.sh)
touch $@
binary-basetest:
@$(call show_vars)
echo "applications/mod_commands" > debian/modules.conf
(cd debian && ./bootstrap.sh)
dh binary
binary-quicktest:
@$(call show_vars)
echo "applications/mod_commands" > debian/modules.conf
(cd debian && ./bootstrap.sh)
env FS_INSTALL_SOUNDS=false dh binary \
-Nfreeswitch-sounds-music-8k \
-Nfreeswitch-sounds-music-16k \
-Nfreeswitch-sounds-music-32k \
-Nfreeswitch-sounds-music-48k \
-Nfreeswitch-sounds-en-us-callie-8k \
-Nfreeswitch-sounds-en-us-callie-16k \
-Nfreeswitch-sounds-en-us-callie-32k \
-Nfreeswitch-sounds-en-us-callie-48k

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)