diff options
-rwxr-xr-x | contrib/scripts/install_prereq | 19 | ||||
-rw-r--r-- | res/res_config_pgsql.c | 9 |
2 files changed, 17 insertions, 11 deletions
diff --git a/contrib/scripts/install_prereq b/contrib/scripts/install_prereq index c4b91f6f8..e3b217c08 100755 --- a/contrib/scripts/install_prereq +++ b/contrib/scripts/install_prereq @@ -21,14 +21,19 @@ usage() { # Basic build system: PACKAGES_DEBIAN="build-essential" # Asterisk: basic requirements: -PACKAGES_DEBIAN="$PACKAGES_DEBIAN libncurses-dev libz-dev libssl-dev libxml2-dev libsqlite3-dev uuid-dev uuid" +PACKAGES_DEBIAN="$PACKAGES_DEBIAN libedit-dev libjansson-dev libsqlite3-dev uuid-dev libxml2-dev" # Asterisk: for addons: -PACKAGES_DEBIAN="$PACKAGES_DEBIAN libcurl-dev libspeex-dev libspeexdsp-dev libogg-dev libvorbis-dev libasound2-dev portaudio19-dev libcurl4-openssl-dev" -PACKAGES_DEBIAN="$PACKAGES_DEBIAN libpq-dev unixodbc-dev libsqlite0-dev libmysqlclient15-dev libneon27-dev libgmime-dev libusb-dev liblua5.1-0-dev lua5.1" -PACKAGES_DEBIAN="$PACKAGES_DEBIAN libopenh323-dev libvpb-dev libgtk2.0-dev libmysqlclient-dev libbluetooth-dev libradiusclient-ng-dev freetds-dev" -PACKAGES_DEBIAN="$PACKAGES_DEBIAN libsnmp-dev libiksemel-dev libcorosync-dev libcpg-dev libcfg-dev libnewt-dev libpopt-dev libical-dev libspandsp-dev libjack-dev" -PACKAGES_DEBIAN="$PACKAGES_DEBIAN libresample-dev libc-client-dev binutils-dev libsrtp-dev libgsm1-dev libedit-dev doxygen libjansson-dev libldap-dev" -PACKAGES_DEBIAN="$PACKAGES_DEBIAN subversion git libxslt1-dev automake libsrtp-dev libncurses5-dev python-dev" +PACKAGES_DEBIAN="$PACKAGES_DEBIAN libspeex-dev libspeexdsp-dev libogg-dev libvorbis-dev libasound2-dev portaudio19-dev libcurl4-openssl-dev xmlstarlet bison flex" +PACKAGES_DEBIAN="$PACKAGES_DEBIAN libpq-dev unixodbc-dev libneon27-dev libgmime-2.6-dev libusb-dev liblua5.2-dev lua5.2 liburiparser-dev libxslt1-dev libssl-dev" +PACKAGES_DEBIAN="$PACKAGES_DEBIAN libh323plus-dev libvpb-dev libmysqlclient-dev libbluetooth-dev libradcli-dev freetds-dev libosptk-dev libjack-jackd2-dev" +PACKAGES_DEBIAN="$PACKAGES_DEBIAN libsnmp-dev libiksemel-dev libcorosync-common-dev libcpg-dev libcfg-dev libnewt-dev libpopt-dev libical-dev libspandsp-dev" +PACKAGES_DEBIAN="$PACKAGES_DEBIAN libresample1-dev libc-client2007e-dev binutils-dev libsrtp0-dev libsrtp2-dev libgsm1-dev doxygen zlib1g-dev libldap2-dev" +PACKAGES_DEBIAN="$PACKAGES_DEBIAN libcodec2-dev libfftw3-dev libsndfile1-dev libunbound-dev" +# Asterisk: for the unpackaged below: +PACKAGES_DEBIAN="$PACKAGES_DEBIAN wget subversion" +# Asterisk: for ./configure --with-pjproject-bundled: +PACKAGES_DEBIAN="$PACKAGES_DEBIAN bzip2 patch python-dev" + PACKAGES_RH="automake bzip2 gcc gcc-c++ patch ncurses-devel openssl-devel libxml2-devel unixODBC-devel libcurl-devel libogg-devel libvorbis-devel speex-devel" PACKAGES_RH="$PACKAGES_RH spandsp-devel freetds-devel net-snmp-devel iksemel-devel corosynclib-devel newt-devel popt-devel libtool-ltdl-devel lua-devel" PACKAGES_RH="$PACKAGES_RH sqlite-devel libsqlite3x-devel radiusclient-ng-devel portaudio-devel postgresql-devel libresample-devel neon-devel libical-devel" diff --git a/res/res_config_pgsql.c b/res/res_config_pgsql.c index e436e2ff8..cee4e488d 100644 --- a/res/res_config_pgsql.c +++ b/res/res_config_pgsql.c @@ -1215,7 +1215,8 @@ static int require_pgsql(const char *database, const char *tablename, va_list ap struct columns *column; struct tables *table; char *elm; - int type, size, res = 0; + int type, res = 0; + unsigned int size; /* * Ignore database from the extconfig.conf since it was @@ -1231,7 +1232,7 @@ static int require_pgsql(const char *database, const char *tablename, va_list ap while ((elm = va_arg(ap, char *))) { type = va_arg(ap, require_type); - size = va_arg(ap, int); + size = va_arg(ap, unsigned int); AST_LIST_TRAVERSE(&table->columns, column, list) { if (strcmp(column->name, elm) == 0) { /* Char can hold anything, as long as it is large enough */ @@ -1288,14 +1289,14 @@ static int require_pgsql(const char *database, const char *tablename, va_list ap res = -1; } else { struct ast_str *sql = ast_str_create(100); - char fieldtype[15]; + char fieldtype[10]; PGresult *result; if (requirements == RQ_CREATECHAR || type == RQ_CHAR) { /* Size is minimum length; make it at least 50% greater, * just to be sure, because PostgreSQL doesn't support * resizing columns. */ - snprintf(fieldtype, sizeof(fieldtype), "CHAR(%hhu)", + snprintf(fieldtype, sizeof(fieldtype), "CHAR(%u)", size < 15 ? size * 2 : (size * 3 / 2 > 255) ? 255 : size * 3 / 2); } else if (type == RQ_INTEGER1 || type == RQ_UINTEGER1 || type == RQ_INTEGER2) { |