asterisk/asterisk.spec

changeset 311
263143ec0fb2
parent 310
73d852a30c9a
child 315
75d162df42e8
     1.1 --- a/asterisk/asterisk.spec	Sun Mar 20 20:00:02 2011 +0100
     1.2 +++ b/asterisk/asterisk.spec	Sun Mar 20 20:03:11 2011 +0100
     1.3 @@ -1,6 +1,6 @@
     1.4  ##
     1.5  ##  asterisk.spec -- OpenPKG RPM Package Specification
     1.6 -##  Copyright (c) 2000-2010 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.7 +##  Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.8  ##
     1.9  ##  Permission to use, copy, modify, and distribute this software for
    1.10  ##  any purpose with or without fee is hereby granted, provided that
    1.11 @@ -22,13 +22,21 @@
    1.12  ##
    1.13  
    1.14  #   package version
    1.15 -%define       V_opkg                     1.6.2.13
    1.16 -%define       V_asterisk                 1.6.2.13
    1.17 -%define       V_asterisk_addons          1.6.2.2
    1.18 -%define       V_asterisk_sounds_core_en  1.4.20
    1.19 -%define       V_asterisk_sounds_core_de  current
    1.20 -%define       V_asterisk_sounds_extra_en 1.4.11
    1.21 -%define       V_chan_capi                1.1.5
    1.22 +%define       V_opkg                     1.8.3.2
    1.23 +%define       V_asterisk                 1.8.3.2
    1.24 +%define       V_asterisk_fax_digium      1.8.0_1.3.0
    1.25 +%define       V_asterisk_sounds_core     1.4.20
    1.26 +%define       V_asterisk_sounds_extra    1.4.11
    1.27 +%define       V_asterisk_sounds_amoogab  1.4
    1.28 +%define       V_asterisk_sounds_amootts  current
    1.29 +%define       V_asterisk_sounds_custom   1.0
    1.30 +%define       V_asterisk_sounds_mohop    2.03
    1.31 +%define       V_asterisk_addons_mp3dec   1
    1.32 +%define       V_fswitch_sounds_en        1.0.14
    1.33 +%define       V_fswitch_sounds_ru        1.0.12
    1.34 +%define       V_fswitch_music            1.0.8
    1.35 +%define       V_asterisk_codecs_ilbc     20110104
    1.36 +%define       V_chan_capi                1.1.5.919
    1.37  
    1.38  #   package information
    1.39  Name:         asterisk
    1.40 @@ -41,7 +49,7 @@
    1.41  Group:        VoIP
    1.42  License:      GPL
    1.43  Version:      %{V_opkg}
    1.44 -Release:      20101019
    1.45 +Release:      20110314
    1.46  
    1.47  #   package options
    1.48  %option       with_dahdi   no
    1.49 @@ -53,27 +61,56 @@
    1.50  %option       with_ldap    no
    1.51  %option       with_radius  no
    1.52  %option       with_sqlite  no
    1.53 +%option       with_srtp    no
    1.54 +%option       with_pgsql   no
    1.55  %option       with_lua     no
    1.56  %option       with_jabber  no
    1.57  %option       with_imap    no
    1.58  %option       with_odbc    no
    1.59 +%option       with_libpri  no
    1.60 +%option       with_esounds no
    1.61 +%option       with_xfersips yes
    1.62 +%option       with_proxymwi yes
    1.63 +%option       with_smdipoll 10
    1.64  
    1.65  #   list of sources
    1.66  Source0:      http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-%{V_asterisk}.tar.gz
    1.67 -Source1:      http://downloads.asterisk.org/pub/telephony/asterisk/releases/asterisk-addons-%{V_asterisk_addons}.tar.gz
    1.68 -Source2:      http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-en-alaw-%{V_asterisk_sounds_core_en}.tar.gz
    1.69 -Source3:      http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-extra-sounds-en-alaw-%{V_asterisk_sounds_extra_en}.tar.gz
    1.70 -Source4:      http://www.amooma.de/asterisk/sprachbausteine/asterisk-core-sounds-de-gsm-%{V_asterisk_sounds_core_de}.tar.gz
    1.71 -Source5:      ftp://ftp.chan-capi.org/chan-capi/chan_capi-%{V_chan_capi}.tar.gz
    1.72 -Source6:      asterisk.txt
    1.73 -Source7:      rc.asterisk
    1.74 +Source1:      ftp://ftp.chan-capi.org/chan-capi/chan_capi-%{V_chan_capi}.tar.gz
    1.75 +Source2:      ftp://ftp.europalab.com/pub/sfw/machsnds/asterisk-moh-freeplay-sln16.tar.gz
    1.76 +Source3:      http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-moh-opsound-sln16-%{V_asterisk_sounds_mohop}.tar.gz
    1.77 +Source4:      http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-en-sln16-%{V_asterisk_sounds_core}.tar.gz
    1.78 +Source5:      http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en_AU-sln16-current.tar.gz
    1.79 +Source6:      http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-es-sln16-%{V_asterisk_sounds_core}.tar.gz
    1.80 +Source7:      http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-fr-sln16-%{V_asterisk_sounds_core}.tar.gz
    1.81 +Source8:      http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-extra-sounds-en-sln16-%{V_asterisk_sounds_extra}.tar.gz
    1.82 +Source9:      http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-extra-sounds-fr-sln16-%{V_asterisk_sounds_extra}.tar.gz
    1.83 +Source10:     http://www.amooma.de/asterisk/sprachbausteine/asterisk-%{V_asterisk_sounds_amoogab}-de-prompts.tar.gz
    1.84 +Source11:     http://www.amooma.de/asterisk/sprachbausteine/asterisk-core-sounds-de-gsm-current.tar.gz
    1.85 +Source12:     ftp://ftp.europalab.com/pub/sfw/machsnds/de-digits/de-digits-%{V_asterisk_sounds_custom}.tar.bz2
    1.86 +Source13:     ftp://ftp.europalab.com/pub/sfw/machsnds/de-sounds/astmultisnds-de-sln16-%{V_asterisk_sounds_custom}.tar.bz2
    1.87 +Source14:     ftp://ftp.europalab.com/pub/sfw/machsnds/msvbsnds-sln16-%{V_asterisk_sounds_custom}.tar.bz2
    1.88 +Source15:     http://files.freeswitch.org/freeswitch-sounds-en-us-callie-48000-%{V_fswitch_sounds_en}.tar.gz
    1.89 +Source16:     http://files.freeswitch.org/freeswitch-sounds-es-mx-maria-44100.tar.gz
    1.90 +Source17:     http://files.freeswitch.org/freeswitch-sounds-ru-RU-elena-48000-%{V_fswitch_sounds_ru}.tar.gz
    1.91 +Source18:     http://files.freeswitch.org/freeswitch-sounds-music-48000-%{V_fswitch_music}.tar.gz
    1.92 +Source19:     http://svn.digium.com/svn/thirdparty/mp3/trunk/addons/mp3-%{V_asterisk_addons_mp3dec}.tar.gz
    1.93 +Source20:     http://downloads.digium.com/pub/telephony/fax/res_fax_digium/asterisk-1.8.0/x86-64/res_fax_digium-%{V_asterisk_fax_digium}-generic_64.tar.gz
    1.94 +Source21:     http://downloads.digium.com/pub/telephony/fax/res_fax_digium/asterisk-1.8.0/x86-32/res_fax_digium-%{V_asterisk_fax_digium}-generic_32.tar.gz
    1.95 +Source22:     ilbc-20110104.tar.gz
    1.96 +Source23:     asterisk.txt
    1.97 +Source24:     rc.asterisk
    1.98 +Source25:     wakeup.agi
    1.99  Patch0:       asterisk.patch
   1.100 +Patch1:       asterisk.patch.xfersips
   1.101 +Patch2:       asterisk.patch.proxymwi
   1.102  
   1.103  #   build information
   1.104 -BuildPreReq:  OpenPKG, openpkg >= 20100101, bison, gcc, make, grep
   1.105 -PreReq:       OpenPKG, openpkg >= 20100101, MTA
   1.106 -BuildPreReq:  zlib, curl, openssl, ncurses, speex, popt, gmime22
   1.107 -PreReq:       zlib, curl, openssl, ncurses, speex, popt, gmime22
   1.108 +Prefix:       %{l_prefix}
   1.109 +BuildRoot:    %{l_buildroot}
   1.110 +BuildPreReq:  OpenPKG, openpkg >= 20040130, bison, gcc, make, grep
   1.111 +PreReq:       OpenPKG, openpkg >= 20040130, MTA
   1.112 +BuildPreReq:  zlib, curl, openssl, ncurses, speex, sox, popt, gmime, libxml
   1.113 +PreReq:       zlib, curl, openssl, ncurses, speex, sox, popt, gmime, libxml
   1.114  %if "%{with_ogg}" == "yes"
   1.115  BuildPreReq:  vorbis-libs
   1.116  PreReq:       vorbis-libs
   1.117 @@ -89,14 +126,18 @@
   1.118  BuildPreReq:  sqlite
   1.119  PreReq:       sqlite
   1.120  %endif
   1.121 +%if "%{with_srtp}" == "yes"
   1.122 +BuildPreReq:  srtp
   1.123 +PreReq:       srtp
   1.124 +%endif
   1.125 +%if "%{with_pgsql}" == "yes"
   1.126 +BuildPreReq:  postgresql
   1.127 +PreReq:       postgresql
   1.128 +%endif
   1.129  %if "%{with_lua}" == "yes"
   1.130  BuildPreReq:  lua
   1.131  PreReq:       lua
   1.132  %endif
   1.133 -%if "%{with_fax}" == "yes"
   1.134 -BuildPreReq:  spandsp, tiff, jpeg, zlib
   1.135 -PreReq:       spandsp, tiff, jpeg, zlib
   1.136 -%endif
   1.137  %if "%{with_avcodec}" == "yes"
   1.138  BuildPreReq:  ffmpeg
   1.139  PreReq:       ffmpeg
   1.140 @@ -117,15 +158,37 @@
   1.141  BuildPreReq:  unixodbc, sqlite, sqlite::with_odbc = yes
   1.142  PreReq:       unixodbc, sqlite, sqlite::with_odbc = yes
   1.143  %endif
   1.144 +%if "%{with_libpri}" == "yes"
   1.145 +BuildPreReq:  libpri > 1.4.11.5
   1.146 +PreReq:       libpri > 1.4.11.5
   1.147 +%endif
   1.148 +%if "%{with_esounds}" == "yes"
   1.149 +BuildPreReq:  sox
   1.150 +%endif
   1.151 +AutoReq:      no
   1.152 +AutoReqProv:  no
   1.153  
   1.154  %description
   1.155      Asterisk is a complete Private Branch Exchange (PBX) in software.
   1.156 -    It provides all of the features you would expect from a PBX and
   1.157 -    more. Asterisk does Voice over IP (VoIP) in many protocols. Asterisk
   1.158 -    provides Voicemail services with Directory, Call Conferencing,
   1.159 -    Interactive Voice Response and Call Queuing. It has support for
   1.160 -    three-way calling, caller ID services, ADSI, SIP, etc. Asterisk
   1.161 -    needs no additional hardware for VoIP.
   1.162 +    It provides more than the features normally expected from a PBX,
   1.163 +    and can transceive Voice over IP (VoIP) in many protocols. Asterisk
   1.164 +    provides voicemail services with directory, call conferencing,
   1.165 +    interactive voice response and call queuing as well. It has support
   1.166 +    for three way calling, caller ID, ADSI, and SIP, and requires no
   1.167 +    additional hardware for VoIP applications.
   1.168 +
   1.169 +    This copy of Asterisk is optionally patched to allow the asterisk
   1.170 +    server to respond to SIP/TLS transfer requests using the Transfer()
   1.171 +    application. Should this option be chosen, the asterisk server
   1.172 +    successfully dispatches all transfer destinations using 'SIPS'
   1.173 +    technology by means of the standard SIP/2.0 302 Moved Temporarily
   1.174 +    message, with a URI resembling <sips:extension@hostname.tld:port>.
   1.175 +
   1.176 +    This copy of Asterisk is optionally patched as well to enclose the
   1.177 +    correct user name in NOTIFY messages when MWI logic detects changes
   1.178 +    in the state of Messages-Waiting. Asterisk will send NOTIFY messages
   1.179 +    with the URI 'user@hostname' instead of simply 'hostname'. This can
   1.180 +    be used by a external SIP proxy to route the MWI to the correct phone.
   1.181  
   1.182  %track
   1.183      prog asterisk = {
   1.184 @@ -133,26 +196,51 @@
   1.185          url       = http://downloads.asterisk.org/pub/telephony/asterisk/releases/
   1.186          regex     = asterisk-(\d+\.\d+(\.\d+)+)\.tar\.gz
   1.187      }
   1.188 -    prog asterisk:addons = {
   1.189 -        version   = %{V_asterisk_addons}
   1.190 -        url       = http://downloads.asterisk.org/pub/telephony/asterisk/releases/
   1.191 -        regex     = asterisk-addons-(\d+\.\d+(\.\d+)+)\.tar\.gz
   1.192 +    prog asterisk:fax_digium_32 = {
   1.193 +        version   = %{V_asterisk_fax_digium}
   1.194 +        url       = http://downloads.digium.com/pub/telephony/fax/res_fax_digium/asterisk-1.8.0/x86-32/
   1.195 +        regex     = res_fax_digium-(__VER__)-generic_32.tar.gz\.tar\.gz
   1.196      }
   1.197 -    prog asterisk:sounds_core_en = {
   1.198 -        version   = %{V_asterisk_sounds_core_en}
   1.199 +    prog asterisk:fax_digium_64 = {
   1.200 +        version   = %{V_asterisk_fax_digium}
   1.201 +        url       = http://downloads.digium.com/pub/telephony/fax/res_fax_digium/asterisk-1.8.0/x86-64/
   1.202 +        regex     = res_fax_digium-(__VER__)-generic_64.tar.gz\.tar\.gz
   1.203 +    }
   1.204 +    prog asterisk:sounds_core = {
   1.205 +        version   = %{V_asterisk_sounds_core}
   1.206          url       = http://downloads.asterisk.org/pub/telephony/sounds/releases/
   1.207 -        regex     = asterisk-core-sounds-en-alaw-(\d+\.\d+(\.\d+)+)\.tar\.gz
   1.208 +        regex     = asterisk-core-sounds-en-sln16-(\d+\.\d+(\.\d+)+)\.tar\.gz
   1.209      }
   1.210 -    prog asterisk:sounds_extra_en = {
   1.211 -        version   = %{V_asterisk_sounds_extra_en}
   1.212 +    prog asterisk:sounds_extra = {
   1.213 +        version   = %{V_asterisk_sounds_extra}
   1.214          url       = http://downloads.asterisk.org/pub/telephony/sounds/releases/
   1.215 -        regex     = asterisk-extra-sounds-en-alaw-(\d+\.\d+(\.\d+)+)\.tar\.gz
   1.216 +        regex     = asterisk-extra-sounds-en-sln16-(\d+\.\d+(\.\d+)+)\.tar\.gz
   1.217      }
   1.218 -    prog asterisk:sounds_core_de = {
   1.219 -        version   = %{V_asterisk_sounds_core_de}
   1.220 +    prog asterisk:sounds_amootts = {
   1.221 +        version   = %{V_asterisk_sounds_amootts}
   1.222          url       = http://www.amooma.de/asterisk/sprachbausteine/
   1.223          regex     = asterisk-core-sounds-de-gsm-(__VER__)\.tar\.gz
   1.224      }
   1.225 +    prog asterisk:sounds_amoogab = {
   1.226 +        version   = %{V_asterisk_sounds_amoogab}
   1.227 +        url       = http://www.amooma.de/asterisk/sprachbausteine/
   1.228 +        regex     = asterisk-(__VER__)-de-prompts\.tar\.gz
   1.229 +    }
   1.230 +    prog asterisk:sounds_digits = {
   1.231 +        version   = %{V_asterisk_sounds_custom}
   1.232 +        url       = ftp://ftp.europalab.com/pub/sfw/machsnds/de-digits/
   1.233 +        regex     = de-digits-(__VER__)\.tar\.bz2
   1.234 +    }
   1.235 +    prog asterisk:sounds_custom = {
   1.236 +        version   = %{V_asterisk_sounds_custom}
   1.237 +        url       = ftp://ftp.europalab.com/pub/sfw/machsnds/de-sounds/
   1.238 +        regex     = astmultisnds-de-sln16-(__VER__)\.tar\.bz2
   1.239 +    }
   1.240 +    prog asterisk:sounds_mohop = {
   1.241 +        version   = %{V_asterisk_sounds_mohop}
   1.242 +        url       = http://downloads.asterisk.org/pub/telephony/sounds/releases/
   1.243 +        regex     = asterisk-moh-opsound-sln16-(__VER__)\.tar\.gz
   1.244 +    }
   1.245      prog asterisk:chan_capi = {
   1.246          version   = %{V_chan_capi}
   1.247          url       = ftp://ftp.chan-capi.org/chan-capi/
   1.248 @@ -162,32 +250,126 @@
   1.249  %prep
   1.250      %setup -q -n asterisk-%{V_asterisk}
   1.251      %setup -q -n asterisk-%{V_asterisk} -D -T -a 1
   1.252 -    %setup -q -n asterisk-%{V_asterisk} -D -T -a 5
   1.253 +    %setup -q -n asterisk-%{V_asterisk} -D -T -a 2
   1.254 +%if "%{with_fax}" == "yes"
   1.255 +    %setup -q -n asterisk-%{V_asterisk} -D -T -a 20
   1.256 +    %setup -q -n asterisk-%{V_asterisk} -D -T -a 21
   1.257 +%endif
   1.258 +    ( cd addons
   1.259 +      %{l_tar} zxf %{_sourcedir}/mp3-%{V_asterisk_addons_mp3dec}.tar.gz
   1.260 +    ) || exit $?
   1.261 +    ( cd codecs
   1.262 +      %{l_tar} zxf %{_sourcedir}/ilbc-%{V_asterisk_codecs_ilbc}.tar.gz
   1.263 +      mv ilbc-%{V_asterisk_codecs_ilbc}/* ilbc/
   1.264 +      rmdir ilbc-%{V_asterisk_codecs_ilbc}
   1.265 +    ) || exit $?
   1.266      %patch -p0
   1.267 -    exit 0
   1.268 -    cp %{SOURCE2} %{SOURCE3} sounds/
   1.269 +%if "%{with_xfersips}" == "yes"
   1.270 +    %patch -p0 -P 1
   1.271 +%endif
   1.272 +%if "%{with_proxymwi}" == "yes"
   1.273 +    %patch -p0 -P 2
   1.274 +%endif
   1.275      %{l_shtool} subst \
   1.276 -        -e 's;\(CORE_SOUNDS_VERSION\):=.*$;\1:=%{V_asterisk_sounds_core_en};' \
   1.277 -        -e 's;\(EXTRA_SOUNDS_VERSION\):=.*$;\1:=%{V_asterisk_sounds_extra_en};' \
   1.278 +        -e 's;\(astdatadir=.*\)\${astvarlibdir};\1${datadir};' \
   1.279 +        -e 's;\(astvarlibdir=.*\)/lib/asterisk;\1/asterisk/lib;' \
   1.280 +        -e 's;\(dir=.*{localstatedir}\)/\([^/][^/]*\)/asterisk;\1/asterisk/\2;g' \
   1.281 +        configure
   1.282 +    %{l_shtool} subst \
   1.283 +        -e 's;-llua5\.1;-llua;' \
   1.284 +        -e 's;lua5\.1/lua\.h;lua/lua.h;' \
   1.285 +        -e 's;ffmpeg/avcodec\.h;libavcodec/avcodec.h;' \
   1.286 +        -e 's;\(sqlite\)\(_exec\);\13\2;g' \
   1.287 +        -e 's;-lradiusclient-ng;-lradiusclient;g' \
   1.288 +        -e 's;radiusclient-ng\.h;radiusclient.h;g' \
   1.289 +        -e 's;-I${IMAP_TK_DIR}/c-client;-DUSE_SYSTEM_IMAP -I${IMAP_TK_DIR}/include/imap;g' \
   1.290 +        -e 's;${IMAP_TK_DIR}/c-client/c-client\.a;-limap -lssl -lcrypto -lcrypt;g' \
   1.291 +        configure
   1.292 +    %{l_shtool} subst \
   1.293 +        -e 's;\(sh\) \(bash\) ksh sh5;\2 \1;' \
   1.294 +        configure
   1.295 +    %{l_shtool} subst \
   1.296 +        -e 's;^\(#define DEFAULT_DB .*\${ASTDBDIR}\)/astdb;\1/asterisk.db;' \
   1.297 +        build_tools/make_defaults_h
   1.298 +    %{l_shtool} subst \
   1.299 +        -e 's; *-I/usr/local/ssl/include;;g' \
   1.300 +        -e 's;/opt/ssl/include;%{l_prefix}/include;g' \
   1.301 +        -e 's;/usr/local;%{l_prefix};g' \
   1.302 +        Makefile
   1.303 +    %{l_shtool} subst \
   1.304 +        -e 's;\$(SUBMAKE);$(MAKE);g' \
   1.305 +        -e 's;\$(SILENTMAKE);$(MAKE) --quiet --no-print-directory;g' \
   1.306 +        -e 's;\$(MAKE_MENUSELECT); $(MAKE) -C menuselect;g' \
   1.307 +        Makefile
   1.308 +    %{l_shtool} subst \
   1.309 +        -e 's; *-L/usr/local/ssl/lib;;g' \
   1.310 +        -e 's;/opt/ssl/lib;%{l_prefix}/lib;g' \
   1.311 +        -e 's;/usr/local;%{l_prefix};g' \
   1.312 +        -e 's;\(ASTLINK=\)$;\1-Wl,--export-dynamic;g' \
   1.313 +        -e 's;\( CFLAGS=\)"[^"]+";"%{l_cflags -O}";g' \
   1.314 +        main/Makefile
   1.315 +    %{l_shtool} subst \
   1.316 +        -e 's;\(<defaultenabled>\)no\(</defaultenabled>\);\1yes\2;g' \
   1.317 +        addons/.*.moduleinfo \
   1.318 +        apps/.app_ivrdemo.moduleinfo \
   1.319 +        apps/.app_saycounted.moduleinfo \
   1.320 +        apps/.app_rpt.moduleinfo \
   1.321 +        codecs/.moduleinfo \
   1.322 +        utils/utils.xml \
   1.323 +        agi/agi.xml
   1.324 +    %{l_shtool} subst \
   1.325 +        -e 's;check_expr2;check_expr;g' \
   1.326 +        utils/utils.xml
   1.327 +    %{l_shtool} subst \
   1.328 +        -e 's;\(-DSOLARIS\);\1 -D__EXTENSIONS__=1;g' \
   1.329 +        main/editline/Makefile.in \
   1.330 +        main/db1-ast/Makefile
   1.331 +    %{l_shtool} subst \
   1.332 +        -e 's;%s/astdb;%s/asterisk.db;g' \
   1.333 +        main/asterisk.c
   1.334 +    %{l_shtool} subst \
   1.335 +        -e 's;u_int\([0-9]*\)_t;uint\1_t;g' \
   1.336 +        main/db1-ast/hash/hash.h
   1.337 +    %{l_shtool} subst \
   1.338 +        -e 's;if \(((tmp = strchr(name\);while \1;g' \
   1.339 +        main/abstract_jb.c
   1.340 +    %{l_shtool} subst \
   1.341 +        -e 's;\(CORE_SOUNDS_VERSION\):=.*$;\1:=%{V_asterisk_sounds_core};' \
   1.342 +        -e 's;\(EXTRA_SOUNDS_VERSION\):=.*$;\1:=%{V_asterisk_sounds_extra};' \
   1.343          sounds/Makefile
   1.344      %{l_shtool} subst \
   1.345 -        -e 's;-lradiusclient-ng;-lradiusclient;g' \
   1.346 -        -e 's;radiusclient-ng\.h;radiusclient.h;g' \
   1.347 -        configure cdr/cdr_radius.c
   1.348 +        -e 's;\(/etc/radiusclient-ng/radiusclient.conf\);%{l_prefix}\1;g' \
   1.349 +        -e 's;\(radiusclient\)-ng;\1;g' \
   1.350 +        cdr/cdr_radius.c \
   1.351 +        cel/cel_radius.c
   1.352 +    %{l_shtool} subst \
   1.353 +        -e 's;\(sqlite\)\(\.h\);\13\2;g' \
   1.354 +        cdr/cdr_sqlite.c
   1.355 +    %{l_shtool} subst \
   1.356 +        -e 's;\(#define DEFAULT_POLLING_INTERVAL\) .*;\1 %{with_smdipoll};' \
   1.357 +        res/res_smdi.c
   1.358 +    %{l_shtool} subst \
   1.359 +        -e 's;\(ASTERISK_HEADER_DIR=\).*;\1%{l_prefix}/include;g' \
   1.360 +        -e 's;\(MODULES_DIR=\).*;\1%{l_prefix}/lib/asterisk/modules;g' \
   1.361 +        -e 's;\(CONFIG_DIR=\).*;\1%{l_prefix}/etc/asterisk;g' \
   1.362 +        -e 's;\(\$(MODULES_DIR)\);$(DESTDIR)\1;g' \
   1.363 +        -e 's;\${CONFIG_DIR};$(DESTDIR)$(CONFIG_DIR);g' \
   1.364 +        -e 's;^\(USE_OWN_LIBCAPI\)=yes;\1=no;' \
   1.365 +        chan_capi-%{V_chan_capi}/Makefile
   1.366  
   1.367  %build
   1.368 -    #   sanity check
   1.369 +    #   sanity check operating system
   1.370  %if "%{with_dahdi}" == "yes"
   1.371      dahdi_prefix=""
   1.372      case "%{l_platform -t}" in
   1.373          *-linux* )
   1.374 -            if [ ! -f /usr/include/linux/dahdi.h ]; then
   1.375 +            if [ ! -f /usr/include/dahdi/user.h ]; then
   1.376                  echo "option \"with_dahdi\" requires DAHDI Linux drivers installed" 1>&2; exit 1
   1.377              fi
   1.378              dahdi_prefix=/usr
   1.379              ;;
   1.380          *-freebsd* )
   1.381 -            if [ ! -f /usr/local/include/dahdi/dahdi.h ]; then
   1.382 +            if [ ! -f /usr/local/include/dahdi/user.h ]; then
   1.383                  echo "option \"with_dahdi\" requires DAHDI FreeBSD drivers installed" 1>&2; exit 1
   1.384              fi
   1.385              dahdi_prefix=/usr/local
   1.386 @@ -195,8 +377,15 @@
   1.387          * ) echo "option \"with_dahdi\" supported under Linux and FreeBSD only" 1>&2; exit 1 ;;
   1.388      esac
   1.389  %endif
   1.390 +    #   correct platform dependent build configuration
   1.391 +    extflg=
   1.392 +    case "%{l_platform -t}" in
   1.393 +        *-linux* )
   1.394 +            pthlibflg='-lpthread'
   1.395 +            ;;
   1.396 +    esac
   1.397  
   1.398 -    #   re-configure music-on-hold to find mpg123
   1.399 +    #   adapt buildconf to find mpg123 (for music on hold)
   1.400  %if "%{with_mp3}" == "yes"
   1.401      mpg123="%{l_prefix}/bin/mpg123"
   1.402  %else
   1.403 @@ -207,21 +396,16 @@
   1.404          -e "s;/usr/bin/mpg123;$mpg123;" \
   1.405          res/res_musiconhold.c apps/app_mp3.c
   1.406  
   1.407 -    #   build program
   1.408 -    %{l_shtool} subst \
   1.409 -        -e 's;-llua5\.1;-llua;' \
   1.410 -        -e 's;lua5\.1/lua\.h;lua/lua.h;' \
   1.411 -        -e 's;ffmpeg/avcodec\.h;libavcodec/avcodec.h;' \
   1.412 -        configure
   1.413 +    #   configure program
   1.414      ( echo "ac_cv_prog_CONFIG_GMIME=%{l_prefix}/bin/gmime-config"
   1.415      ) >config.cache
   1.416      cflags="%{l_cflags -O}"
   1.417 -    cppflags="%{l_cppflags ncurses lua .}"
   1.418 +    cppflags="%{l_cppflags ncurses lua}"
   1.419      ldflags="%{l_ldflags}"
   1.420      libs=""
   1.421 -    cppflags="$cppflags `pkg-config gmime-2.0 --cflags-only-I`"
   1.422 -    ldflags="$ldflags `pkg-config gmime-2.0 --libs-only-L`"
   1.423 -    libs="$libs `pkg-config gmime-2.0 --libs-only-l`"
   1.424 +    cppflags="$cppflags `pkg-config gmime-2.4 --cflags-only-I`"
   1.425 +    ldflags="$ldflags `pkg-config gmime-2.4 --libs-only-L`"
   1.426 +    libs="$libs `pkg-config gmime-2.4 --libs-only-l` -lssl -lcrypto"
   1.427  %if "%{with_ogg}" == "yes"
   1.428      libs="$libs -logg -lm"
   1.429  %endif
   1.430 @@ -229,7 +413,7 @@
   1.431      libs="$libs -lavcodec -lavutil"
   1.432  %endif
   1.433  %if "%{with_ldap}" == "yes"
   1.434 -    libs="$libs -lldap -llber -lssl -lcrypto"
   1.435 +    libs="$libs -lldap -llber"
   1.436  %endif
   1.437  %if "%{with_dahdi}" == "yes"
   1.438      cppflags="$cppflags -I$dahdi_prefix/include"
   1.439 @@ -240,14 +424,18 @@
   1.440      CPPFLAGS="$cppflags" \
   1.441      LDFLAGS="$ldflags" \
   1.442      LIBS="$libs" \
   1.443 +    INSTALL="%{l_shtool} install -c" \
   1.444 +    PTHREAD_LIBS="$pthlibflg" \
   1.445      ./configure \
   1.446          --cache-file=./config.cache \
   1.447          --prefix=%{l_prefix} \
   1.448          --mandir=%{l_prefix}/man \
   1.449          --sysconfdir=%{l_prefix}/etc \
   1.450 -        --localstatedir=%{l_prefix}/var/asterisk \
   1.451 +        --localstatedir=%{l_prefix}/var \
   1.452 +        --datarootdir=%{l_prefix}/share/asterisk \
   1.453 +        --with-crypto=%{l_prefix} \
   1.454          --with-curl=%{l_prefix} \
   1.455 -        --with-ncurses \
   1.456 +        --with-ncurses=%{l_prefix} \
   1.457          --with-gsm="internal" \
   1.458          --with-popt=%{l_prefix} \
   1.459  %if "%{with_sqlite}" == "yes"
   1.460 @@ -255,6 +443,16 @@
   1.461  %else
   1.462          --without-sqlite3 \
   1.463  %endif
   1.464 +%if "%{with_srtp}" == "yes"
   1.465 +        --with-srtp=%{l_prefix} \
   1.466 +%else
   1.467 +        --without-srtp \
   1.468 +%endif
   1.469 +%if "%{with_pgsql}" == "yes"
   1.470 +        --with-postgres=%{l_prefix} \
   1.471 +%else
   1.472 +        --with-postgres=no \
   1.473 +%endif
   1.474          --with-speex=%{l_prefix} \
   1.475          --with-speexdsp=%{l_prefix} \
   1.476          --with-ssl=%{l_prefix} \
   1.477 @@ -301,6 +499,7 @@
   1.478  %endif
   1.479  %if "%{with_imap}" == "yes"
   1.480          --with-imap=%{l_prefix} \
   1.481 +        --disable-largefile \
   1.482  %else
   1.483          --without-imap \
   1.484  %endif
   1.485 @@ -309,80 +508,83 @@
   1.486  %else
   1.487          --without-odbc \
   1.488  %endif
   1.489 +%if "%{with_libpri}" == "yes"
   1.490 +        --with-pri=%{l_prefix} \
   1.491 +%else
   1.492 +        --without-pri \
   1.493 +%endif
   1.494 +        --with-sounds-cache=no \
   1.495          --without-netsnmp \
   1.496          --without-isdnnet \
   1.497          --without-misdn \
   1.498 -        --without-kde \
   1.499          --without-nbs \
   1.500          --without-newt \
   1.501          --without-asound \
   1.502          --without-oss \
   1.503 -        --without-qt \
   1.504          --without-sqlite \
   1.505 -        --without-postgres \
   1.506          --without-tds \
   1.507          --without-osptk \
   1.508 -        --without-pri \
   1.509          --without-suppserv \
   1.510          --without-vpb \
   1.511          --without-sdl \
   1.512          --without-x11 \
   1.513          --without-gtk \
   1.514          --without-gtk2
   1.515 -    %{l_make} %{l_mflags} \
   1.516 -        CC="%{l_cc} $cflags -I. -I./include -I../include -I../../include $cppflags"
   1.517 +
   1.518 +    #   build menuselect
   1.519 +    %{l_make} %{l_mflags -O} menuselect.makeopts
   1.520 +    %{l_shtool} subst \
   1.521 +        -e 's;\(MENUSELECT_MOH=\).*;\1;' \
   1.522 +        -e 's;\(MENUSELECT_CORE_SOUNDS=\).*;\1;' \
   1.523 +        -e 's;\(MENUSELECT_EXTRA_SOUNDS=\).*;\1;' \
   1.524 +        menuselect.makeopts
   1.525 +%if "%{with_imap}" == "yes"
   1.526 +    %{l_shtool} subst \
   1.527 +        -e 's;\(MENUSELECT_OPTS_app_voicemail=\).*;\1IMAP_STORAGE;' \
   1.528 +        menuselect.makeopts
   1.529 +%endif
   1.530 +
   1.531 +    #   build program
   1.532 +    %{l_make} %{l_mflags -O} \
   1.533 +        CC="%{l_cc} $cflags -I../include -I../../include $cppflags" NOISY_BUILD=yes
   1.534  
   1.535      #   build addon modules
   1.536 -    ( cd asterisk-addons-*
   1.537 -      ASTERISK_DIR="`pwd`/.." \
   1.538 -      CC="%{l_cc}" \
   1.539 -      CFLAGS="%{l_cflags -O}" \
   1.540 -      CPPFLAGS="%{l_cppflags ncurses tiff .}" \
   1.541 -      LDFLAGS="%{l_ldflags}" \
   1.542 -%if "%{with_fax}" == "yes"
   1.543 -      LIBS="-ltiff -ljpeg -lz -lm" \
   1.544 -%else
   1.545 -      LIBS="-lm" \
   1.546 -%endif
   1.547 -      ./configure \
   1.548 -          --prefix=%{l_prefix} \
   1.549 -          --mandir=%{l_prefix}/man \
   1.550 -          --sysconfdir=%{l_prefix}/etc \
   1.551 -          --localstatedir=%{l_prefix}/var/asterisk \
   1.552 -          --with-ncurses \
   1.553 -          --with-asterisk \
   1.554 -          --without-mysqlclient \
   1.555 -%if "%{with_fax}" == "yes"
   1.556 -          --with-spandsp=%{l_prefix}
   1.557 -%else
   1.558 -          --without-spandsp
   1.559 -%endif
   1.560 -      %{l_make} %{l_mflags} \
   1.561 -          CC="%{l_cc} %{l_cflags -O} -I. %{l_cppflags ncurses tiff .}"
   1.562 +    ( cd addons
   1.563 +      %{l_make} %{l_mflags -O} \
   1.564 +          CC="%{l_cc} %{l_cflags -O} -I../../include %{l_cppflags ncurses}" NOISY_BUILD=yes ASTTOPDIR=..
   1.565      ) || exit $?
   1.566 +
   1.567 +    #   build agi programs
   1.568 +    ( cd agi && %{l_make} %{l_mflags -O}) || exit $?
   1.569 +
   1.570  %if "%{with_capi}" == "yes"
   1.571 +    #   build capi channel
   1.572      ( cd chan_capi-*
   1.573        ln -s ../include/asterisk .
   1.574        ln -s ../include/asterisk.h .
   1.575 -      %{l_make} %{l_mflags} \
   1.576 +      %{l_make} %{l_mflags -O} V=1 \
   1.577            INSTALL_PREFIX=%{l_prefix} \
   1.578 -          ASTERISK_HEADER_DIR="`pwd`"
   1.579 +          ASTERISK_HEADER_DIR="`pwd`" \
   1.580      ) || exit $?
   1.581  %endif
   1.582  
   1.583  %install
   1.584      #   install program
   1.585 +    rm -rf $RPM_BUILD_ROOT
   1.586      %{l_make} %{l_mflags} install \
   1.587          DESTDIR=$RPM_BUILD_ROOT \
   1.588          INSTALL_PREFIX=%{l_prefix}
   1.589  
   1.590      #   install addon modules
   1.591 -    ( cd asterisk-addons-*
   1.592 +    ( cd addons
   1.593        %{l_make} %{l_mflags} install \
   1.594 +          ASTTOPDIR=.. \
   1.595            DESTDIR=$RPM_BUILD_ROOT \
   1.596            INSTALL_PREFIX=%{l_prefix}
   1.597      ) || exit $?
   1.598 +
   1.599  %if "%{with_capi}" == "yes"
   1.600 +    #   install capi channel
   1.601      ( cd chan_capi-*
   1.602        %{l_make} %{l_mflags} install \
   1.603            INSTALL_PREFIX=$RPM_BUILD_ROOT%{l_prefix} \
   1.604 @@ -391,34 +593,163 @@
   1.605      ) || exit $?
   1.606  %endif
   1.607  
   1.608 -    #   install addon sounds
   1.609 -    %{l_shtool} mkdir -f -p -m 755 \
   1.610 -        $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/de
   1.611 -    ( cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/de
   1.612 -      %{l_gzip} -d -c %{SOURCE4} | %{l_tar} xf -
   1.613 -    ) || exit $?
   1.614 +%if "%{with_fax}" == "yes"
   1.615 +    #   install fax support
   1.616 +    case "%{l_platform -t}" in
   1.617 +        amd64*-* )
   1.618 +            %{l_shtool} install -c -m 755 \
   1.619 +                res_fax_digium-%{V_asterisk_fax_digium}-generic_64/res_*.so \
   1.620 +                $RPM_BUILD_ROOT%{l_prefix}/lib/asterisk/modules/
   1.621 +            %{l_shtool} install -c -m 640 \
   1.622 +                res_fax_digium-%{V_asterisk_fax_digium}-generic_64/*.conf \
   1.623 +                $RPM_BUILD_ROOT%{l_prefix}/etc/asterisk/
   1.624 +            ;;
   1.625 +        i?86-* )
   1.626 +            %{l_shtool} install -c -m 755 \
   1.627 +                res_fax_digium-%{V_asterisk_fax_digium}-generic_32/res_*.so \
   1.628 +                $RPM_BUILD_ROOT%{l_prefix}/lib/asterisk/modules/
   1.629 +            %{l_shtool} install -c -m 640 \
   1.630 +                res_fax_digium-%{V_asterisk_fax_digium}-generic_32/*.conf \
   1.631 +                $RPM_BUILD_ROOT%{l_prefix}/etc/asterisk/
   1.632 +            ;;
   1.633 +        *-* ) 
   1.634 +            echo "Error determining hardware architecture." \
   1.635 +                | %{l_rpmtool} msg -b -t warn
   1.636 +            exit 1;
   1.637 +            ;;
   1.638 +    esac
   1.639 +%endif
   1.640 +
   1.641 +    ( echo 'Start of sound installation block (RPM)'
   1.642 +%if "%{with_esounds}" == "yes"
   1.643 +      #   install freeswitch sound prompt files, expecting
   1.644 +      #   identical sound filenames to be overwritten later
   1.645 +      cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/en
   1.646 +      %{l_tar} zxf %{_sourcedir}/freeswitch-sounds-en-us-callie-48000-%{V_fswitch_sounds_en}.tar.gz
   1.647 +      subs=`( cd en/us/callie && find * -type d -prune )`
   1.648 +      for subdir in $subs; do
   1.649 +          mkdir $subdir
   1.650 +          mv -f en/us/callie/$subdir/*/* ${subdir}/
   1.651 +      done
   1.652 +      rm -rf en
   1.653 +      cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/es
   1.654 +      %{l_tar} zxf %{_sourcedir}/freeswitch-sounds-es-mx-maria-44100.tar.gz
   1.655 +      subs=`( cd es/mx/maria && find * -type d -prune )`
   1.656 +      for subdir in $subs; do
   1.657 +          mkdir $subdir
   1.658 +          mv -f es/mx/maria/$subdir/*/* ${subdir}/
   1.659 +      done
   1.660 +      rm -rf es
   1.661 +      %{l_shtool} mkdir -f -p -m 755 \
   1.662 +          $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/ru
   1.663 +      cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/ru
   1.664 +      %{l_tar} zxf %{_sourcedir}/freeswitch-sounds-ru-RU-elena-48000-%{V_fswitch_sounds_ru}.tar.gz
   1.665 +      subs=`( cd ru/RU/elena && find * -type d -prune )`
   1.666 +      for subdir in $subs; do
   1.667 +          mkdir $subdir
   1.668 +          mv -f ru/RU/elena/$subdir/*/* ${subdir}/
   1.669 +      done
   1.670 +      rm -rf ru
   1.671 +
   1.672 +      #   install freeswitch music on hold files
   1.673 +      cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/moh
   1.674 +      %{l_tar} zxf %{_sourcedir}/freeswitch-sounds-music-48000-%{V_fswitch_music}.tar.gz
   1.675 +      mv -f music/48000/* . && rm -rf music
   1.676 +
   1.677 +      #   convert freeswitch 48000 and 441000 KHz to 8000 Khz
   1.678 +      cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk
   1.679 +      for highfile in `find . -name '*.wav'`; do
   1.680 +          lowfile=`echo $highfile | sed -e 's;\(.*\)\.wav;\1.sln16;'`
   1.681 +          %{l_prefix}/bin/sox $highfile -t raw -r 16000 -s -2 -c 1 $lowfile
   1.682 +          rm $highfile
   1.683 +      done
   1.684 +%endif
   1.685 +
   1.686 +      #   install australian nonversioned sound prompt files
   1.687 +      cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/en_AU
   1.688 +      %{l_tar} zxf %{_sourcedir}/asterisk-core-sounds-en_AU-current.tar.gz
   1.689 +
   1.690 +      #   install main sound prompt files
   1.691 +      #for codec in alaw ulaw g722 g729 gsm; do
   1.692 +      for lang in en es fr; do
   1.693 +          cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/${lang}
   1.694 +          %{l_tar} zxf %{_sourcedir}/asterisk-core-sounds-${lang}-sln16-%{V_asterisk_sounds_core}.tar.gz
   1.695 +      done
   1.696 +      for lang in en fr; do
   1.697 +          cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/${lang}
   1.698 +          %{l_tar} zxf %{_sourcedir}/asterisk-extra-sounds-${lang}-sln16-%{V_asterisk_sounds_extra}.tar.gz
   1.699 +      done
   1.700 +
   1.701 +      #   install special case sound files
   1.702 +      cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds
   1.703 +      #%{l_tar} jxf %{SOURCE de-digits-%{V_asterisk_sounds_custom}.tar.bz2}
   1.704 +      #( cd de && %{l_tar} zxf %{SOURCE asterisk-core-sounds-de-gsm-%{V_asterisk_sounds_amootts}.tar.gz} ) || exit $?
   1.705 +      #%{l_tar} zxf %{SOURCE asterisk-%{V_asterisk_sounds_amoogab}-de-prompts.tar.gz}
   1.706 +      #mv -f dictate/de/* de/dictate/ && rm -rf dictate/de
   1.707 +      #mv -f digits/de/* de/digits/ && rm -rf digits/de
   1.708 +      #mv -f letters/de/* de/letters/ && rm -rf letters/de
   1.709 +      #mv -f phonetic/de/* de/phonetic/ && rm -rf phonetic/de
   1.710 +      %{l_tar} jxf %{SOURCE astmultisnds-de-sln16-%{V_asterisk_sounds_custom}.tar.bz2}
   1.711 +      %{l_tar} jxf %{SOURCE msvbsnds-sln16-%{V_asterisk_sounds_custom}.tar.bz2}
   1.712 +
   1.713 +      #   install additional asterisk music on hold
   1.714 +      cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/moh
   1.715 +      %{l_tar} zxf %{_sourcedir}/asterisk-moh-freeplay-sln16.tar.gz
   1.716 +      %{l_tar} zxf %{_sourcedir}/asterisk-moh-opsound-sln16-%{V_asterisk_sounds_mohop}.tar.gz
   1.717 +
   1.718 +      #   correct sound permissions
   1.719 +      find $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/ -type f \
   1.720 +          | xargs chmod 644
   1.721 +      find $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/ -type d \
   1.722 +          | xargs chmod 755
   1.723 +
   1.724 +      #   apply provisional workaround for bug 0016104
   1.725 +      #   https://issues.asterisk.org/view.php?id=16104
   1.726 +      cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds
   1.727 +      cd en && ln -s vm-INBOX.sln16 vm-Voicemail.sln16
   1.728 +      cd ../es && ln -s vm-INBOX.sln16 vm-Voicemail.sln16
   1.729 +      cd ../de && ln -s vm-INBOX.sln16 vm-Voicemail.sln16
   1.730 +      cd ../fr && ln -s vm-INBOX.sln16 vm-Voicemail.sln16
   1.731 +
   1.732 +#      #   install nonstandard voicemail prompts
   1.733 +#      %{l_shtool} mkdir -f -p -m 755 \
   1.734 +#          $RPM_BUILD_ROOT%{l_prefix}/var/asterisk/spool/voicemail/default/%{exten}/unavail
   1.735 +#      %{l_shtool} install -c -m 660 \
   1.736 +#          %{_sourcedir}/ansage-%{V_ansage}.wav} \
   1.737 +#          $RPM_BUILD_ROOT%{l_prefix}/var/asterisk/spool/voicemail/default/%{exten}/unavail.wav
   1.738 +    ) || exit $?  # End of sound installation block (RPM)
   1.739  
   1.740      #   strip down installation
   1.741      rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/autosupport >/dev/null 2>&1 || true
   1.742      rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/safe_asterisk >/dev/null 2>&1 || true
   1.743      rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/autosupport.8 >/dev/null 2>&1 || true
   1.744      rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man8/safe_asterisk.8 >/dev/null 2>&1 || true
   1.745 -    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/firmware >/dev/null 2>&1 || true
   1.746      rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/images >/dev/null 2>&1 || true
   1.747 -    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/.asterisk* >/dev/null 2>&1 || true
   1.748 -    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/en/CREDIT* >/dev/null 2>&1 || true
   1.749 -    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/en/CHANGES* >/dev/null 2>&1 || true
   1.750 -    rmdir $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/es >/dev/null 2>&1 || true
   1.751 -    rmdir $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/fr >/dev/null 2>&1 || true
   1.752 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/moh/CREDIT* >/dev/null 2>&1 || true
   1.753 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/moh/CHANGES* >/dev/null 2>&1 || true
   1.754 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/*/CREDIT* >/dev/null 2>&1 || true
   1.755 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/*/CHANGES* >/dev/null 2>&1 || true
   1.756  
   1.757      #   create additional directories
   1.758      %{l_shtool} mkdir -f -p -m 755 \
   1.759 -        $RPM_BUILD_ROOT%{l_prefix}/var/asterisk/db
   1.760 +        $RPM_BUILD_ROOT%{l_prefix}/var/asterisk/db \
   1.761 +        $RPM_BUILD_ROOT%{l_prefix}/var/asterisk/lib/licenses \
   1.762 +        $RPM_BUILD_ROOT%{l_prefix}/var/asterisk/spool/outgoing
   1.763  
   1.764 -    #   post-adjust installation
   1.765 -    strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true
   1.766 +    #   postadjust installation
   1.767 +    strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* \
   1.768 +          $RPM_BUILD_ROOT%{l_prefix}/lib/asterisk/modules/* \
   1.769 +          $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/agi-bin/* \
   1.770 +          >/dev/null 2>&1 || true
   1.771      mv  $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/agi-bin \
   1.772          $RPM_BUILD_ROOT%{l_prefix}/lib/asterisk/agi-bin
   1.773 +
   1.774 +    #   install AGI progs
   1.775 +    ( cd agi
   1.776 +      %{l_shtool} install -c -m 755 %{l_value -s -a} \
   1.777 +          DialAnMp3.agi fastagi-test numeralize %{SOURCE wakeup.agi} \
   1.778 +          $RPM_BUILD_ROOT%{l_prefix}/lib/asterisk/agi-bin/
   1.779 +    ) || exit $?
   1.780      for bin in $RPM_BUILD_ROOT%{l_prefix}/lib/asterisk/agi-bin/*.*; do
   1.781          mv $bin `echo $bin | sed -e 's;\.[^.]*$;;'`
   1.782      done
   1.783 @@ -444,7 +775,7 @@
   1.784              $name $RPM_BUILD_ROOT%{l_prefix}/etc/asterisk/
   1.785      done
   1.786  
   1.787 -    #   install run-command script
   1.788 +    #   install runcommand script
   1.789      %{l_shtool} mkdir -f -p -m 755 \
   1.790          $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   1.791      %{l_shtool} install -c -m 755 %{l_value -s -a} \
   1.792 @@ -453,12 +784,18 @@
   1.793      #   determine installation files
   1.794      %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   1.795          %{l_files_std} \
   1.796 +        '%config %{l_prefix}/var/asterisk/lib/licenses' \
   1.797          '%config %attr(640,%{l_mgrp},%{l_rgrp}) %{l_prefix}/etc/asterisk/*' \
   1.798          '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/asterisk'
   1.799  
   1.800 +#        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/share/asterisk/sounds/es/vm-Voicemail.sln16' \
   1.801 +#        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/share/asterisk/sounds/de/vm-Voicemail.sln16' \
   1.802 +#        '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/share/asterisk/sounds/fr/vm-Voicemail.sln16' \
   1.803 +
   1.804  %files -f files
   1.805  
   1.806  %clean
   1.807 +    rm -rf $RPM_BUILD_ROOT
   1.808  
   1.809  %post
   1.810  %if "%{with_dahdi}" == "yes"
   1.811 @@ -495,6 +832,16 @@
   1.812          ) || exit $?
   1.813      fi
   1.814  %endif
   1.815 +%if "%{with_fax}" == "yes"
   1.816 +    ( echo "Asterisk has been installed with proprietary Digium fax support."
   1.817 +      echo "The responsible module is called res_fax_digium and requires a"
   1.818 +      echo "valid license. The license must be found in the directory"
   1.819 +      echo "'licenses' which in turn must be found in $prefix/var/asterisk/lib"
   1.820 +      echo "or wherever astvarlibdir has been configured in 'asterisk.conf'."
   1.821 +      echo ""
   1.822 +      echo "Please see http://downloads.digium.com/pub/telephony/fax/ for information."
   1.823 +    ) | %{l_rpmtool} msg -b -t notice
   1.824 +%endif
   1.825      #   after upgrade, restart service
   1.826      [ $1 -eq 2 ] || exit 0
   1.827      eval `%{l_rc} asterisk status 2>/dev/null`
   1.828 @@ -509,6 +856,7 @@
   1.829      rm -f $RPM_INSTALL_PREFIX/var/asterisk/log/cdr-*/* >/dev/null 2>&1 || true
   1.830      rm -f $RPM_INSTALL_PREFIX/var/asterisk/run/*       >/dev/null 2>&1 || true
   1.831      rm -f $RPM_INSTALL_PREFIX/var/asterisk/spool/*/*   >/dev/null 2>&1 || true
   1.832 +    rm -f $RPM_INSTALL_PREFIX/var/asterisk/lib/*       >/dev/null 2>&1 || true
   1.833      rm -f $RPM_INSTALL_PREFIX/var/asterisk/db/*        >/dev/null 2>&1 || true
   1.834  %if "%{with_odbc}" == "yes"
   1.835      #   before erase, optionally unlink from ODBC and destroy database

mercurial