diff --git a/debian/bootstrap.sh b/debian/bootstrap.sh index edfe7f1077..3fc621aa4f 100755 --- a/debian/bootstrap.sh +++ b/debian/bootstrap.sh @@ -46,6 +46,33 @@ avoid_mods_squeeze=( formats/mod_vlc languages/mod_managed ) +manual_pkgs=( +freeswitch-all +freeswitch +libfreeswitch1 +freeswitch-meta-bare +freeswitch-meta-default +freeswitch-meta-vanilla +freeswitch-meta-sorbet +freeswitch-meta-all +freeswitch-meta-codecs +freeswitch-meta-conf +freeswitch-meta-lang +freeswitch-meta-mod-say +freeswitch-all-dbg +freeswitch-dbg +libfreeswitch1-dbg +libfreeswitch-dev +freeswitch-doc +freeswitch-init +freeswitch-sysvinit +freeswitch-systemd +freeswitch-lang +freeswitch-music +freeswitch-sounds +freeswitch-sounds-en +freeswitch-sounds-en-us +) err () { echo "$0 error: $1" >&2 @@ -61,6 +88,31 @@ xread () { return $ret } +intersperse () { + local sep="$1" + awk " + BEGIN { + first=1; + sep=\"${sep}\"; + }"' + /.*/ { + if (first == 0) { + printf "%s%s", sep, $0; + } else { + printf "%s", $0; + } + first=0; + } + END { printf "\n"; }' +} + +postfix () { + local px="$1" + awk " + BEGIN { px=\"${px}\"; }"' + /.*/ { printf "%s%s\n", $0, px; }' +} + avoid_mod_filter () { local x="avoid_mods_$codename[@]" local -a mods=("${avoid_mods[@]}" "${!x}") @@ -168,6 +220,60 @@ map_langs () { done } +map_pkgs () { + local fsx="$1" + for x in "${manual_pkgs[@]}"; do + $fsx $x + done + map_pkgs_confs () { $fsx "freeswitch-conf-${conf//_/-}"; } + map_confs map_pkgs_confs + map_pkgs_langs () { $fsx "freeswitch-lang-${lang//_/-}"; } + map_langs map_pkgs_langs + map_pkgs_mods () { + $fsx "freeswitch-mod-${module//_/-}" + $fsx "freeswitch-mod-${module//_/-}-dbg"; } + map_modules map_pkgs_mods +} + +list_pkgs () { + list_pkgs_thunk () { printf '%s\n' "$1"; } + map_pkgs list_pkgs_thunk +} + +list_freeswitch_all_pkgs () { + list_pkgs \ + | grep -v '^freeswitch-all$' \ + | grep -v -- '-dbg$' +} + +list_freeswitch_all_provides () { + list_freeswitch_all_pkgs \ + | intersperse ',\n ' +} + +list_freeswitch_all_replaces () { + list_freeswitch_all_pkgs \ + | postfix ' (<= ${binary:Version})' \ + | intersperse ',\n ' +} + +list_freeswitch_all_dbg_pkgs () { + list_pkgs \ + | grep -v '^freeswitch-all-dbg$' \ + | grep -- '-dbg$' +} + +list_freeswitch_all_dbg_provides () { + list_freeswitch_all_dbg_pkgs \ + | intersperse ',\n ' +} + +list_freeswitch_all_dbg_replaces () { + list_freeswitch_all_dbg_pkgs \ + | postfix ' (<= ${binary:Version})' \ + | intersperse ',\n ' +} + print_source_control () { cat <= 1.0.8), freeswitch-sounds-en-us-callie (>= 1.0.25) | freeswitch-sounds, @@ -647,6 +745,9 @@ Package: freeswitch-all-dbg Section: debug Priority: extra Architecture: any +Provides: $(list_freeswitch_all_dbg_provides) +Replaces: $(list_freeswitch_all_dbg_replaces) +Breaks: $(list_freeswitch_all_dbg_replaces) Depends: \${misc:Depends}, freeswitch (= \${binary:Version}) Description: debugging symbols for FreeSWITCH $(debian_wrap "${fs_description}")