1.1 --- a/asterisk/asterisk.spec Sat Mar 24 21:00:00 2012 +0100 1.2 +++ b/asterisk/asterisk.spec Sat Mar 24 21:40:49 2012 +0100 1.3 @@ -38,7 +38,7 @@ 1.4 %define V_fswitch_sounds_ru 1.0.13 1.5 %define V_fswitch_music 1.0.8 1.6 %define V_asterisk_codecs_ilbc 20110104 1.7 -%define V_chan_capi 1.1.5.20110914 1.8 +%define V_chan_capi 1.1.5.20120324 1.9 1.10 # package information 1.11 Name: asterisk 1.12 @@ -51,7 +51,7 @@ 1.13 Group: VoIP 1.14 License: GPL 1.15 Version: %{V_opkg} 1.16 -Release: 20120320 1.17 +Release: 20120325 1.18 1.19 # package options 1.20 %option with_dahdi no 1.21 @@ -298,6 +298,9 @@ 1.22 -e 's;lua5\.1;lua;g' \ 1.23 -e 's;-I${IMAP_TK_DIR}/c-client;-DUSE_SYSTEM_IMAP -I${IMAP_TK_DIR}/include/imap;g' \ 1.24 -e 's;${IMAP_TK_DIR}/c-client/c-client\.a;-limap -lssl -lcrypto -lcrypt;g' \ 1.25 + -e 's;LIBXML2_INCLUDE="-I\${LIBXML2_DIR}/include";echo "Removing really buggy hard coded LibXML include defs.";' \ 1.26 + -e 's;\(for ver in 2\.0 2\.2 2\.4\);\1 2.6;' \ 1.27 + -e 's;\(\-lpq.*\-lz.*\)";\1 ${PTHREAD_LIBS}";g'\ 1.28 configure 1.29 %{l_shtool} subst \ 1.30 -e 's;\(sh\) \(bash\) ksh sh5;\2 \1;' \ 1.31 @@ -315,6 +318,7 @@ 1.32 -e 's;\$(SUBMAKE);$(MAKE);g' \ 1.33 -e 's;\$(SILENTMAKE);$(MAKE) --quiet --no-print-directory;g' \ 1.34 -e 's;\$(MAKE_MENUSELECT); $(MAKE) -C menuselect;g' \ 1.35 + -e 's;-march=\$(PROC);-march=native;g' \ 1.36 Makefile 1.37 %{l_shtool} subst \ 1.38 -e 's; *-L/usr/local/ssl/lib;;g' \ 1.39 @@ -335,6 +339,9 @@ 1.40 main/editline/Makefile.in \ 1.41 main/db1-ast/Makefile 1.42 %{l_shtool} subst \ 1.43 + -e 's;^\(install:\).*;\1;' \ 1.44 + sounds/Makefile 1.45 + %{l_shtool} subst \ 1.46 -e 's;%s/astdb;%s/asterisk.db;g' \ 1.47 main/asterisk.c 1.48 %{l_shtool} subst \ 1.49 @@ -344,6 +351,12 @@ 1.50 -e 's;if \(((tmp = strchr(name\);while \1;g' \ 1.51 main/abstract_jb.c 1.52 %{l_shtool} subst \ 1.53 + -e 's;if.*SSL_CTX_use_certificate_file.*;if (SSL_CTX_use_certificate_chain_file(cfg->ssl_ctx, cfg->certfile) == 0) {;' \ 1.54 + main/tcptls.c 1.55 + %{l_shtool} subst \ 1.56 + -e 's;ast_random();rand();' \ 1.57 + main/strcompat.c 1.58 + %{l_shtool} subst \ 1.59 -e 's;\(/etc/radiusclient-ng/radiusclient.conf\);%{l_prefix}\1;g' \ 1.60 -e 's;\(radiusclient\)-ng;\1;g' \ 1.61 cdr/cdr_radius.c \ 1.62 @@ -362,9 +375,17 @@ 1.63 -e 's;\${CONFIG_DIR};$(DESTDIR)$(CONFIG_DIR);g' \ 1.64 -e 's;^\(USE_OWN_LIBCAPI\)=yes;\1=no;' \ 1.65 chan_capi-%{V_chan_capi}/Makefile 1.66 - %{l_shtool} subst \ 1.67 - -e 's;if.*SSL_CTX_use_certificate_file.*;if (SSL_CTX_use_certificate_chain_file(cfg->ssl_ctx, cfg->certfile) == 0) {;' \ 1.68 - main/tcptls.c 1.69 + case "%{l_platform -t}" in 1.70 + *-sunos* ) 1.71 + %{l_shtool} subst \ 1.72 + -e 's;SO_SUPPRESS_SYMBOLS=-Wl,--version-script,[a-zA-Z0-9@\-_,\.()\$ ][a-zA-Z0-9@\-_,\.()\$ ]*;LOCAL_NOOP=0;' \ 1.73 + -e 's;ASTLINK+=-Wl,--version-script,[a-zA-Z0-9\-_\.,][a-zA-Z0-9\-_\.,]*;LOCAL_NOOP=0;' \ 1.74 + -e 's;-Wl,--version-script=[^ ][^ ]* *;;' \ 1.75 + Makefile.rules \ 1.76 + main/Makefile \ 1.77 + main/db1-ast/Makefile 1.78 + ;; 1.79 + esac 1.80 1.81 %build 1.82 # sanity check operating system 1.83 @@ -388,10 +409,14 @@ 1.84 %endif 1.85 # correct platform dependent build configuration 1.86 extflg= 1.87 + loclibs="-lssl -lcrypto" 1.88 case "%{l_platform -t}" in 1.89 *-linux* ) 1.90 pthlibflg='-lpthread' 1.91 ;; 1.92 + *-sunos* ) 1.93 + loclibs="$loclibs -lsocket -lnsl" 1.94 + ;; 1.95 esac 1.96 1.97 # adapt buildconf to find mpg123 (for music on hold) 1.98 @@ -406,23 +431,19 @@ 1.99 res/res_musiconhold.c apps/app_mp3.c 1.100 1.101 # configure program 1.102 - ( echo "ac_cv_prog_CONFIG_GMIME=%{l_prefix}/bin/gmime-config" 1.103 - ) >config.cache 1.104 cflags="%{l_cflags -O}" 1.105 cppflags="%{l_cppflags ncurses lua}" 1.106 ldflags="%{l_ldflags}" 1.107 - libs="" 1.108 - cppflags="$cppflags `pkg-config gmime-2.4 --cflags-only-I`" 1.109 - ldflags="$ldflags `pkg-config gmime-2.4 --libs-only-L`" 1.110 - libs="$libs `pkg-config gmime-2.4 --libs-only-l` -lssl -lcrypto" 1.111 + cppflags="$cppflags" 1.112 + ldflags="$ldflags" 1.113 %if "%{with_ogg}" == "yes" 1.114 - libs="$libs -logg -lm" 1.115 + loclibs="$loclibs -logg -lm" 1.116 %endif 1.117 %if "%{with_avcodec}" == "yes" 1.118 - libs="$libs -lavcodec -lavutil" 1.119 + loclibs="$loclibs -lavcodec -lavutil" 1.120 %endif 1.121 %if "%{with_ldap}" == "yes" 1.122 - libs="$libs -lldap -llber" 1.123 + loclibs="$loclibs -lldap -llber" 1.124 %endif 1.125 %if "%{with_dahdi}" == "yes" 1.126 cppflags="$cppflags -I$dahdi_prefix/include" 1.127 @@ -432,7 +453,7 @@ 1.128 CFLAGS="$cflags" \ 1.129 CPPFLAGS="$cppflags" \ 1.130 LDFLAGS="$ldflags" \ 1.131 - LIBS="$libs" \ 1.132 + LIBS="$loclibs" \ 1.133 INSTALL="%{l_shtool} install -c" \ 1.134 PTHREAD_LIBS="$pthlibflg" \ 1.135 ./configure \ 1.136 @@ -524,6 +545,7 @@ 1.137 --without-pri \ 1.138 %endif 1.139 --with-sounds-cache=%_sourcedir \ 1.140 + --with-libxml2=%{l_prefix} \ 1.141 --without-netsnmp \ 1.142 --without-isdnnet \ 1.143 --without-misdn \ 1.144 @@ -561,7 +583,7 @@ 1.145 1.146 # build program 1.147 %{l_make} %{l_mflags -O} \ 1.148 - CC="%{l_cc} $cflags -I../include -I../../include $cppflags" NOISY_BUILD=yes 1.149 + CC="%{l_cc} $cflags -I../include $cppflags" NOISY_BUILD=yes 1.150 1.151 %if "%{with_capi}" == "yes" 1.152 # build capi channel 1.153 @@ -618,8 +640,13 @@ 1.154 esac 1.155 %endif 1.156 1.157 - ( echo 'Start of sound installation block (RPM)' 1.158 + ( echo 'Start of sound installation block (OpenPKG)' 1.159 %if "%{with_esounds}" == "yes" 1.160 + # create sound directory hierarchy 1.161 + for sndir in en es fr ru en_AU moh; do 1.162 + %{l_shtool} mkdir -f -p -m 755 \ 1.163 + $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/$sndir 1.164 + done 1.165 # install freeswitch sound prompt files, expecting 1.166 # identical sound filenames to be overwritten later 1.167 cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/en 1.168 @@ -638,8 +665,6 @@ 1.169 mv -f es/mx/maria/$subdir/*/* ${subdir}/ 1.170 done 1.171 rm -rf es 1.172 - %{l_shtool} mkdir -f -p -m 755 \ 1.173 - $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/ru 1.174 cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/ru 1.175 %{l_tar} zxf %{_sourcedir}/freeswitch-sounds-ru-RU-elena-48000-%{V_fswitch_sounds_ru}.tar.gz 1.176 subs=`( cd ru/RU/elena && find * -type d -prune )` 1.177 @@ -664,13 +689,9 @@ 1.178 done 1.179 %endif 1.180 1.181 - # install australian nonversioned sound prompt files 1.182 - cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/en_AU 1.183 - %{l_tar} zxf %%{_sourcedir}/asterisk-core-sounds-en_AU-sln16-%{V_asterisk_sounds_core}.tar.gz 1.184 - 1.185 # install main sound prompt files 1.186 #for codec in alaw ulaw g722 g729 gsm; do 1.187 - for lang in en es fr; do 1.188 + for lang in en en_AU es fr; do 1.189 cd $RPM_BUILD_ROOT%{l_prefix}/share/asterisk/sounds/${lang} 1.190 %{l_tar} zxf %{_sourcedir}/asterisk-core-sounds-${lang}-sln16-%{V_asterisk_sounds_core}.tar.gz 1.191 done