asterisk/asterisk.spec

changeset 798
4ef5d37e8bb2
parent 760
bafc40b5f634
equal deleted inserted replaced
23:d518ae2291cd 24:1c454099d2ea
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE. 21 ## SUCH DAMAGE.
22 ## 22 ##
23 23
24 # package version 24 # package version
25 %define V_opkg 1.8.20.2 25 %define V_opkg 1.8.30.0
26 %define V_asterisk 1.8.20.2 26 %define V_asterisk 1.8.30.0
27 %define V_asterisk_fax_subdir 1.8.4 27 %define V_asterisk_fax_subdir 1.8.4
28 %define V_asterisk_fax_digium 1.8.4_1.3.1 28 %define V_asterisk_fax_digium 1.8.4_1.3.1
29 %define V_asterisk_sounds_core 1.4.23 29 %define V_asterisk_sounds_core 1.4.25
30 %define V_asterisk_sounds_extra 1.4.13 30 %define V_asterisk_sounds_extra 1.4.14
31 %define V_asterisk_sounds_amoogab 1.4 31 %define V_asterisk_sounds_amoogab 1.4
32 %define V_asterisk_sounds_amootts current 32 %define V_asterisk_sounds_amootts current
33 %define V_asterisk_sounds_custom 1.0 33 %define V_asterisk_sounds_custom 1.0
34 %define V_asterisk_sounds_mohop 2.03 34 %define V_asterisk_sounds_mohop 2.03
35 %define V_asterisk_sounds_newpro july_2012 35 %define V_asterisk_sounds_newpro july_2012
36 %define V_asterisk_addons_mp3dec 1 36 %define V_asterisk_addons_mp3dec 1
37 %define V_fswitch_sounds_en 1.0.24 37 %define V_fswitch_sounds_en 1.0.25
38 %define V_fswitch_sounds_fr 1.0.18 38 %define V_fswitch_sounds_fr 1.0.18
39 %define V_fswitch_sounds_ru 1.0.13 39 %define V_fswitch_sounds_ru 1.0.13
40 %define V_fswitch_music 1.0.8 40 %define V_fswitch_music 1.0.8
41 %define V_asterisk_codecs_ilbc 20110104 41 %define V_asterisk_codecs_ilbc 20110104
42 %define V_chan_capi 1.1.6 42 %define V_chan_capi 1.1.6
50 Distribution: OpenPKG Community 50 Distribution: OpenPKG Community
51 Class: BASE 51 Class: BASE
52 Group: VoIP 52 Group: VoIP
53 License: GPL 53 License: GPL
54 Version: %{V_opkg} 54 Version: %{V_opkg}
55 Release: 20120800 55 Release: 20140800
56 56
57 # package options 57 # package options
58 %option with_dahdi no 58 %option with_dahdi no
59 %option with_capi no 59 %option with_capi no
60 %option with_ogg no 60 %option with_ogg no
61 %option with_mp3 no 61 %option with_mp3 no
62 %option with_fax no 62 %option with_faxmod no
63 %option with_faxarch generic
63 %option with_avcodec no 64 %option with_avcodec no
64 %option with_ldap no 65 %option with_ldap no
65 %option with_radius no 66 %option with_radius no
66 %option with_sqlite no 67 %option with_sqlite no
67 %option with_srtp no 68 %option with_srtp no
121 Patch0: asterisk.patch 122 Patch0: asterisk.patch
122 Patch1: asterisk.patch.xfersips 123 Patch1: asterisk.patch.xfersips
123 Patch2: asterisk.patch.proxymwi 124 Patch2: asterisk.patch.proxymwi
124 125
125 # build information 126 # build information
127 Prefix: %{l_prefix}
128 BuildRoot: %{l_buildroot}
126 BuildPreReq: OpenPKG, openpkg >= 20100101, bison, gcc, make, grep, pkgconfig 129 BuildPreReq: OpenPKG, openpkg >= 20100101, bison, gcc, make, grep, pkgconfig
127 PreReq: OpenPKG, openpkg >= 20100101, MTA 130 PreReq: OpenPKG, openpkg >= 20100101, MTA
128 BuildPreReq: zlib, curl, openssl, ncurses, speex, sox, popt, gmime, libxml 131 BuildPreReq: zlib, curl, openssl, ncurses, speex, sox, popt, gmime, libxml
129 PreReq: zlib, curl, openssl, ncurses, speex, sox, popt, gmime, libxml 132 PreReq: zlib, curl, openssl, ncurses, speex, sox, popt, gmime, libxml
130 %if "%{with_ogg}" == "yes" 133 %if "%{with_ogg}" == "yes"
182 PreReq: libpri > 1.4.11.5 185 PreReq: libpri > 1.4.11.5
183 %endif 186 %endif
184 %if "%{with_esounds}" == "yes" 187 %if "%{with_esounds}" == "yes"
185 BuildPreReq: sox, infozip 188 BuildPreReq: sox, infozip
186 %endif 189 %endif
190 AutoReq: no
191 AutoReqProv: no
187 192
188 %description 193 %description
189 Asterisk is a complete Private Branch Exchange (PBX) in software. 194 Asterisk is a complete Private Branch Exchange (PBX) in software.
190 It provides more than the features normally expected from a PBX, 195 It provides more than the features normally expected from a PBX,
191 and can transceive Voice over IP (VoIP) in many protocols. Asterisk 196 and can transceive Voice over IP (VoIP) in many protocols. Asterisk
276 ) | %{l_rpmtool} msg -b -t warn 281 ) | %{l_rpmtool} msg -b -t warn
277 %endif 282 %endif
278 %setup -q -n asterisk-%{V_asterisk} 283 %setup -q -n asterisk-%{V_asterisk}
279 %setup -q -n asterisk-%{V_asterisk} -D -T -a 1 284 %setup -q -n asterisk-%{V_asterisk} -D -T -a 1
280 %setup -q -n asterisk-%{V_asterisk} -D -T -a 2 285 %setup -q -n asterisk-%{V_asterisk} -D -T -a 2
281 %if "%{with_fax}" == "yes" 286 %if "%{with_faxmod}" == "yes"
282 %setup -q -n asterisk-%{V_asterisk} -D -T -a 23 287 %setup -q -n asterisk-%{V_asterisk} -D -T -a 23
283 %setup -q -n asterisk-%{V_asterisk} -D -T -a 24 288 %setup -q -n asterisk-%{V_asterisk} -D -T -a 24
284 %endif 289 %endif
285 ( cd addons 290 ( cd addons
286 %{l_tar} zxf %{_sourcedir}/mp3-%{V_asterisk_addons_mp3dec}.tar.gz 291 %{l_tar} zxf %{_sourcedir}/mp3-%{V_asterisk_addons_mp3dec}.tar.gz
309 -e 's;-lradiusclient-ng;-lradiusclient;g' \ 314 -e 's;-lradiusclient-ng;-lradiusclient;g' \
310 -e 's;radiusclient-ng\.h;radiusclient.h;g' \ 315 -e 's;radiusclient-ng\.h;radiusclient.h;g' \
311 -e 's;lua5\.1;lua;g' \ 316 -e 's;lua5\.1;lua;g' \
312 -e 's;-I${IMAP_TK_DIR}/c-client;-DUSE_SYSTEM_IMAP -I${IMAP_TK_DIR}/include/imap;g' \ 317 -e 's;-I${IMAP_TK_DIR}/c-client;-DUSE_SYSTEM_IMAP -I${IMAP_TK_DIR}/include/imap;g' \
313 -e 's;${IMAP_TK_DIR}/c-client/c-client\.a;-limap -lssl -lcrypto -lcrypt;g' \ 318 -e 's;${IMAP_TK_DIR}/c-client/c-client\.a;-limap -lssl -lcrypto -lcrypt;g' \
314 -e 's;LIBXML2_INCLUDE="-I\${LIBXML2_DIR}/include";echo "Removing really buggy hard coded LibXML include defs.";' \ 319 -e 's;LIBXML2_INCLUDE=\$(echo \${LIBXML2_INCLUDE} | \$SED -e "s|-I|-I\${LIBXML2_DIR}|g");echo "Removing really buggy hard coded LibXML include defs.";' \
320 -e 's;LIBXML2_LIB=\$(echo \${LIBXML2_LIB} | \$SED -e "s|-L|-L\${LIBXML2_DIR}|g");echo "Removing really buggy hard coded LibXML linkage defs.";' \
315 -e 's;\(for ver in 2\.0 2\.2 2\.4\);\1 2.6;' \ 321 -e 's;\(for ver in 2\.0 2\.2 2\.4\);\1 2.6;' \
316 -e 's;\(\-lpq.*\-lz.*\)";\1 ${PTHREAD_LIBS}";g'\ 322 -e 's;\(\-lpq.*\-lz.*\)";\1 ${PTHREAD_LIBS}";g'\
317 configure 323 configure
318 %{l_shtool} subst \ 324 %{l_shtool} subst \
319 -e 's;\(sh\) \(bash\) ksh sh5;\2 \1;' \ 325 -e 's;\(sh\) \(bash\) ksh sh5;\2 \1;' \
395 -e 's;^\(USE_OWN_LIBCAPI\)=yes;\1=no;' \ 401 -e 's;^\(USE_OWN_LIBCAPI\)=yes;\1=no;' \
396 chan_capi-%{V_chan_capi}/Makefile 402 chan_capi-%{V_chan_capi}/Makefile
397 %{l_shtool} subst \ 403 %{l_shtool} subst \
398 -e 's;#ifdef CC_AST_HAS_VERSION_1_6$;#if (defined(CC_AST_HAS_VERSION_1_6) \&\& !defined(CC_AST_HAS_VERSION_1_8));g' \ 404 -e 's;#ifdef CC_AST_HAS_VERSION_1_6$;#if (defined(CC_AST_HAS_VERSION_1_6) \&\& !defined(CC_AST_HAS_VERSION_1_8));g' \
399 chan_capi-%{V_chan_capi}/chan_capi_devstate.c 405 chan_capi-%{V_chan_capi}/chan_capi_devstate.c
406 %{l_shtool} subst \
407 -e "s;^\(NCURSES_INCLUDE=\).*;\1%{l_cppflags ncurses};" \
408 -e "s;^\(NCURSES_LIB=\);\1%{l_ldflags} ;" \
409 menuselect/makeopts.in
410 %{l_shtool} subst \
411 -e 's; *\.lastclean;;g' \
412 Makefile
400 case "%{l_platform -t}" in 413 case "%{l_platform -t}" in
401 *-sunos* ) 414 *-sunos* )
402 %{l_shtool} subst \ 415 %{l_shtool} subst \
403 -e 's;SO_SUPPRESS_SYMBOLS=-Wl,--version-script,[a-zA-Z0-9@\-_,\.()\$ ][a-zA-Z0-9@\-_,\.()\$ ]*;LOCAL_NOOP=0;' \ 416 -e 's;SO_SUPPRESS_SYMBOLS=-Wl,--version-script,[a-zA-Z0-9@\-_,\.()\$ ][a-zA-Z0-9@\-_,\.()\$ ]*;LOCAL_NOOP=0;' \
404 -e 's;ASTLINK+=-Wl,--version-script,[a-zA-Z0-9\-_\.,][a-zA-Z0-9\-_\.,]*;LOCAL_NOOP=0;' \ 417 -e 's;ASTLINK+=-Wl,--version-script,[a-zA-Z0-9\-_\.,][a-zA-Z0-9\-_\.,]*;LOCAL_NOOP=0;' \
617 ASTERISK_HEADER_DIR="`pwd`" 630 ASTERISK_HEADER_DIR="`pwd`"
618 ) || exit $? 631 ) || exit $?
619 %endif 632 %endif
620 633
621 %install 634 %install
635 # remove build cruft
636 rm -rf $RPM_BUILD_ROOT
637
622 # install program 638 # install program
623 %{l_make} %{l_mflags} install \ 639 %{l_make} %{l_mflags} install \
624 DESTDIR=$RPM_BUILD_ROOT \ 640 DESTDIR=$RPM_BUILD_ROOT \
625 INSTALL_PREFIX=%{l_prefix} 641 INSTALL_PREFIX=%{l_prefix}
626 642
632 INSTALL="%{l_shtool} install -c" \ 648 INSTALL="%{l_shtool} install -c" \
633 MODULES_DIR='$(INSTALL_PREFIX)/lib/asterisk/modules' 649 MODULES_DIR='$(INSTALL_PREFIX)/lib/asterisk/modules'
634 ) || exit $? 650 ) || exit $?
635 %endif 651 %endif
636 652
637 %if "%{with_fax}" == "yes" 653 %if "%{with_faxmod}" == "yes"
638 # install fax support 654 # install fax support
639 case "%{l_platform -t}" in 655 case "%{l_platform -t}" in
640 amd64*-* ) 656 amd64*-* )
641 %{l_shtool} install -c -m 755 \ 657 %{l_shtool} install -c -m 755 \
642 res_fax_digium-%{V_asterisk_fax_digium}-generic_64/res_*.so \ 658 res_fax_digium-%{V_asterisk_fax_digium}-generic_64/res_*.so \
711 # convert freeswitch 48000 and 441000 KHz to 8000 Khz 727 # convert freeswitch 48000 and 441000 KHz to 8000 Khz
712 # ffmpeg -i <in> -ar 8000 -ac 1 -acodec pcm_s16le -f s16le <out> 728 # ffmpeg -i <in> -ar 8000 -ac 1 -acodec pcm_s16le -f s16le <out>
713 cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk 729 cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk
714 for highfile in `find . -name '*.wav'`; do 730 for highfile in `find . -name '*.wav'`; do
715 lowfile=`echo $highfile | sed -e 's;\(.*\)\.wav;\1.sln16;'` 731 lowfile=`echo $highfile | sed -e 's;\(.*\)\.wav;\1.sln16;'`
716 %{l_prefix}/bin/sox $highfile -t raw -r 16000 -s -2 -c 1 $lowfile 732 %{l_prefix}/bin/sox $highfile -t raw -r 16000 -e signed-integer -b 16 -c 1 $lowfile
717 rm $highfile 733 rm $highfile
718 done 734 done
719 %endif 735 %endif
720 736
721 # install main sound prompt files 737 # install main sound prompt files
855 # '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/share/asterisk/sounds/fr/vm-Voicemail.sln16' \ 871 # '%attr(-,%{l_rusr},%{l_rgrp}) %{l_prefix}/share/asterisk/sounds/fr/vm-Voicemail.sln16' \
856 872
857 %files -f files 873 %files -f files
858 874
859 %clean 875 %clean
876 rm -rf $RPM_BUILD_ROOT
860 877
861 %post 878 %post
862 %if "%{with_dahdi}" == "yes" 879 %if "%{with_dahdi}" == "yes"
863 if [ $1 -eq 1 ]; then 880 if [ $1 -eq 1 ]; then
864 case "%{l_platform -t}" in 881 case "%{l_platform -t}" in
891 echo "CREATE TABLE map (key TEXT, val TEXT);" | $RPM_INSTALL_PREFIX/bin/isql "asterisk-sqlite" -b 908 echo "CREATE TABLE map (key TEXT, val TEXT);" | $RPM_INSTALL_PREFIX/bin/isql "asterisk-sqlite" -b
892 chown %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/var/asterisk/db/asterisk.sqlite >/dev/null 2>&1 || true 909 chown %{l_rusr}:%{l_rgrp} $RPM_INSTALL_PREFIX/var/asterisk/db/asterisk.sqlite >/dev/null 2>&1 || true
893 ) || exit $? 910 ) || exit $?
894 fi 911 fi
895 %endif 912 %endif
896 %if "%{with_fax}" == "yes" 913 %if "%{with_faxmod}" == "yes"
897 ( echo "Asterisk has been installed with proprietary Digium fax support." 914 ( echo "Asterisk has been installed with proprietary Digium fax support."
898 echo "The responsible module is called res_fax_digium and requires a" 915 echo "The responsible module is called res_fax_digium and requires a"
899 echo "valid license. The license must be found in the directory" 916 echo "valid license. The license must be found in the directory"
900 echo "'licenses' which in turn must be found in %{l_prefix}/share/asterisk" 917 echo "'licenses' which in turn must be found in %{l_prefix}/share/asterisk"
901 echo "or wherever astvarlibdir has been configured in 'asterisk.conf'." 918 echo "or wherever astvarlibdir has been configured in 'asterisk.conf'."

mercurial