diff --git a/debian/bootstrap.sh b/debian/bootstrap.sh index 74ed4cb1fe..418b9b998c 100755 --- a/debian/bootstrap.sh +++ b/debian/bootstrap.sh @@ -2,12 +2,33 @@ ##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*- ##### Author: Travis Cross +codename="sid" +modulelist_opt="" +modules_add="" +use_sysvinit="" +while getopts "c:m:p:v" o; do + case "$o" in + c) codename="$OPTARG" ;; + m) modulelist_opt="$OPTARG" ;; + p) modules_add="$modules_add $OPTARG";; + v) use_sysvinit="true";; + esac +done +shift $(($OPTIND-1)) + +if [ x${use_sysvinit} = x ]; then + case "$codename" in + wheezy|trusty|utopic) use_sysvinit="true";; + *) use_sysvinit="false";; + esac +fi + mod_dir="../src/mod" conf_dir="../conf" lang_dir="../conf/vanilla/lang" 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="." mod_depends="." mod_recommends="." mod_suggests="." -supported_debian_distros="squeeze wheezy jessie sid" +supported_debian_distros="wheezy jessie stretch sid" supported_ubuntu_distros="trusty utopic" supported_distros="$supported_debian_distros $supported_ubuntu_distros" avoid_mods=( @@ -46,11 +67,14 @@ avoid_mods_jessie=( avoid_mods_wheezy=( event_handlers/mod_amqp languages/mod_java -) -avoid_mods_squeeze=( - event_handlers/mod_amqp - formats/mod_vlc languages/mod_managed + applications/mod_av + applications/mod_cv + applications/mod_hiredis + formats/mod_shout + applications/mod_sonar + applications/mod_soundtouch + formats/mod_vlc ) avoid_mods_trusty=( ) @@ -75,13 +99,16 @@ freeswitch-dbg libfreeswitch1-dbg libfreeswitch-dev freeswitch-doc -freeswitch-init -freeswitch-sysvinit -freeswitch-systemd freeswitch-lang freeswitch-timezones ) +if [ ${use_sysvinit} = "true" ]; then + manual_pkgs=( "${manual_pkgs[@]}" "freeswitch-sysvinit" ) +else + manual_pkgs=( "${manual_pkgs[@]}" "freeswitch-systemd" ) +fi + err () { echo "$0 error: $1" >&2 exit 1 @@ -285,16 +312,20 @@ list_freeswitch_all_dbg_replaces () { print_source_control () { local libtool_dep="libtool, libtool-bin" case "$codename" in - squeeze|wheezy|trusty) libtool_dep="libtool" ;; + wheezy|trusty) libtool_dep="libtool" ;; esac -cat < Build-Depends: # for debian - debhelper (>= 8.0.0), + ${debhelper_dep}, # bootstrapping automake (>= 1.9), autoconf, ${libtool_dep}, # core build @@ -822,33 +853,6 @@ Description: documentation for FreeSWITCH This package contains Doxygen-produce documentation for FreeSWITCH. It may be an empty package at the moment. -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 is a metapackage which depends on the default system startup - packages 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 ## languages @@ -873,7 +877,37 @@ Description: Timezone files for FreeSWITCH . $(debian_wrap "This package includes the timezone files for FreeSWITCH.") +## startup + EOF + +if [ ${use_sysvinit} = "true" ]; then + cat <= 3.0-6), sysvinit +Conflicts: freeswitch-init +Provides: freeswitch-init +Description: FreeSWITCH SysV init script + $(debian_wrap "${fs_description}") + . + This package contains the SysV init script for FreeSWITCH. + +EOF +else + cat <&2 echo >&2 @@ -1325,14 +1348,16 @@ for x in postinst postrm preinst prerm; do done cp -a freeswitch-doc.docs freeswitch-all.docs -cp -a freeswitch-systemd.freeswitch.service freeswitch-all.freeswitch.service -cp -a freeswitch-systemd.freeswitch.tmpfile freeswitch-all.freeswitch.tmpfile -cp -a freeswitch-systemd.freeswitch.default freeswitch-all.freeswitch.default +if [ ${use_sysvinit} = "true" ]; then + cp -a freeswitch-sysvinit.freeswitch.init freeswitch-all.freeswitch.init + cp -a freeswitch-sysvinit.freeswitch.default freeswitch-all.freeswitch.default + echo -n freeswitch-sysvinit >freeswitch-init.provided_by +else + cp -a freeswitch-systemd.freeswitch.service freeswitch-all.freeswitch.service + cp -a freeswitch-systemd.freeswitch.tmpfile freeswitch-all.freeswitch.tmpfile + echo -n freeswitch-systemd >freeswitch-init.provided_by +fi -cp -a freeswitch-systemd.freeswitch.default freeswitch-sysvinit.freeswitch.default - -# TODO: FS-7928 need to add a condition and skip this for jessie and onward -cp -a freeswitch-sysvinit.freeswitch.init freeswitch-all.freeswitch.init echo "Generating additional lintian overrides..." >&2 grep -e '^Package:' control | while xread l; do diff --git a/debian/control-modules b/debian/control-modules index c009c96ee0..66c040f5d2 100644 --- a/debian/control-modules +++ b/debian/control-modules @@ -611,7 +611,6 @@ Description: VLC streaming Build-Depends: libvlc-dev (>= 2.0.0) Depends: vlc-nox Suggests: vlc-dbg -Distro-Conflicts: squeeze Module: formats/mod_webm Description: Adds mod_webm diff --git a/debian/freeswitch-systemd.freeswitch.service b/debian/freeswitch-systemd.freeswitch.service index 0a4380d8a4..2a3a97089b 100644 --- a/debian/freeswitch-systemd.freeswitch.service +++ b/debian/freeswitch-systemd.freeswitch.service @@ -10,7 +10,7 @@ Type=forking PIDFile=/run/freeswitch/freeswitch.pid Environment="DAEMON_OPTS=-nonat" EnvironmentFile=-/etc/default/freeswitch -ExecStart=/usr/bin/freeswitch -u freeswitch -g freeswitch -ncwait ${DAEMON_OPTS} +ExecStart=/usr/bin/freeswitch -u freeswitch -g freeswitch -ncwait $DAEMON_OPTS TimeoutSec=45s Restart=always ; exec diff --git a/debian/freeswitch-systemd.freeswitch.default b/debian/freeswitch-sysvinit.freeswitch.default similarity index 100% rename from debian/freeswitch-systemd.freeswitch.default rename to debian/freeswitch-sysvinit.freeswitch.default diff --git a/debian/freeswitch.postinst b/debian/freeswitch.postinst index 01d8b93c0d..c08fd07e31 100644 --- a/debian/freeswitch.postinst +++ b/debian/freeswitch.postinst @@ -37,9 +37,6 @@ case "$1" in mkdir -p /etc/freeswitch/tls/ chown freeswitch:freeswitch /etc/freeswitch/tls fi - if [ -x /bin/systemctl -a x`systemctl is-enabled freeswitch` != "xenabled" ]; then - systemctl enable freeswitch - fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; diff --git a/debian/rules b/debian/rules index 337a913eb3..7cfe4c1c2e 100755 --- a/debian/rules +++ b/debian/rules @@ -101,9 +101,15 @@ override_dh_auto_install: rm -f debian/tmp/usr/share/freeswitch/grammar/model/communicator/COPYING override_dh_installinit: - dh_installinit -pfreeswitch-sysvinit --name=freeswitch - dh_installinit -pfreeswitch-systemd --name=freeswitch - dh_installinit -pfreeswitch-all --name=freeswitch + if [ `cat debian/freeswitch-init.provided_by` = freeswitch-systemd ]; then \ + dh_systemd_enable -pfreeswitch-systemd --name=freeswitch; \ + dh_systemd_start -pfreeswitch-systemd --name=freeswitch; \ + dh_systemd_enable -pfreeswitch-all --name=freeswitch; \ + dh_systemd_start -pfreeswitch-all --name=freeswitch; \ + else \ + dh_installinit -pfreeswitch-sysvinit --name=freeswitch; \ + dh_installinit -pfreeswitch-all --name=freeswitch; \ + fi override_dh_makeshlibs: dh_makeshlibs