diff --git a/.gitignore b/.gitignore index b8bd5c7edf..f31e630473 100644 --- a/.gitignore +++ b/.gitignore @@ -57,6 +57,7 @@ core.* !/w32/Setup/inno_setup/vcredist_x86.exe /.version +/.stamp-* /a.out.dSYM /AUTHORS /ChangeLog diff --git a/debian/.gitignore b/debian/.gitignore new file mode 100644 index 0000000000..ff6803d774 --- /dev/null +++ b/debian/.gitignore @@ -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-*/ diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000000..607e37ec18 --- /dev/null +++ b/debian/README.Debian @@ -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 , Sat, 5 May 2012 06:31:24 +0000 diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 0000000000..9f20a9d4a2 --- /dev/null +++ b/debian/README.source @@ -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: / + Description: + # empty lines with "."s are not yet supported + Build-Depends: + Depends: + Recommends: + Suggests: + Distro-Conflicts: # 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 + / + +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 , Sat, 5 May 2012 08:04:19 +0000 diff --git a/debian/bootstrap.sh b/debian/bootstrap.sh new file mode 100755 index 0000000000..ecf3070b9a --- /dev/null +++ b/debian/bootstrap.sh @@ -0,0 +1,739 @@ +#!/bin/bash +##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*- +##### Author: Travis Cross + +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 < +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 <= 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 <> 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 </dev/null && return 0 + cat < 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 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000000..3df3c52971 --- /dev/null +++ b/debian/changelog @@ -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 Sat, 05 May 2012 07:10:14 +0000 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000000..45a4fb75db --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +8 diff --git a/debian/control-modules b/debian/control-modules new file mode 100644 index 0000000000..bb3ed507e8 --- /dev/null +++ b/debian/control-modules @@ -0,0 +1,640 @@ +# -*- mode:debian-control -*- +##### Author: Travis Cross + +## 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. + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000000..8c08cfc189 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,8 @@ +Format: http://dep.debian.net/deps/dep5 +Upstream-Name: freeswitch +Source: http://freeswitch.org/ + +Files: debian/* +Copyright: 2012 Travis Cross +License: MPL or GPL2+ (at your option) + diff --git a/debian/create-dbg-pkgs.sh b/debian/create-dbg-pkgs.sh new file mode 100755 index 0000000000..b6a33fa617 --- /dev/null +++ b/debian/create-dbg-pkgs.sh @@ -0,0 +1,17 @@ +#!/bin/bash +##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*- +##### Author: Travis Cross + +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 + diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000000..e69de29bb2 diff --git a/debian/freeswitch-dev.install b/debian/freeswitch-dev.install new file mode 100644 index 0000000000..704d7b1444 --- /dev/null +++ b/debian/freeswitch-dev.install @@ -0,0 +1,4 @@ +/usr/include +/usr/lib/freeswitch/mod/*.la +/usr/lib/*.{a,la} +/usr/lib/pkgconfig diff --git a/debian/freeswitch-doc.docs b/debian/freeswitch-doc.docs new file mode 100644 index 0000000000..d4f4542584 --- /dev/null +++ b/debian/freeswitch-doc.docs @@ -0,0 +1 @@ +#DOCS# diff --git a/debian/freeswitch-doc.install b/debian/freeswitch-doc.install new file mode 100644 index 0000000000..d4f4542584 --- /dev/null +++ b/debian/freeswitch-doc.install @@ -0,0 +1 @@ +#DOCS# diff --git a/debian/freeswitch-htdocs-slim.install b/debian/freeswitch-htdocs-slim.install new file mode 100644 index 0000000000..0975415a85 --- /dev/null +++ b/debian/freeswitch-htdocs-slim.install @@ -0,0 +1,3 @@ +/usr/share/freeswitch/htdocs/license.txt +/usr/share/freeswitch/htdocs/slim.swf +/usr/share/freeswitch/htdocs/slimtest.htm diff --git a/debian/freeswitch-mod-pocketsphinx.install.tmpl b/debian/freeswitch-mod-pocketsphinx.install.tmpl new file mode 100644 index 0000000000..8c57f297af --- /dev/null +++ b/debian/freeswitch-mod-pocketsphinx.install.tmpl @@ -0,0 +1 @@ +/usr/share/freeswitch/grammar diff --git a/debian/freeswitch-systemd.freeswitch.service b/debian/freeswitch-systemd.freeswitch.service new file mode 100644 index 0000000000..1e7d2fcad1 --- /dev/null +++ b/debian/freeswitch-systemd.freeswitch.service @@ -0,0 +1,35 @@ +;;;;; Author: Travis Cross + +[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 + diff --git a/debian/freeswitch-systemd.install b/debian/freeswitch-systemd.install new file mode 100644 index 0000000000..d647282ecd --- /dev/null +++ b/debian/freeswitch-systemd.install @@ -0,0 +1 @@ +/lib/systemd/system/freeswitch.service diff --git a/debian/freeswitch-sysvinit.freeswitch.default b/debian/freeswitch-sysvinit.freeswitch.default new file mode 100644 index 0000000000..1c939b55d0 --- /dev/null +++ b/debian/freeswitch-sysvinit.freeswitch.default @@ -0,0 +1,2 @@ +# /etc/default/freeswitch +DAEMON_OPTS="" diff --git a/debian/freeswitch-sysvinit.freeswitch.init b/debian/freeswitch-sysvinit.freeswitch.init new file mode 100644 index 0000000000..d02229b4e9 --- /dev/null +++ b/debian/freeswitch-sysvinit.freeswitch.init @@ -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 + +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 diff --git a/debian/freeswitch.install b/debian/freeswitch.install new file mode 100644 index 0000000000..5c43763aa5 --- /dev/null +++ b/debian/freeswitch.install @@ -0,0 +1,3 @@ +/usr/bin +/usr/lib/libfreeswitch.so* +/usr/share/freeswitch/scripts diff --git a/debian/freeswitch.postinst b/debian/freeswitch.postinst new file mode 100644 index 0000000000..d1bbe72c15 --- /dev/null +++ b/debian/freeswitch.postinst @@ -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 diff --git a/debian/freeswitch.postrm b/debian/freeswitch.postrm new file mode 100644 index 0000000000..5e21c84397 --- /dev/null +++ b/debian/freeswitch.postrm @@ -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 diff --git a/debian/freeswitch.preinst b/debian/freeswitch.preinst new file mode 100644 index 0000000000..56dc52da8f --- /dev/null +++ b/debian/freeswitch.preinst @@ -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 diff --git a/debian/freeswitch.prerm b/debian/freeswitch.prerm new file mode 100644 index 0000000000..c2d46bc865 --- /dev/null +++ b/debian/freeswitch.prerm @@ -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 diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000000..3889b7e9ee --- /dev/null +++ b/debian/gbp.conf @@ -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 diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000000..c0b6bf9038 --- /dev/null +++ b/debian/rules @@ -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 + diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000000..163aaf8d82 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt)