| 1 | #! /bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | # install_prereq: a script to install distribution-specific |
| 4 | # prerequisites |
| 5 | |
| 6 | set -e |
| 7 | |
| 8 | usagescip-shell shell shell-project 0.0.0 usage().() { |
| 9 | echoscip-shell system . . echo. "$0: a script to install distribution-specific prerequisites" |
| 10 | echoscip-shell system . . echo. |
| 11 | echoscip-shell system . . echo. "$0 : Shows this message" |
| 12 | echoscip-shell system . . echo. "$0 test : Prints commands it is about to run" |
| 13 | echoscip-shell system . . echo. "$0 install : Really install" |
| 14 | echoscip-shell system . . echo. "$0 install-unpackaged : Really install unpackaged requirements" |
| 15 | echoscip-shell system . . echo. "$0 minimal : Install only the packages necessary for build tool generation and a basic build" |
| 16 | } |
| 17 | |
| 18 | # Basic build system: |
| 19 | PACKAGES_DEBIAN_BUILD="build-essential pkg-config autoconf-archive" |
| 20 | PACKAGES_DEBIAN="$PACKAGES_DEBIAN_BUILD" |
| 21 | # Asterisk: basic requirements: |
| 22 | PACKAGES_DEBIAN="$PACKAGES_DEBIAN libedit-dev libjansson-dev libsqlite3-dev uuid-dev libxml2-dev" |
| 23 | # Asterisk: for addons: |
| 24 | PACKAGES_DEBIAN="$PACKAGES_DEBIAN libspeex-dev libspeexdsp-dev libogg-dev libvorbis-dev libasound2-dev portaudio19-dev libcurl4-openssl-dev xmlstarlet bison flex" |
| 25 | PACKAGES_DEBIAN="$PACKAGES_DEBIAN libpq-dev unixodbc-dev libneon27-dev libgmime-2.6-dev libgmime-3.0-dev liblua5.2-dev liburiparser-dev libxslt1-dev libssl-dev" |
| 26 | PACKAGES_DEBIAN="$PACKAGES_DEBIAN libmysqlclient-dev libbluetooth-dev libradcli-dev freetds-dev libjack-jackd2-dev bash libcap-dev" |
| 27 | PACKAGES_DEBIAN="$PACKAGES_DEBIAN libsnmp-dev libiksemel-dev libcorosync-common-dev libcpg-dev libcfg-dev libnewt-dev libpopt-dev libical-dev libspandsp-dev" |
| 28 | PACKAGES_DEBIAN="$PACKAGES_DEBIAN libresample1-dev libc-client2007e-dev binutils-dev libsrtp0-dev libsrtp2-dev libgsm1-dev doxygen graphviz zlib1g-dev libldap2-dev" |
| 29 | PACKAGES_DEBIAN="$PACKAGES_DEBIAN libcodec2-dev libfftw3-dev libsndfile1-dev libunbound-dev" |
| 30 | # Asterisk: for the unpackaged below: |
| 31 | PACKAGES_DEBIAN="$PACKAGES_DEBIAN wget subversion" |
| 32 | # Asterisk: for ./configure --with-pjproject-bundled: |
| 33 | PACKAGES_DEBIAN="$PACKAGES_DEBIAN bzip2 patch" |
| 34 | |
| 35 | # Basic build system: |
| 36 | PACKAGES_RH_BUILD="make gcc gcc-c++ pkgconfig autoconf-archive" |
| 37 | PACKAGES_RH="$PACKAGES_RH_BUILD" |
| 38 | # Asterisk: basic requirements: |
| 39 | PACKAGES_RH="$PACKAGES_RH libedit-devel jansson-devel libuuid-devel sqlite-devel libxml2-devel" |
| 40 | # Asterisk: for addons: |
| 41 | PACKAGES_RH="$PACKAGES_RH speex-devel speexdsp-devel libogg-devel libvorbis-devel portaudio-devel libcurl-devel xmlstarlet bison flex" |
| 42 | PACKAGES_RH="$PACKAGES_RH postgresql-devel unixODBC-devel neon-devel gmime-devel lua-devel uriparser-devel libxslt-devel openssl-devel" |
| 43 | PACKAGES_RH="$PACKAGES_RH mysql-devel bluez-libs-devel radcli-devel freetds-devel jack-audio-connection-kit-devel bash libcap-devel" |
| 44 | PACKAGES_RH="$PACKAGES_RH net-snmp-devel iksemel-devel corosynclib-devel newt-devel popt-devel libical-devel spandsp-devel" |
| 45 | PACKAGES_RH="$PACKAGES_RH libresample-devel uw-imap-devel binutils-devel libsrtp-devel gsm-devel doxygen graphviz zlib-devel openldap-devel hoard" |
| 46 | PACKAGES_RH="$PACKAGES_RH codec2-devel fftw-devel libsndfile-devel unbound-devel" |
| 47 | # Asterisk: for the unpackaged below: |
| 48 | PACKAGES_RH="$PACKAGES_RH wget subversion" |
| 49 | # Asterisk: for ./configure --with-pjproject-bundled: |
| 50 | PACKAGES_RH="$PACKAGES_RH bzip2 patch" |
| 51 | |
| 52 | # Basic build system: |
| 53 | PACKAGES_SUSE_BUILD="make gcc gcc-c++ pkg-config autoconf-archive" |
| 54 | PACKAGES_SUSE="$PACKAGES_SUSE_BUILD" |
| 55 | # Asterisk: basic requirements: |
| 56 | PACKAGES_SUSE="$PACKAGES_SUSE libedit-devel libjansson-devel libuuid-devel sqlite3-devel libxml2-devel" |
| 57 | # Asterisk: for addons: |
| 58 | PACKAGES_SUSE="$PACKAGES_SUSE speex-devel speexdsp-devel libogg-devel libvorbis-devel portaudio-devel libcurl-devel xmlstarlet bison flex" |
| 59 | PACKAGES_SUSE="$PACKAGES_SUSE postgresql-devel unixODBC-devel libneon-devel gmime-devel lua-devel liburiparser-devel libxslt-devel libopenssl-devel" |
| 60 | PACKAGES_SUSE="$PACKAGES_SUSE libmysqlclient-devel bluez-devel freeradius-client-devel freetds-devel bash libcap-devel" |
| 61 | PACKAGES_SUSE="$PACKAGES_SUSE net-snmp-devel iksemel-devel libcorosync-devel newt-devel popt-devel libical-devel spandsp-devel" |
| 62 | PACKAGES_SUSE="$PACKAGES_SUSE imap-devel libsrtp2-devel libgsm-devel doxygen graphviz zlib-devel openldap2-devel" |
| 63 | PACKAGES_SUSE="$PACKAGES_SUSE codec2-devel fftw3-devel libsndfile-devel unbound-devel" |
| 64 | # Asterisk: for the unpackaged below: |
| 65 | PACKAGES_SUSE="$PACKAGES_SUSE wget subversion" |
| 66 | # Asterisk: for ./configure --with-pjproject-bundled: |
| 67 | PACKAGES_SUSE="$PACKAGES_SUSE bzip2 patch" |
| 68 | |
| 69 | # Basic build system: |
| 70 | PACKAGES_ARCH_BUILD="make gcc pkg-config autoconf-archive" |
| 71 | PACKAGES_ARCH="$PACKAGES_ARCH_BUILD" |
| 72 | # Asterisk: basic requirements: |
| 73 | PACKAGES_ARCH="$PACKAGES_ARCH libedit jansson libutil-linux libxml2 sqlite" |
| 74 | # Asterisk: for addons: |
| 75 | PACKAGES_ARCH="$PACKAGES_ARCH speex speexdsp libogg libvorbis portaudio curl xmlstarlet bison flex" |
| 76 | PACKAGES_ARCH="$PACKAGES_ARCH postgresql-libs unixodbc neon gmime lua uriparser libxslt openssl" |
| 77 | PACKAGES_ARCH="$PACKAGES_ARCH libmariadbclient bluez-libs radcli freetds bash libcap" |
| 78 | PACKAGES_ARCH="$PACKAGES_ARCH net-snmp libnewt popt libical spandsp" |
| 79 | PACKAGES_ARCH="$PACKAGES_ARCH c-client binutils libsrtp gsm doxygen graphviz zlib libldap" |
| 80 | PACKAGES_ARCH="$PACKAGES_ARCH fftw libsndfile unbound" |
| 81 | # Asterisk: for the unpackaged below: |
| 82 | PACKAGES_ARCH="$PACKAGES_ARCH wget subversion" |
| 83 | # Asterisk: for ./configure --with-pjproject-bundled: |
| 84 | PACKAGES_ARCH="$PACKAGES_ARCH bzip2 patch" |
| 85 | |
| 86 | # Basic build system: |
| 87 | PACKAGES_GENTOO_BUILD="sys-devel/make sys-devel/gcc dev-util/pkgconfig" |
| 88 | PACKAGES_GENTOO="$PACKAGES_GENTOO_BUILD" |
| 89 | # Asterisk: basic requirements: |
| 90 | PACKAGES_GENTOO="$PACKAGES_GENTOO dev-libs/libedit dev-libs/jansson sys-libs/e2fsprogs-libs dev-libs/libxml2 dev-db/sqlite" |
| 91 | # Asterisk: for addons: |
| 92 | PACKAGES_GENTOO="$PACKAGES_GENTOO media-libs/speex media-libs/speexdsp media-libs/libogg media-libs/libvorbis media-libs/portaudio net-misc/curl app-text/xmlstarlet sys-devel/bison sys-devel/flex" |
| 93 | PACKAGES_GENTOO="$PACKAGES_GENTOO dev-db/postgresql dev-db/unixODBC net-libs/neon dev-libs/gmime dev-lang/lua dev-libs/uriparser dev-libs/libxslt dev-libs/openssl" |
| 94 | PACKAGES_GENTOO="$PACKAGES_GENTOO virtual/libmysqlclient net-wireless/bluez net-dialup/radiusclient-ng dev-db/freetds app-shells/bash sys-libs/libcap" |
| 95 | PACKAGES_GENTOO="$PACKAGES_GENTOO net-analyzer/net-snmp dev-libs/iksemel sys-cluster/corosync dev-libs/newt dev-libs/popt dev-libs/libical media-libs/spandsp" |
| 96 | PACKAGES_GENTOO="$PACKAGES_GENTOO net-libs/c-client sys-devel/binutils net-libs/libsrtp media-sound/gsm media-libs/libilbc app-doc/doxygen sys-libs/zlib net-nds/openldap" |
| 97 | PACKAGES_GENTOO="$PACKAGES_GENTOO sci-libs/fftw media-libs/libsndfile net-dns/unbound" |
| 98 | # Asterisk: for the unpackaged below: |
| 99 | PACKAGES_GENTOO="$PACKAGES_GENTOO net-misc/wget dev-vcs/subversion" |
| 100 | # Asterisk: for ./configure --with-pjproject-bundled: |
| 101 | PACKAGES_GENTOO="$PACKAGES_GENTOO app-arch/bzip2 sys-devel/patch" |
| 102 | |
| 103 | # Basic build system: |
| 104 | PACKAGES_NBSD_BUILD="gmake pkg-config" |
| 105 | PACKAGES_NBSD="$PACKAGES_NBSD_BUILD" |
| 106 | # Asterisk: basic requirements: |
| 107 | PACKAGES_NBSD="$PACKAGES_NBSD editline jansson sqlite3 libuuid libxml2" |
| 108 | # Asterisk: for addons: |
| 109 | PACKAGES_NBSD="$PACKAGES_NBSD speex speexdsp libogg libvorbis portaudio-devel curl bison flex" |
| 110 | PACKAGES_NBSD="$PACKAGES_NBSD postgresql10-client unixodbc neon gmime lua52 uriparser libxslt openssl" |
| 111 | PACKAGES_NBSD="$PACKAGES_NBSD mysql-client radiusclient-ng freetds bash" |
| 112 | PACKAGES_NBSD="$PACKAGES_NBSD net-snmp iksemel popt libical spandsp" |
| 113 | PACKAGES_NBSD="$PACKAGES_NBSD imap-uw srtp gsm doxygen graphviz libzip openldap-client" |
| 114 | PACKAGES_NBSD="$PACKAGES_NBSD codec2 fftw libsndfile unbound" |
| 115 | # Asterisk: for the unpackaged below: |
| 116 | PACKAGES_NBSD="$PACKAGES_NBSD wget subversion-base" |
| 117 | # Asterisk: for ./configure --with-pjproject-bundled: |
| 118 | PACKAGES_NBSD="$PACKAGES_NBSD bzip2 patch" |
| 119 | |
| 120 | # Basic build system: |
| 121 | PACKAGES_OBSD_BUILD="gmake" |
| 122 | PACKAGES_OBSD="$PACKAGES_OBSD_BUILD" |
| 123 | # Asterisk: basic requirements: |
| 124 | PACKAGES_OBSD="$PACKAGES_OBSD libxml sqlite3 e2fsprogs jansson" |
| 125 | # Asterisk: for addons: |
| 126 | PACKAGES_OBSD="$PACKAGES_OBSD speex speexdsp libogg libvorbis portaudio-svn curl xmlstarlet bison" |
| 127 | PACKAGES_OBSD="$PACKAGES_OBSD postgresql-client iodbc neon gmime lua%5.2 uriparser libxslt" |
| 128 | PACKAGES_OBSD="$PACKAGES_OBSD mariadb-client radcli freetds" |
| 129 | PACKAGES_OBSD="$PACKAGES_OBSD net-snmp iksemel popt libical spandsp" |
| 130 | PACKAGES_OBSD="$PACKAGES_OBSD c-client libsrtp gsm doxygen graphviz" |
| 131 | PACKAGES_OBSD="$PACKAGES_OBSD fftw3 libsndfile" |
| 132 | # Asterisk: for the unpackaged below: |
| 133 | PACKAGES_OBSD="$PACKAGES_OBSD wget subversion" |
| 134 | # Asterisk: for ./configure --with-pjproject-bundled: |
| 135 | PACKAGES_OBSD="$PACKAGES_OBSD bzip2" |
| 136 | |
| 137 | # Basic build system: |
| 138 | PACKAGES_FBSD_BUILD="gmake pkgconf autoconf-archive" |
| 139 | PACKAGES_FBSD="$PACKAGES_FBSD_BUILD" |
| 140 | # Asterisk: basic requirements: |
| 141 | PACKAGES_FBSD="$PACKAGES_FBSD libedit jansson e2fsprogs-libuuid sqlite3 libxml2" |
| 142 | # Asterisk: for addons: |
| 143 | PACKAGES_FBSD="$PACKAGES_FBSD speex speexdsp libogg libvorbis portaudio curl xmlstarlet bison flex" |
| 144 | PACKAGES_FBSD="$PACKAGES_FBSD postgresql10-client unixODBC neon gmime26 lua52 uriparser libxslt openssl" |
| 145 | PACKAGES_FBSD="$PACKAGES_FBSD mysql57-client radcli freetds" |
| 146 | PACKAGES_FBSD="$PACKAGES_FBSD net-snmp iksemel corosync newt popt libical spandsp" |
| 147 | PACKAGES_FBSD="$PACKAGES_FBSD cclient libbfd libsrtp gsm libilbc doxygen graphviz libzip openldap-client libhoard" |
| 148 | PACKAGES_FBSD="$PACKAGES_FBSD codec2 fftw3 libsndfile unbound" |
| 149 | # Asterisk: for the unpackaged below: |
| 150 | PACKAGES_FBSD="$PACKAGES_FBSD wget subversion" |
| 151 | # Asterisk: for ./configure --with-pjproject-bundled: |
| 152 | PACKAGES_FBSD="$PACKAGES_FBSD bzip2 patch" |
| 153 | |
| 154 | # Basic build system: |
| 155 | PACKAGES_DBSD_BUILD="gmake pkgconf" |
| 156 | PACKAGES_DBSD="$PACKAGES_DBSD_BUILD" |
| 157 | # Asterisk: basic requirements: |
| 158 | PACKAGES_DBSD="$PACKAGES_DBSD libedit jansson e2fsprogs-libuuid sqlite3 libxml2" |
| 159 | # Asterisk: for addons: |
| 160 | PACKAGES_DBSD="$PACKAGES_DBSD speex speexdsp libogg libvorbis portaudio curl xmlstarlet bison flex" |
| 161 | PACKAGES_DBSD="$PACKAGES_DBSD postgresql10-client unixODBC neon gmime26 lua52 uriparser libxslt libressl" |
| 162 | PACKAGES_DBSD="$PACKAGES_DBSD mariadb101-client radcli freetds" |
| 163 | PACKAGES_DBSD="$PACKAGES_DBSD net-snmp iksemel corosync newt popt libical spandsp" |
| 164 | PACKAGES_DBSD="$PACKAGES_DBSD cclient binutils libsrtp gsm libilbc doxygen graphviz libzip openldap-client libhoard" |
| 165 | PACKAGES_DBSD="$PACKAGES_DBSD codec2 fftw3 libsndfile unbound" |
| 166 | # Asterisk: for the unpackaged below: |
| 167 | PACKAGES_DBSD="$PACKAGES_DBSD wget subversion" |
| 168 | # Asterisk: for ./configure --with-pjproject-bundled: |
| 169 | PACKAGES_DBSD="$PACKAGES_DBSD bzip2 patch" |
| 170 | |
| 171 | KVERS=`unamescip-shell system . . uname. -r` |
| 172 | |
| 173 | case "$1" in |
| 174 | test) |
| 175 | testcmd=echo |
| 176 | ;; |
| 177 | install) |
| 178 | testcmd='' |
| 179 | ;; |
| 180 | install-unpackaged) |
| 181 | unpackaged="yes" |
| 182 | ;; |
| 183 | minimal) |
| 184 | # Overwrite the package lists and let the rest of the package handling |
| 185 | # plumbing do its magic |
| 186 | PACKAGES_ARCH="$PACKAGES_ARCH_BUILD" |
| 187 | PACKAGES_DBSD="$PACKAGES_DBSD_BUILD" |
| 188 | PACKAGES_DEBIAN="$PACKAGES_DEBIAN_BUILD" |
| 189 | PACKAGES_FBSD="$PACKAGES_FBSD_BUILD" |
| 190 | PACKAGES_GENTOO="$PACKAGES_GENTOO_BUILD" |
| 191 | PACKAGES_NBSD="$PACKAGES_NBSD_BUILD" |
| 192 | PACKAGES_OBSD="$PACKAGES_OBSD_BUILD" |
| 193 | PACKAGES_RH="$PACKAGES_RH_BUILD" |
| 194 | PACKAGES_SUSE="$PACKAGES_SUSE_BUILD" |
| 195 | ;; |
| 196 | '') |
| 197 | usagescip-shell shell shell-project 0.0.0 usage(). |
| 198 | exit 0 |
| 199 | ;; |
| 200 | *) |
| 201 | usagescip-shell shell shell-project 0.0.0 usage(). |
| 202 | exit 1 |
| 203 | ;; |
| 204 | esac |
| 205 | |
| 206 | in_test_modescip-shell shell shell-project 0.0.0 in_test_mode().() { |
| 207 | testscip-shell system . . test. "$testcmd" != '' |
| 208 | } |
| 209 | |
| 210 | check_installed_debsscip-shell shell shell-project 0.0.0 check_installed_debs().() { |
| 211 | for pack in "$@" ; do |
| 212 | tocheck="${tocheck} ^${pack}$ ~P^${pack}$" |
| 213 | done |
| 214 | aptitude -F '%c %p' search $tocheck 2>/dev/nullscip-shell filesystem . . `/dev/null`. | awkscip-shell system . . awk. '/^p/{print $2}scip-shell filesystem . . `/^p/{print $2}`.' | grepscip-shell system . . grep. -vF : |
| 215 | } |
| 216 | |
| 217 | # parsing the output of yum is close to impossible. |
| 218 | # We'll use rpm and hope for the best: |
| 219 | check_installed_rpmsscip-shell shell shell-project 0.0.0 check_installed_rpms().() { |
| 220 | for pack in "$@" |
| 221 | do |
| 222 | if ! rpm -q $pack >/dev/nullscip-shell filesystem . . `/dev/null`. 2>/dev/nullscip-shell filesystem . . `/dev/null`. |
| 223 | then echoscip-shell system . . echo. $pack |
| 224 | fi |
| 225 | done |
| 226 | } |
| 227 | |
| 228 | check_installed_equeryscip-shell shell shell-project 0.0.0 check_installed_equery().() { |
| 229 | for pack in "$@" |
| 230 | do |
| 231 | # equery --quiet list $pack |
| 232 | # is slower and |
| 233 | # would require the optional app-portage/gentoolkit |
| 234 | # /var/lib/portage/world would be the non-dep list |
| 235 | pack_with_version=${pack/:/-} # replace a possible version with '-' |
| 236 | if ! lsscip-shell system . . ls. -d /var/db/pkg/${pack_with_version}* >/dev/nullscip-shell filesystem . . `/dev/null`. 2>/dev/nullscip-shell filesystem . . `/dev/null`. |
| 237 | then echoscip-shell system . . echo. $pack |
| 238 | fi |
| 239 | done |
| 240 | } |
| 241 | |
| 242 | check_installed_pacmanscip-shell shell shell-project 0.0.0 check_installed_pacman().() { |
| 243 | for pack in "$@" |
| 244 | do |
| 245 | if ! pacman -Q --explicit $pack >/dev/nullscip-shell filesystem . . `/dev/null`. 2>/dev/nullscip-shell filesystem . . `/dev/null`. |
| 246 | then echoscip-shell system . . echo. $pack |
| 247 | fi |
| 248 | done |
| 249 | } |
| 250 | |
| 251 | check_installed_pkgsscip-shell shell shell-project 0.0.0 check_installed_pkgs().() { |
| 252 | for pack in "$@" |
| 253 | do |
| 254 | if [scip-shell system . . `[`. `pkg_info -a | grepscip-shell system . . grep. $pack | wcscip-shell system . . wc. -l` = 0 ]; then |
| 255 | echoscip-shell system . . echo. $pack |
| 256 | fi |
| 257 | done |
| 258 | } |
| 259 | |
| 260 | check_installed_fpkgsscip-shell shell shell-project 0.0.0 check_installed_fpkgs().() { |
| 261 | for pack in "$@" |
| 262 | do |
| 263 | if [scip-shell system . . `[`. `pkg info -a | grepscip-shell system . . grep. $pack | wcscip-shell system . . wc. -l` = 0 ]; then |
| 264 | echoscip-shell system . . echo. $pack |
| 265 | fi |
| 266 | done |
| 267 | } |
| 268 | |
| 269 | check_installed_zypperscip-shell shell shell-project 0.0.0 check_installed_zypper().() { |
| 270 | for pack in "$@" |
| 271 | do |
| 272 | if ! zypper se -ixnC $pack >/dev/nullscip-shell filesystem . . `/dev/null`. 2>/dev/nullscip-shell filesystem . . `/dev/null`. |
| 273 | then echoscip-shell system . . echo. $pack |
| 274 | fi |
| 275 | done |
| 276 | } |
| 277 | |
| 278 | handle_debianscip-shell shell shell-project 0.0.0 handle_debian().() { |
| 279 | if ! [scip-shell system . . `[`. -x "$(command -v aptitude)" ]; then |
| 280 | apt-getscip-shell system . . apt-get. install -y aptitude |
| 281 | fi |
| 282 | extra_packs=`check_installed_debsscip-shell shell shell-project 0.0.0 check_installed_debs(). $PACKAGES_DEBIAN` |
| 283 | $testcmd aptitude update |
| 284 | if [scip-shell system . . `[`. x"$extra_packs" != "x" ] ; then |
| 285 | $testcmd aptitude install -y $extra_packs |
| 286 | fi |
| 287 | } |
| 288 | |
| 289 | handle_linuxmintscip-shell shell shell-project 0.0.0 handle_linuxmint().() { |
| 290 | # Store temporary variable to contain list of missing packages |
| 291 | missing_packages="" |
| 292 | |
| 293 | # Check installed packages for Mint |
| 294 | for package in $PACKAGES_DEBIAN; do |
| 295 | if [scip-shell system . . `[`. "$package" = "libgmime-2.6-dev" ] || [scip-shell system . . `[`. "$package" = "libsrtp0-dev" ]; then |
| 296 | continue |
| 297 | fi |
| 298 | |
| 299 | missing_package_check=$(aptscip-shell system . . apt. list --installed 2>/dev/nullscip-shell filesystem . . `/dev/null`. | grepscip-shell system . . grep. -c $package) |
| 300 | |
| 301 | if [scip-shell system . . `[`. "$missing_package_check" -eq 0 ]; then |
| 302 | echoscip-shell system . . echo. "This package is missing: "$package |
| 303 | missing_packages="${missing_packages} $package" |
| 304 | else |
| 305 | echoscip-shell system . . echo. "Package "$package" is present." |
| 306 | fi |
| 307 | done |
| 308 | |
| 309 | # Update the packages on our local system |
| 310 | echoscip-shell system . . echo. "===========================" |
| 311 | echoscip-shell system . . echo. "Updating your system's packages" |
| 312 | echoscip-shell system . . echo. "===========================" |
| 313 | $testcmd apt update |
| 314 | |
| 315 | # Inform user of packages to be installed |
| 316 | echoscip-shell system . . echo. "===========================" |
| 317 | echoscip-shell system . . echo. "The following packages will be installed on your system:" |
| 318 | echoscip-shell system . . echo. $missing_packages |
| 319 | echoscip-shell system . . echo. "===========================" |
| 320 | |
| 321 | if [scip-shell system . . `[`. "$missing_packages" != "" ] ; then |
| 322 | $testcmd apt -m install -y $missing_packages |
| 323 | fi |
| 324 | } |
| 325 | |
| 326 | handle_rhscip-shell shell shell-project 0.0.0 handle_rh().() { |
| 327 | extra_packs=`check_installed_rpmsscip-shell shell shell-project 0.0.0 check_installed_rpms(). $PACKAGES_RH` |
| 328 | if [scip-shell system . . `[`. x"$extra_packs" != "x" ] ; then |
| 329 | $testcmd yum install --skip-broken --assumeyes $extra_packs |
| 330 | fi |
| 331 | } |
| 332 | |
| 333 | handle_gentooscip-shell shell shell-project 0.0.0 handle_gentoo().() { |
| 334 | extra_packs=`check_installed_equeryscip-shell shell shell-project 0.0.0 check_installed_equery(). $PACKAGES_GENTOO` |
| 335 | if [scip-shell system . . `[`. x"$extra_packs" != "x" ] ; then |
| 336 | $testcmd emerge $extra_packs |
| 337 | fi |
| 338 | } |
| 339 | |
| 340 | handle_archscip-shell shell shell-project 0.0.0 handle_arch().() { |
| 341 | extra_packs=`check_installed_pacmanscip-shell shell shell-project 0.0.0 check_installed_pacman(). $PACKAGES_ARCH` |
| 342 | if [scip-shell system . . `[`. x"$extra_packs" != "x" ] ; then |
| 343 | $testcmd pacman -S --asexplicit --noconfirm $extra_packs |
| 344 | fi |
| 345 | } |
| 346 | |
| 347 | handle_nbsdscip-shell shell shell-project 0.0.0 handle_nbsd().() { |
| 348 | extra_packs=`check_installed_pkgsscip-shell shell shell-project 0.0.0 check_installed_pkgs(). $PACKAGES_NBSD` |
| 349 | if [scip-shell system . . `[`. x"$extra_packs" != "x" ] ; then |
| 350 | if [scip-shell system . . `[`. -z "$PKG_PATH" ] ; then |
| 351 | # see NetBSD Problem Report #48177 |
| 352 | export PKG_PATH="http://cdn.NetBSD.org/pub/pkgsrc/packages/$(unamescip-shell system . . uname. -s)/$(unamescip-shell system . . uname. -p)/$(unamescip-shell system . . uname. -r)/All" |
| 353 | fi |
| 354 | $testcmd pkg_add $extra_packs |
| 355 | fi |
| 356 | } |
| 357 | |
| 358 | handle_obsdscip-shell shell shell-project 0.0.0 handle_obsd().() { |
| 359 | extra_packs=`check_installed_pkgsscip-shell shell shell-project 0.0.0 check_installed_pkgs(). $PACKAGES_OBSD` |
| 360 | if [scip-shell system . . `[`. x"$extra_packs" != "x" ] ; then |
| 361 | $testcmd pkg_add $extra_packs |
| 362 | fi |
| 363 | } |
| 364 | |
| 365 | handle_fbsdscip-shell shell shell-project 0.0.0 handle_fbsd().() { |
| 366 | extra_packs=`check_installed_fpkgsscip-shell shell shell-project 0.0.0 check_installed_fpkgs(). $PACKAGES_FBSD` |
| 367 | if [scip-shell system . . `[`. x"$extra_packs" != "x" ] ; then |
| 368 | $testcmd pkg install -y $extra_packs |
| 369 | fi |
| 370 | } |
| 371 | |
| 372 | handle_dbsdscip-shell shell shell-project 0.0.0 handle_dbsd().() { |
| 373 | extra_packs=`check_installed_fpkgsscip-shell shell shell-project 0.0.0 check_installed_fpkgs(). $PACKAGES_DBSD` |
| 374 | if [scip-shell system . . `[`. x"$extra_packs" != "x" ] ; then |
| 375 | $testcmd pkg install -y $extra_packs |
| 376 | fi |
| 377 | } |
| 378 | |
| 379 | handle_SUSEscip-shell shell shell-project 0.0.0 handle_SUSE().() { |
| 380 | extra_packs=`check_installed_zypperscip-shell shell shell-project 0.0.0 check_installed_zypper(). $PACKAGES_SUSE` |
| 381 | if [scip-shell system . . `[`. x"$extra_packs" != "x" ] ; then |
| 382 | $testcmd zypper install --no-confirm $extra_packs |
| 383 | fi |
| 384 | } |
| 385 | |
| 386 | install_unpackagedscip-shell shell shell-project 0.0.0 install_unpackaged().() { |
| 387 | # Only install libresample if it wasn't installed via package |
| 388 | if ! testscip-shell system . . test. -f /usr/include/libresample.hscip-shell filesystem . . `/usr/include/libresample.h`.; then |
| 389 | echoscip-shell system . . echo. "*** Installing libresample ***" |
| 390 | svn co https://svn.digium.com/svn/thirdparty/libresample/trunk libresample-trunk |
| 391 | cd libresample-trunk |
| 392 | ./configure |
| 393 | makescip-shell system . . make. all install |
| 394 | cd .. |
| 395 | fi |
| 396 | |
| 397 | # Only install libsrtp2 if it wasn't installed via package |
| 398 | if ! testscip-shell system . . test. -f /usr/include/srtp/srtp.hscip-shell filesystem . . `/usr/include/srtp/srtp.h`.; then |
| 399 | if ! testscip-shell system . . test. -f /usr/include/srtp2/srtp.hscip-shell filesystem . . `/usr/include/srtp2/srtp.h`.; then |
| 400 | echoscip-shell system . . echo. "*** Installing libsrtp2 ***" |
| 401 | wget -O - http://github.com/cisco/libsrtp/archive/v2.tar.gz | zcatscip-shell system . . zcat. | tarscip-shell system . . tar. -xf - |
| 402 | cd libsrtp-2 |
| 403 | ./configure --enable-openssl |
| 404 | makescip-shell system . . make. shared_library install |
| 405 | cd .. |
| 406 | if testscip-shell system . . test. -d /etc/ld.so.conf.dscip-shell filesystem . . `/etc/ld.so.conf.d`.; then |
| 407 | echoscip-shell system . . echo. "/usr/local/libscip-shell filesystem . . `/usr/local/lib`." > /etc/ld.so.conf.d/usr_local.confscip-shell filesystem . . `/etc/ld.so.conf.d/usr_local.conf`. |
| 408 | else # for example: Slackware 14.2 |
| 409 | echoscip-shell system . . echo. "/usr/local/libscip-shell filesystem . . `/usr/local/lib`." > /etc/ld.so.confscip-shell filesystem . . `/etc/ld.so.conf`. |
| 410 | fi |
| 411 | /sbin/ldconfigscip-shell filesystem . . `/sbin/ldconfig`. |
| 412 | fi |
| 413 | fi |
| 414 | |
| 415 | if ! testscip-shell system . . test. -f /usr/include/pjlib.hscip-shell filesystem . . `/usr/include/pjlib.h`.; then |
| 416 | echoscip-shell system . . echo. "PJProject not installed, yet. Therefore, please, run" |
| 417 | echoscip-shell system . . echo. "./configure --with-pjproject-bundled" |
| 418 | fi |
| 419 | } |
| 420 | |
| 421 | if in_test_modescip-shell shell shell-project 0.0.0 in_test_mode().; then |
| 422 | echoscip-shell system . . echo. "#############################################" |
| 423 | echoscip-shell system . . echo. "## $1: test mode." |
| 424 | echoscip-shell system . . echo. "## Use the commands here to install your system." |
| 425 | echoscip-shell system . . echo. "#############################################" |
| 426 | elif testscip-shell system . . test. "${unpackaged}" = "yes" ; then |
| 427 | install_unpackagedscip-shell shell shell-project 0.0.0 install_unpackaged(). |
| 428 | exit 0 |
| 429 | fi |
| 430 | |
| 431 | OS=`unamescip-shell system . . uname. -s` |
| 432 | unsupported_distro='' |
| 433 | |
| 434 | # A number of distributions we don't (yet?) support. |
| 435 | if [scip-shell system . . `[`. "$OS" != 'Linux' -a "$OS" != 'NetBSD' -a "$OS" != 'OpenBSD' -a "$OS" != 'FreeBSD' -a "$OS" != 'DragonFly' ]; then |
| 436 | echoscip-shell system . . echo. >&2 "$0: Your OS ($OS) is currently not supported. Aborting." |
| 437 | exit 1 |
| 438 | fi |
| 439 | |
| 440 | if [scip-shell system . . `[`. -f /etc/mandrake-releasescip-shell filesystem . . `/etc/mandrake-release`. ]; then |
| 441 | unsupported_distro='Mandriva' |
| 442 | fi |
| 443 | |
| 444 | if [scip-shell system . . `[`. -f /etc/slackware-versionscip-shell filesystem . . `/etc/slackware-version`. ] || ([scip-shell system . . `[`. -f /etc/os-releasescip-shell filesystem . . `/etc/os-release`. ] && . /etc/os-releasescip-shell source . . `/etc/os-release`. && [scip-shell system . . `[`. "$ID" = "slackware" ]); then |
| 445 | echoscip-shell system . . echo. >&2 "$0: Your distribution (Slackware) is currently not supported. Aborting. Try manually:" |
| 446 | # libedit requires a newer version than Slackware 14.2, for example Slackware-current |
| 447 | # or you build it manually: <http://thrysoee.dk/editline/> |
| 448 | echoscip-shell system . . echo. >&2 "$0: # slackpkg install make gcc pkg-config libedit util-linux sqlite libxml2 patch wget" |
| 449 | # required for libjansson |
| 450 | echoscip-shell system . . echo. >&2 "$0: # ./contrib/scripts/install_prereq install-unpackaged" |
| 451 | exit 1 |
| 452 | fi |
| 453 | |
| 454 | if [scip-shell system . . `[`. "$unsupported_distro" != '' ]; then |
| 455 | echoscip-shell system . . echo. >&2 "$0: Your distribution ($unsupported_distro) is currently not supported. Aborting." |
| 456 | exit 1 |
| 457 | fi |
| 458 | |
| 459 | # The distributions we do support: |
| 460 | if [scip-shell system . . `[`. -r /etc/debian_versionscip-shell filesystem . . `/etc/debian_version`. ]; then |
| 461 | if [scip-shell system . . `[`. -f /etc/linuxmint/infoscip-shell filesystem . . `/etc/linuxmint/info`. ]; then |
| 462 | handle_linuxmintscip-shell shell shell-project 0.0.0 handle_linuxmint(). |
| 463 | else |
| 464 | handle_debianscip-shell shell shell-project 0.0.0 handle_debian(). |
| 465 | fi |
| 466 | elif [scip-shell system . . `[`. -r /etc/redhat-releasescip-shell filesystem . . `/etc/redhat-release`. ]; then |
| 467 | handle_rhscip-shell shell shell-project 0.0.0 handle_rh(). |
| 468 | elif [scip-shell system . . `[`. -f /etc/SuSE-releasescip-shell filesystem . . `/etc/SuSE-release`. -o -f /etc/novell-releasescip-shell filesystem . . `/etc/novell-release`. ]; then |
| 469 | handle_SUSEscip-shell shell shell-project 0.0.0 handle_SUSE(). |
| 470 | elif [scip-shell system . . `[`. -f /etc/os-releasescip-shell filesystem . . `/etc/os-release`. ] && . /etc/os-releasescip-shell source . . `/etc/os-release`. && [scip-shell system . . `[`. "$ID" = "opensuse" ]; then |
| 471 | handle_SUSEscip-shell shell shell-project 0.0.0 handle_SUSE(). |
| 472 | elif [scip-shell system . . `[`. -r /etc/arch-releasescip-shell filesystem . . `/etc/arch-release`. ]; then |
| 473 | handle_archscip-shell shell shell-project 0.0.0 handle_arch(). |
| 474 | elif [scip-shell system . . `[`. -f /etc/os-releasescip-shell filesystem . . `/etc/os-release`. ] && . /etc/os-releasescip-shell source . . `/etc/os-release`. && [scip-shell system . . `[`. "$ID_LIKE" = "archlinux" ]; then |
| 475 | handle_archscip-shell shell shell-project 0.0.0 handle_arch(). # $ID=arch |
| 476 | elif [scip-shell system . . `[`. -f /etc/gentoo-releasescip-shell filesystem . . `/etc/gentoo-release`. ]; then |
| 477 | handle_gentooscip-shell shell shell-project 0.0.0 handle_gentoo(). |
| 478 | elif [scip-shell system . . `[`. -f /etc/os-releasescip-shell filesystem . . `/etc/os-release`. ] && . /etc/os-releasescip-shell source . . `/etc/os-release`. && [scip-shell system . . `[`. "$ID" = "gentoo" ]; then |
| 479 | handle_gentooscip-shell shell shell-project 0.0.0 handle_gentoo(). |
| 480 | elif [scip-shell system . . `[`. "$OS" = 'NetBSD' ]; then |
| 481 | handle_nbsdscip-shell shell shell-project 0.0.0 handle_nbsd(). |
| 482 | elif [scip-shell system . . `[`. "$OS" = 'OpenBSD' ]; then |
| 483 | handle_obsdscip-shell shell shell-project 0.0.0 handle_obsd(). |
| 484 | elif [scip-shell system . . `[`. "$OS" = 'FreeBSD' ]; then |
| 485 | handle_fbsdscip-shell shell shell-project 0.0.0 handle_fbsd(). |
| 486 | elif [scip-shell system . . `[`. "$OS" = 'DragonFly' ]; then |
| 487 | handle_dbsdscip-shell shell shell-project 0.0.0 handle_dbsd(). |
| 488 | fi |
| 489 | |
| 490 | if ! in_test_modescip-shell shell shell-project 0.0.0 in_test_mode().; then |
| 491 | echoscip-shell system . . echo. "#############################################" |
| 492 | echoscip-shell system . . echo. "## $1 completed successfully" |
| 493 | echoscip-shell system . . echo. "#############################################" |
| 494 | fi |